protobuf client->server communication almost working

This commit is contained in:
Max-Wilhelm Bruker 2011-12-18 18:35:14 +01:00
parent 4eb9dfc5bf
commit 314f17091d
96 changed files with 1633 additions and 860 deletions

View file

@ -0,0 +1,5 @@
[Dolphin]
AdditionalInfoV2=Details_Size,Details_Date,CustomizedDetails
Timestamp=2011,12,18,12,16,39
Version=2
ViewMode=1

View file

@ -0,0 +1,21 @@
message AdminCommand {
enum AdminCommandType {
UPDATE_SERVER_MESSAGE = 1000;
SHUTDOWN_SERVER = 1001;
}
extensions 100 to max;
}
message Command_UpdateServerMessage {
extend AdminCommand {
optional Command_UpdateServerMessage ext = 1000;
}
}
message Command_ShutdownServer {
extend AdminCommand {
optional Command_ShutdownServer ext = 1001;
}
optional string reason = 1;
optional uint32 minutes = 2;
}

View file

@ -0,0 +1,6 @@
message color {
optional uint32 r = 1;
optional uint32 g = 2;
optional uint32 b = 3;
optional uint32 a = 4;
}

View file

@ -0,0 +1,13 @@
import "game_commands.proto";
message Command_AttachCard {
extend GameCommand {
optional Command_AttachCard ext = 1009;
}
optional string start_zone = 1;
optional sint32 card_id = 2;
optional sint32 target_player_id = 3;
optional string target_zone = 4;
optional sint32 target_card_id = 5;
}

View file

@ -0,0 +1,6 @@
import "game_commands.proto";
message Command_Concede {
extend GameCommand {
optional Command_Concede ext = 1017;
}
}

View file

@ -0,0 +1,17 @@
import "game_commands.proto";
import "color.proto";
message Command_CreateArrow {
extend GameCommand {
optional Command_CreateArrow ext = 1011;
}
optional sint32 start_player_id = 1;
optional string start_zone = 2;
optional sint32 start_card_id = 3;
optional sint32 target_player_id = 4;
optional string target_zone = 5;
optional sint32 target_card_id = 6;
optional color arrow_color = 7;
}

View file

@ -0,0 +1,12 @@
import "game_commands.proto";
import "color.proto";
message Command_CreateCounter {
extend GameCommand {
optional Command_CreateCounter ext = 1019;
}
optional string counter_name = 1;
optional color counter_color = 2;
optional uint32 radius = 3;
optional sint32 value = 4;
}

View file

@ -0,0 +1,16 @@
import "game_commands.proto";
message Command_CreateToken {
extend GameCommand {
optional Command_CreateToken ext = 1010;
}
optional string zone = 1;
optional string card_name = 2;
optional string color = 3;
optional string pt = 4;
optional string annotation = 5;
optional bool destroy_on_zone_change = 6;
optional sint32 x = 7;
optional sint32 y = 8;
}

View file

@ -0,0 +1,8 @@
import "session_commands.proto";
message Command_DeckDel {
extend SessionCommand {
optional Command_DeckDel ext = 1011;
}
optional uint32 deck_id = 1;
}

View file

@ -0,0 +1,9 @@
import "session_commands.proto";
message Command_DeckDelDir {
extend SessionCommand {
optional Command_DeckDelDir ext = 1010;
}
optional string path = 1;
}

View file

@ -0,0 +1,9 @@
import "session_commands.proto";
message Command_DeckDownload {
extend SessionCommand {
optional Command_DeckDownload ext = 1012;
}
optional uint32 deck_id = 1;
}

View file

@ -0,0 +1,10 @@
import "session_commands.proto";
message Command_DeckNewDir {
extend SessionCommand {
optional Command_DeckNewDir ext = 1009;
}
optional string path = 1;
optional string dir_name = 2;
}

View file

@ -0,0 +1,8 @@
import "game_commands.proto";
message Command_DeckSelect {
extend GameCommand {
optional Command_DeckSelect ext = 1029;
}
optional string deck = 1;
optional sint32 deck_id = 2;
}

View file

@ -0,0 +1,10 @@
import "session_commands.proto";
message Command_DeckUpload {
extend SessionCommand {
optional Command_DeckUpload ext = 1013;
}
optional string path = 1;
optional string deck_list = 2;
}

View file

@ -0,0 +1,7 @@
import "game_commands.proto";
message Command_DelCounter {
extend GameCommand {
optional Command_DelCounter ext = 1021;
}
optional sint32 counter_id = 1;
}

View file

@ -0,0 +1,7 @@
import "game_commands.proto";
message Command_DeleteArrow {
extend GameCommand {
optional Command_DeleteArrow ext = 1012;
}
optional sint32 arrow_id = 1;
}

View file

@ -0,0 +1,8 @@
import "game_commands.proto";
message Command_DrawCards {
extend GameCommand {
optional Command_DrawCards ext = 1006;
}
optional uint32 number = 1;
}

View file

@ -0,0 +1,9 @@
import "game_commands.proto";
message Command_DumpZone {
extend GameCommand {
optional Command_DumpZone ext = 1024;
}
optional sint32 player_id = 1;
optional string zone_name = 2;
optional sint32 number_cards = 3;
}

View file

@ -0,0 +1,11 @@
import "game_commands.proto";
message Command_FlipCard {
extend GameCommand {
optional Command_FlipCard ext = 1008;
}
optional string zone = 1;
optional sint32 card_id = 2;
optional bool face_down = 3;
}

View file

@ -0,0 +1,9 @@
import "game_commands.proto";
message Command_GameSay {
extend GameCommand {
optional Command_GameSay ext = 1002;
}
optional string message = 1;
}

View file

@ -0,0 +1,10 @@
import "game_commands.proto";
message Command_IncCardCounter {
extend GameCommand {
optional Command_IncCardCounter ext = 1015;
}
optional string zone = 1;
optional sint32 card_id = 2;
optional sint32 counter_id = 3;
optional sint32 counter_delta = 4;
}

View file

@ -0,0 +1,8 @@
import "game_commands.proto";
message Command_IncCounter {
extend GameCommand {
optional Command_IncCounter ext = 1018;
}
optional sint32 counter_id = 1;
optional sint32 delta = 2;
}

View file

@ -0,0 +1,8 @@
import "game_commands.proto";
message Command_KickFromGame {
extend GameCommand {
optional Command_KickFromGame ext = 1000;
}
optional sint32 player_id = 1;
}

View file

@ -0,0 +1,7 @@
import "game_commands.proto";
message Command_LeaveGame {
extend GameCommand {
optional Command_LeaveGame ext = 1001;
}
}

View file

@ -0,0 +1,24 @@
import "game_commands.proto";
message CardToMove {
optional sint32 card_id = 1;
optional bool face_down = 2;
optional string pt = 3;
optional bool tapped = 4;
}
message ListOfCardsToMove {
repeated CardToMove card = 1;
}
message Command_MoveCard {
extend GameCommand {
optional Command_MoveCard ext = 1027;
}
optional string start_zone = 1;
optional ListOfCardsToMove cards_to_move = 2;
optional sint32 target_player_id = 3;
optional string target_zone = 4;
optional sint32 x = 5;
optional sint32 y = 6;
}

View file

@ -0,0 +1,8 @@
import "game_commands.proto";
message Command_Mulligan {
extend GameCommand {
optional Command_Mulligan ext = 1004;
}
}

View file

@ -0,0 +1,6 @@
import "game_commands.proto";
message Command_NextTurn {
extend GameCommand {
optional Command_NextTurn ext = 1022;
}
}

View file

@ -0,0 +1,7 @@
import "game_commands.proto";
message Command_ReadyStart {
extend GameCommand {
optional Command_ReadyStart ext = 1016;
}
optional bool ready = 1;
}

View file

@ -0,0 +1,9 @@
import "game_commands.proto";
message Command_RevealCards {
extend GameCommand {
optional Command_RevealCards ext = 1026;
}
optional string zone_name = 1;
optional sint32 card_id = 2;
optional sint32 player_id = 3;
}

View file

@ -0,0 +1,8 @@
import "game_commands.proto";
message Command_RollDie {
extend GameCommand {
optional Command_RollDie ext = 1005;
}
optional uint32 sides = 1;
}

View file

@ -0,0 +1,7 @@
import "game_commands.proto";
message Command_SetActivePhase {
extend GameCommand {
optional Command_SetActivePhase ext = 1023;
}
optional uint32 phase = 1;
}

View file

@ -0,0 +1,10 @@
import "game_commands.proto";
message Command_SetCardAttr {
extend GameCommand {
optional Command_SetCardAttr ext = 1013;
}
optional string zone = 1;
optional sint32 card_id = 2;
optional string attr_name = 3;
optional string attr_value = 4;
}

View file

@ -0,0 +1,10 @@
import "game_commands.proto";
message Command_SetCardCounter {
extend GameCommand {
optional Command_SetCardCounter ext = 1014;
}
optional string zone = 1;
optional sint32 card_id = 2;
optional sint32 counter_id = 3;
optional sint32 counter_value = 4;
}

View file

@ -0,0 +1,8 @@
import "game_commands.proto";
message Command_SetCounter {
extend GameCommand {
optional Command_SetCounter ext = 1020;
}
optional sint32 counter_id = 1;
optional sint32 value = 2;
}

View file

@ -0,0 +1,10 @@
import "game_commands.proto";
import "move_card_to_zone.proto";
message Command_SetSideboardPlan {
extend GameCommand {
optional Command_SetSideboardPlan ext = 1028;
}
repeated MoveCard_ToZone move_list = 1;
}

View file

@ -0,0 +1,7 @@
import "game_commands.proto";
message Command_Shuffle {
extend GameCommand {
optional Command_Shuffle ext = 1003;
}
}

View file

@ -0,0 +1,8 @@
import "game_commands.proto";
message Command_StopDumpZone {
extend GameCommand {
optional Command_StopDumpZone ext = 1025;
}
optional sint32 player_id = 1;
optional string zone_name = 2;
}

View file

@ -0,0 +1,6 @@
import "game_commands.proto";
message Command_UndoDraw {
extend GameCommand {
optional Command_UndoDraw ext = 1007;
}
}

View file

@ -0,0 +1,18 @@
import "session_commands.proto";
import "game_commands.proto";
import "room_commands.proto";
import "moderator_commands.proto";
import "admin_commands.proto";
message CommandContainer {
required uint64 cmd_id = 1;
optional uint32 game_id = 10;
optional uint32 room_id = 20;
repeated SessionCommand session_command = 100;
repeated GameCommand game_command = 101;
repeated RoomCommand room_command = 102;
repeated ModeratorCommand moderator_command = 103;
repeated AdminCommand admin_command = 104;
}

View file

@ -0,0 +1,35 @@
message GameCommand {
enum GameCommandType {
KICK_FROM_GAME = 1000;
LEAVE_GAME = 1001;
GAME_SAY = 1002;
SHUFFLE = 1003;
MULLIGAN = 1004;
ROLL_DIE = 1005;
DRAW_CARDS = 1006;
UNDO_DRAW = 1007;
FLIP_CARD = 1008;
ATTACH_CARD = 1009;
CREATE_TOKEN = 1010;
CREATE_ARROW = 1011;
DELETE_ARROW = 1012;
SET_CARD_ATTR = 1013;
SET_CARD_COUNTER = 1014;
INC_CARD_COUNTER = 1015;
READY_START = 1016;
CONCEDE = 1017;
INC_COUNTER = 1018;
CREATE_COUNTER = 1019;
SET_COUNTER = 1020;
DEL_COUNTER = 1021;
NEXT_TURN = 1022;
SET_ACTIVE_PHASE = 1023;
DUMP_ZONE = 1024;
STOP_DUMP_ZONE = 1025;
REVEAL_CARDS = 1026;
MOVE_CARD = 1027;
SET_SIDEBOARD_PLAN = 1028;
DECK_SELECT = 1029;
}
extensions 100 to max;
}

View file

@ -0,0 +1,16 @@
message ModeratorCommand {
enum ModeratorCommandType {
BAN_FROM_SERVER = 1000;
}
extensions 100 to max;
}
message Command_BanFromServer {
extend ModeratorCommand {
optional Command_BanFromServer ext = 1000;
}
optional string user_name = 1;
optional string address = 2;
optional uint32 minutes = 3;
optional string reason = 4;
}

View file

@ -0,0 +1,5 @@
message MoveCard_ToZone {
optional string card_name = 1;
optional string start_zone = 2;
optional string target_zone = 3;
}

View file

@ -0,0 +1,48 @@
message RoomCommand {
enum RoomCommandType {
LEAVE_ROOM = 1000;
ROOM_SAY = 1001;
CREATE_GAME = 1002;
JOIN_GAME = 1003;
}
extensions 100 to max;
}
message Command_LeaveRoom {
extend RoomCommand {
optional Command_LeaveRoom ext = 1000;
}
}
message Command_RoomSay {
extend RoomCommand {
optional Command_RoomSay ext = 1001;
}
optional string message = 1;
}
message Command_CreateGame {
extend RoomCommand {
optional Command_CreateGame ext = 1002;
}
optional string description = 1;
optional string password = 2;
optional uint32 max_players = 3;
optional bool only_buddies = 4;
optional bool only_registered = 5;
optional bool spectators_allowed = 6;
optional bool spectators_need_password = 7;
optional bool spectators_can_talk = 8;
optional bool spectators_see_everything = 9;
repeated uint32 game_type_ids = 10;
}
message Command_JoinGame {
extend RoomCommand {
optional Command_JoinGame ext = 1003;
}
optional uint32 game_id = 1;
optional string password = 2;
optional bool spectator = 3;
optional bool override_restrictions = 4;
}

View file

@ -0,0 +1,98 @@
message SessionCommand {
enum SessionCommandType {
PING = 1000;
LOGIN = 1001;
MESSAGE = 1002;
LIST_USERS = 1003;
GET_GAMES_OF_USER = 1004;
GET_USER_INFO = 1005;
ADD_TO_LIST = 1006;
REMOVE_FROM_LIST = 1007;
DECK_LIST = 1008;
DECK_NEW_DIR = 1009;
DECK_DEL_DIR = 1010;
DECK_DEL = 1011;
DECK_DOWNLOAD = 1012;
DECK_UPLOAD = 1013;
LIST_ROOMS = 1014;
JOIN_ROOM = 1015;
}
extensions 100 to max;
}
message Command_Ping {
extend SessionCommand {
optional Command_Ping ext = 1000;
}
}
message Command_Login {
extend SessionCommand {
optional Command_Login ext = 1001;
}
optional string user_name = 1;
optional string password = 2;
}
message Command_Message {
extend SessionCommand {
optional Command_Message ext = 1002;
}
optional string user_name = 1;
optional string message = 2;
}
message Command_ListUsers {
extend SessionCommand {
optional Command_ListUsers ext = 1003;
}
}
message Command_GetGamesOfUser {
extend SessionCommand {
optional Command_GetGamesOfUser ext = 1004;
}
optional string user_name = 1;
}
message Command_GetUserInfo {
extend SessionCommand {
optional Command_GetUserInfo ext = 1005;
}
optional string user_name = 1;
}
message Command_AddToList {
extend SessionCommand {
optional Command_AddToList ext = 1006;
}
optional string list = 1;
optional string user_name = 2;
}
message Command_RemoveFromList {
extend SessionCommand {
optional Command_RemoveFromList ext = 1007;
}
optional string list = 1;
optional string user_name = 2;
}
message Command_DeckList {
extend SessionCommand {
optional Command_DeckList ext = 1008;
}
}
message Command_ListRooms {
extend SessionCommand {
optional Command_ListRooms ext = 1014;
}
}
message Command_JoinRoom {
extend SessionCommand {
optional Command_JoinRoom ext = 1015;
}
optional uint32 room_id = 1;
}