added responses + events

This commit is contained in:
Max-Wilhelm Bruker 2011-12-29 19:40:41 +01:00
parent 26f0f0df0e
commit ca9122b9fb
84 changed files with 815 additions and 1482 deletions

View file

@ -0,0 +1,7 @@
import "game_event_context.proto";
message Context_Concede {
extend GameEventContext {
optional Context_Concede ext = 1001;
}
}

View file

@ -0,0 +1,8 @@
import "game_event_context.proto";
message Context_DeckSelect {
extend GameEventContext {
optional Context_DeckSelect ext = 1002;
}
optional string deck_hash = 1;
}

View file

@ -0,0 +1,7 @@
import "game_event_context.proto";
message Context_MoveCard {
extend GameEventContext {
optional Context_MoveCard ext = 1004;
}
}

View file

@ -0,0 +1,8 @@
import "game_event_context.proto";
message Context_Mulligan {
extend GameEventContext {
optional Context_Mulligan ext = 1005;
}
optional uint32 number = 1;
}

View file

@ -0,0 +1,7 @@
import "game_event_context.proto";
message Context_ReadyStart {
extend GameEventContext {
optional Context_ReadyStart ext = 1000;
}
}

View file

@ -0,0 +1,7 @@
import "game_event_context.proto";
message Context_UndoDraw {
extend GameEventContext {
optional Context_UndoDraw ext = 1003;
}
}

View file

@ -0,0 +1,10 @@
import "session_event.proto";
import "serverinfo_user.proto";
message Event_AddToList {
extend SessionEvent {
optional Event_AddToList ext = 1005;
}
optional string list_name = 1;
optional ServerInfo_User user_info = 2;
}

View file

@ -0,0 +1,12 @@
import "game_event.proto";
message Event_AttachCard {
extend GameEvent {
optional Event_AttachCard ext = 2012;
}
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,8 @@
import "session_event.proto";
message Event_ConnectionClosed {
extend SessionEvent {
optional Event_ConnectionClosed ext = 1002;
}
optional string reason = 1;
}

View file

@ -0,0 +1,8 @@
import "game_event.proto";
message Event_ConnectionStateChanged {
extend GameEvent {
optional Event_ConnectionStateChanged ext = 1006;
}
optional bool connected = 1;
}

View file

@ -0,0 +1,9 @@
import "game_event.proto";
import "serverinfo_arrow.proto";
message Event_CreateArrows {
extend GameEvent {
optional Event_CreateArrows ext = 2000;
}
repeated ServerInfo_Arrow arrow_list = 1;
}

View file

@ -0,0 +1,9 @@
import "game_event.proto";
import "serverinfo_counter.proto";
message Event_CreateCounters {
extend GameEvent {
optional Event_CreateCounters ext = 2002;
}
repeated ServerInfo_Counter counter_list = 1;
}

View file

@ -0,0 +1,16 @@
import "game_event.proto";
message Event_CreateToken {
extend GameEvent {
optional Event_CreateToken ext = 2013;
}
optional string zone_name = 1;
optional sint32 card_id = 2;
optional string card_name = 3;
optional string color = 4;
optional string pt = 5;
optional string annotation = 6;
optional bool destroy_on_zone_change = 7;
optional sint32 x = 8;
optional sint32 y = 9;
}

View file

@ -0,0 +1,8 @@
import "game_event.proto";
message Event_DelCounter {
extend GameEvent {
optional Event_DelCounter ext = 2004;
}
optional sint32 counter_id = 1;
}

View file

@ -0,0 +1,8 @@
import "game_event.proto";
message Event_DeleteArrow {
extend GameEvent {
optional Event_DeleteArrow ext = 2001;
}
optional sint32 arrow_id = 1;
}

View file

@ -0,0 +1,9 @@
import "game_event.proto";
message Event_DestroyCard {
extend GameEvent {
optional Event_DestroyCard ext = 2011;
}
optional string zone_name = 1;
optional uint32 card_id = 2;
}

View file

@ -0,0 +1,10 @@
import "game_event.proto";
import "serverinfo_card.proto";
message Event_DrawCards {
extend GameEvent {
optional Event_DrawCards ext = 2005;
}
optional sint32 number = 1;
repeated ServerInfo_Card cards = 2;
}

View file

@ -0,0 +1,10 @@
import "game_event.proto";
message Event_DumpZone {
extend GameEvent {
optional Event_DumpZone ext = 2018;
}
optional sint32 zone_owner_id = 1;
optional string zone_name = 2;
optional sint32 number_cards = 3;
}

View file

@ -0,0 +1,11 @@
import "game_event.proto";
message Event_FlipCard {
extend GameEvent {
optional Event_FlipCard ext = 2010;
}
optional string zone_name = 1;
optional sint32 card_id = 2;
optional string card_name = 3;
optional bool face_down = 4;
}

View file

@ -0,0 +1,7 @@
import "game_event.proto";
message Event_GameClosed {
extend GameEvent {
optional Event_GameClosed ext = 1002;
}
}

View file

@ -0,0 +1,8 @@
import "game_event.proto";
message Event_GameHostChanged {
extend GameEvent {
optional Event_GameHostChanged ext = 1003;
}
}

View file

@ -0,0 +1,15 @@
import "session_event.proto";
message Event_GameJoined {
extend SessionEvent {
optional Event_GameJoined ext = 1009;
}
optional sint32 game_id = 1;
optional string game_description = 2;
optional sint32 host_id = 3;
optional sint32 player_id = 4;
optional bool spectator = 5;
optional bool spectators_can_talk = 6;
optional bool spectators_see_everything = 7;
optional bool resuming = 8;
}

View file

@ -0,0 +1,8 @@
import "game_event.proto";
message Event_GameSay {
extend GameEvent {
optional Event_GameSay ext = 1009;
}
optional string message = 1;
}

View file

@ -0,0 +1,12 @@
import "game_event.proto";
import "serverinfo_player.proto";
message Event_GameStateChanged {
extend GameEvent {
optional Event_GameStateChanged ext = 1005;
}
repeated ServerInfo_Player player_list = 1;
optional bool game_started = 2;
optional sint32 active_player_id = 3;
optional sint32 active_phase = 4;
}

View file

@ -0,0 +1,9 @@
import "game_event.proto";
import "serverinfo_playerproperties.proto";
message Event_Join {
extend GameEvent {
optional Event_Join ext = 1000;
}
optional ServerInfo_PlayerProperties player_properties = 1;
}

View file

@ -0,0 +1,9 @@
import "room_event.proto";
import "serverinfo_user.proto";
message Event_JoinRoom {
extend RoomEvent {
optional Event_JoinRoom ext = 1001;
}
optional ServerInfo_User user_info = 1;
}

View file

@ -0,0 +1,7 @@
import "game_event.proto";
message Event_Kicked {
extend GameEvent {
optional Event_Kicked ext = 1004;
}
}

View file

@ -0,0 +1,7 @@
import "game_event.proto";
message Event_Leave {
extend GameEvent {
optional Event_Leave ext = 1001;
}
}

View file

@ -0,0 +1,11 @@
import "room_event.proto";
message Event_LeaveRoom {
extend RoomEvent {
optional Event_LeaveRoom ext = 1000;
}
optional string name = 1;
}

View file

@ -0,0 +1,9 @@
import "room_event.proto";
import "serverinfo_game.proto";
message Event_ListGames {
extend RoomEvent {
optional Event_ListGames ext = 1003;
}
repeated ServerInfo_Game game_list = 1;
}

View file

@ -0,0 +1,9 @@
import "session_event.proto";
import "serverinfo_room.proto";
message Event_ListRooms {
extend SessionEvent {
optional Event_ListRooms ext = 1004;
}
repeated ServerInfo_Room room_list = 1;
}

View file

@ -0,0 +1,17 @@
import "game_event.proto";
message Event_MoveCard {
extend GameEvent {
optional Event_MoveCard ext = 2009;
}
optional sint32 card_id = 1;
optional string card_name = 2;
optional string start_zone = 3;
optional sint32 position = 4;
optional sint32 target_player_id = 5;
optional string target_zone = 6;
optional sint32 x = 7;
optional sint32 y = 8;
optional sint32 new_card_id = 9;
optional bool face_down = 10;
}

View file

@ -0,0 +1,10 @@
import "game_event.proto";
import "serverinfo_playerping.proto";
message Event_Ping {
extend GameEvent {
optional Event_Ping ext = 1008;
}
optional uint32 seconds_elapsed = 1;
repeated ServerInfo_PlayerPing ping_list = 2;
}

View file

@ -0,0 +1,9 @@
import "game_event.proto";
import "serverinfo_playerproperties.proto";
message Event_PlayerPropertiesChanged {
extend GameEvent {
optional Event_PlayerPropertiesChanged ext = 1007;
}
optional ServerInfo_PlayerProperties player_properties = 1;
}

View file

@ -0,0 +1,9 @@
import "session_event.proto";
message Event_RemoveFromList {
extend SessionEvent {
optional Event_RemoveFromList ext = 1006;
}
optional string list_name = 1;
optional string user_name = 2;
}

View file

@ -0,0 +1,12 @@
import "game_event.proto";
import "serverinfo_card.proto";
message Event_RevealCards {
extend GameEvent {
optional Event_RevealCards ext = 2006;
}
optional string zone_name = 1;
optional sint32 card_id = 2;
optional sint32 other_player_id = 3;
repeated ServerInfo_Card cards = 4;
}

View file

@ -0,0 +1,9 @@
import "game_event.proto";
message Event_RollDie {
extend GameEvent {
optional Event_RollDie ext = 2008;
}
optional uint32 sides = 1;
optional uint32 value = 2;
}

View file

@ -0,0 +1,9 @@
import "room_event.proto";
message Event_RoomSay {
extend RoomEvent {
optional Event_RoomSay ext = 1002;
}
optional string name = 1;
optional string message = 2;
}

View file

@ -0,0 +1,8 @@
import "session_event.proto";
message Event_ServerMessage {
extend SessionEvent {
optional Event_ServerMessage ext = 1000;
}
optional string message = 1;
}

View file

@ -0,0 +1,9 @@
import "session_event.proto";
message Event_ServerShutdown {
extend SessionEvent {
optional Event_ServerShutdown ext = 1001;
}
optional string reason = 1;
optional uint32 minutes = 2;
}

View file

@ -0,0 +1,8 @@
import "game_event.proto";
message Event_SetActivePhase {
extend GameEvent {
optional Event_SetActivePhase ext = 2017;
}
optional sint32 phase = 1;
}

View file

@ -0,0 +1,8 @@
import "game_event.proto";
message Event_SetActivePlayer {
extend GameEvent {
optional Event_SetActivePlayer ext = 2016;
}
optional sint32 active_player_id = 1;
}

View file

@ -0,0 +1,11 @@
import "game_event.proto";
message Event_SetCardAttr {
extend GameEvent {
optional Event_SetCardAttr ext = 2014;
}
optional string zone_name = 1;
optional sint32 card_id = 2;
optional string attr_name = 3;
optional string attr_value = 4;
}

View file

@ -0,0 +1,11 @@
import "game_event.proto";
message Event_SetCardCounter {
extend GameEvent {
optional Event_SetCardCounter ext = 2015;
}
optional string zone_name = 1;
optional sint32 card_id = 2;
optional sint32 counter_id = 3;
optional sint32 counter_value = 4;
}

View file

@ -0,0 +1,9 @@
import "game_event.proto";
message Event_SetCounter {
extend GameEvent {
optional Event_SetCounter ext = 2003;
}
optional sint32 counter_id = 1;
optional sint32 value = 2;
}

View file

@ -0,0 +1,7 @@
import "game_event.proto";
message Event_Shuffle {
extend GameEvent {
optional Event_Shuffle ext = 2007;
}
}

View file

@ -0,0 +1,9 @@
import "game_event.proto";
message Event_StopDumpZone {
extend GameEvent {
optional Event_StopDumpZone ext = 2019;
}
optional sint32 zone_owner_id = 1;
optional string zone_name = 2;
}

View file

@ -0,0 +1,9 @@
import "session_event.proto";
import "serverinfo_user.proto";
message Event_UserJoined {
extend SessionEvent {
optional Event_UserJoined ext = 1007;
}
optional ServerInfo_User user_info = 1;
}

View file

@ -0,0 +1,8 @@
import "session_event.proto";
message Event_UserLeft {
extend SessionEvent {
optional Event_UserLeft ext = 1008;
}
optional string name = 1;
}

View file

@ -0,0 +1,10 @@
import "session_event.proto";
message Event_UserMessage {
extend SessionEvent {
optional Event_UserMessage ext = 1003;
}
optional string sender_name = 1;
optional string receiver_name = 2;
optional string message = 3;
}

View file

@ -0,0 +1,36 @@
message GameEvent {
enum GameEventType {
JOIN = 1000;
LEAVE = 1001;
GAME_CLOSED = 1002;
GAME_HOST_CHANGED = 1003;
KICKED = 1004;
GAME_STATE_CHANGED = 1005;
CONNECTION_STATE_CHANGED = 1006;
PLAYER_PROPERTIES_CHANGED = 1007;
PING = 1008;
GAME_SAY = 1009;
CREATE_ARROWS = 2000;
DELETE_ARROW = 2001;
CREATE_COUNTERS = 2002;
SET_COUNTER = 2003;
DEL_COUNTER = 2004;
DRAW_CARDS = 2005;
REVEAL_CARDS = 2006;
SHUFFLE = 2007;
ROLL_DIE = 2008;
MOVE_CARD = 2009;
FLIP_CARD = 2010;
DESTROY_CARD = 2011;
ATTACH_CARD = 2012;
CREATE_TOKEN = 2013;
SET_CARD_ATTR = 2014;
SET_CARD_COUNTER = 2015;
SET_ACTIVE_PLAYER = 2016;
SET_ACTIVE_PHASE = 2017;
DUMP_ZONE = 2018;
STOP_DUMP_ZONE = 2019;
}
optional sint32 player_id = 1;
extensions 100 to max;
}

View file

@ -0,0 +1,8 @@
import "game_event.proto";
import "game_event_context.proto";
message GameEventContainer {
optional uint32 game_id = 1;
repeated GameEvent event_list = 2;
optional GameEventContext context = 3;
}

View file

@ -0,0 +1,11 @@
message GameEventContext {
enum ContextType {
READY_START = 1000;
CONCEDE = 1001;
DECK_SELECT = 1002;
UNDO_DRAW = 1003;
MOVE_CARD = 1004;
MULLIGAN = 1005;
}
extensions 100 to max;
}

View file

@ -0,0 +1,38 @@
message Response {
enum ResponseCode {
RespNothing = 0;
RespOk = 1;
RespNotInRoom = 2;
RespInternalError = 3;
RespInvalidCommand = 4;
RespInvalidData = 5;
RespNameNotFound = 6;
RespLoginNeeded = 7;
RespFunctionNotAllowed = 8;
RespGameNotStarted = 9;
RespGameFull = 10;
RespContextError = 11;
RespWrongPassword = 12;
RespSpectatorsNotAllowed = 13;
RespOnlyBuddies = 14;
RespUserLevelTooLow = 15;
RespInIgnoreList = 16;
RespWouldOverwriteOldSession = 17;
RespChatFlood = 18;
}
enum ResponseType {
JOIN_ROOM = 1000;
LIST_USERS = 1001;
GET_GAMES_OF_USER = 1002;
GET_USER_INFO = 1003;
DUMP_ZONE = 1004;
LOGIN = 1005;
DECK_LIST = 1006;
DECK_DOWNLOAD = 1007;
DECK_UPLOAD = 1008;
}
required uint64 cmd_id = 1;
optional ResponseCode response_code = 2;
extensions 100 to max;
}

View file

@ -0,0 +1,9 @@
import "response.proto";
import "serverinfo_zone.proto";
message Response_DumpZone {
extend Response {
optional Response_DumpZone ext = 1004;
}
optional ServerInfo_Zone zone_info = 1;
}

View file

@ -0,0 +1,12 @@
import "response.proto";
import "serverinfo_game.proto";
import "serverinfo_room.proto";
message Response_GetGamesOfUser {
extend Response {
optional Response_GetGamesOfUser ext = 1002;
}
repeated ServerInfo_Room room_list = 1;
repeated ServerInfo_Game game_list = 2;
}

View file

@ -0,0 +1,11 @@
import "response.proto";
import "serverinfo_user.proto";
message Response_GetUserInfo {
extend Response {
optional Response_GetUserInfo ext = 1003;
}
optional ServerInfo_User user_info = 1;
}

View file

@ -0,0 +1,9 @@
import "response.proto";
import "serverinfo_room.proto";
message Response_JoinRoom {
extend Response {
optional Response_JoinRoom ext = 1000;
}
optional ServerInfo_Room room_info = 1;
}

View file

@ -0,0 +1,10 @@
import "response.proto";
import "serverinfo_user.proto";
message Response_ListUsers {
extend Response {
optional Response_ListUsers ext = 1001;
}
repeated ServerInfo_User user_list = 1;
}

View file

@ -0,0 +1,11 @@
import "response.proto";
import "serverinfo_user.proto";
message Response_Login {
extend Response {
optional Response_Login ext = 1005;
}
optional ServerInfo_User user_info = 1;
repeated ServerInfo_User buddy_list = 2;
repeated ServerInfo_User ignore_list = 3;
}

View file

@ -0,0 +1,10 @@
message RoomEvent {
enum RoomEventType {
LEAVE_ROOM = 1000;
JOIN_ROOM = 1001;
ROOM_SAY = 1002;
LIST_GAMES = 1003;
}
optional sint32 room_id = 1;
extensions 100 to max;
}

View file

@ -0,0 +1,17 @@
import "response.proto";
import "session_event.proto";
import "game_event_container.proto";
import "room_event.proto";
message ServerMessage {
enum MessageType {
RESPONSE = 0;
SESSION_EVENT = 1;
GAME_EVENT_CONTAINER = 2;
ROOM_EVENT = 3;
}
optional Response response = 1;
optional SessionEvent session_event = 2;
optional GameEventContainer game_event_container = 3;
optional RoomEvent room_event = 4;
}

View file

@ -0,0 +1,12 @@
import "color.proto";
message ServerInfo_Arrow {
optional sint32 id = 1;
optional sint32 start_player_id = 2;
optional string start_zone = 3;
optional sint32 start_card_id = 4;
optional sint32 target_player_id = 5;
optional string target_zone = 6;
optional sint32 target_card_id = 7;
optional color arrow_color = 8;
}

View file

@ -0,0 +1,20 @@
import "serverinfo_cardcounter.proto";
message ServerInfo_Card {
optional sint32 id = 1;
optional string name = 2;
optional sint32 x = 3;
optional sint32 y = 4;
optional bool face_down = 5;
optional bool tapped = 6;
optional bool attacking = 7;
optional string color = 8;
optional string pt = 9;
optional string annotation = 10;
optional bool destroy_on_zone_change = 11;
optional bool doesnt_untap = 12;
repeated ServerInfo_CardCounter counter_list = 13;
optional sint32 attach_player_id = 14;
optional string attach_zone = 15;
optional sint32 attach_card_id = 16;
}

View file

@ -0,0 +1,4 @@
message ServerInfo_CardCounter {
optional sint32 id = 1;
optional sint32 value = 2;
}

View file

@ -0,0 +1,9 @@
import "color.proto";
message ServerInfo_Counter {
optional sint32 id = 1;
optional string name = 2;
optional color counter_color = 3;
optional sint32 radius = 4;
optional sint32 count = 5;
}

View file

@ -0,0 +1,18 @@
import "serverinfo_user.proto";
message ServerInfo_Game {
optional sint32 room_id = 1;
optional sint32 game_id = 2;
optional string description = 3;
optional bool with_password = 4;
optional uint32 player_count = 5;
optional uint32 max_players = 6;
optional bool started = 7;
repeated sint32 game_types = 8;
optional ServerInfo_User creator_info = 9;
optional bool only_buddies = 10;
optional bool only_registered = 11;
optional bool spectators_allowed = 12;
optional bool spectators_need_password = 13;
optional uint32 spectators_count = 14;
}

View file

@ -0,0 +1,5 @@
message ServerInfo_GameType {
optional sint32 game_type_id = 1;
optional string description = 2;
};

View file

@ -0,0 +1,12 @@
import "serverinfo_zone.proto";
import "serverinfo_counter.proto";
import "serverinfo_arrow.proto";
import "serverinfo_playerproperties.proto";
message ServerInfo_Player {
optional ServerInfo_PlayerProperties properties = 1;
optional string deck_list = 2;
repeated ServerInfo_Zone zone_list = 3;
repeated ServerInfo_Counter counter_list = 4;
repeated ServerInfo_Arrow arrow_list = 5;
}

View file

@ -0,0 +1,4 @@
message ServerInfo_PlayerPing {
optional sint32 player_id = 1;
optional sint32 ping_time = 2;
}

View file

@ -0,0 +1,10 @@
import "serverinfo_user.proto";
message ServerInfo_PlayerProperties {
optional sint32 player_id = 1;
optional ServerInfo_User user_info = 2;
optional bool spectator = 3;
optional bool conceded = 4;
optional bool ready_start = 5;
optional string deck_hash = 6;
}

View file

@ -0,0 +1,15 @@
import "serverinfo_game.proto";
import "serverinfo_user.proto";
import "serverinfo_gametype.proto";
message ServerInfo_Room {
optional sint32 room_id = 1;
optional string name = 2;
optional string description = 3;
optional uint32 game_count = 4;
optional uint32 player_count = 5;
optional bool auto_join = 6;
repeated ServerInfo_Game game_list = 7;
repeated ServerInfo_User user_list = 8;
repeated ServerInfo_GameType gametype_list = 9;
}

View file

@ -0,0 +1,21 @@
message ServerInfo_User {
enum UserLevelFlags {
IsNothing = 0;
IsUser = 1;
IsRegistered = 2;
IsModerator = 4;
IsAdmin = 8;
};
enum Gender {
GenderUnknown = -1;
Male = 0;
Female = 1;
};
optional string name = 1;
optional uint32 user_level = 2;
optional string address = 3;
optional string real_name = 4;
optional Gender gender = 5;
optional string country = 6;
optional bytes avatar_bmp = 7;
}

View file

@ -0,0 +1,14 @@
import "serverinfo_card.proto";
message ServerInfo_Zone {
enum ZoneType {
PrivateZone = 0;
PublicZone = 1;
HiddenZone = 2;
}
optional string name = 1;
optional ZoneType type = 2;
optional bool with_coords = 3;
optional sint32 card_count = 4;
repeated ServerInfo_Card card_list = 5;
}

View file

@ -0,0 +1,15 @@
message SessionEvent {
enum SessionEventType {
SERVER_MESSAGE = 1000;
SERVER_SHUTDOWN = 1001;
CONNECTION_CLOSED = 1002;
USER_MESSAGE = 1003;
LIST_ROOMS = 1004;
ADD_TO_LIST = 1005;
REMOVE_FROM_LIST = 1006;
USER_JOINED = 1007;
USER_LEFT = 1008;
GAME_JOINED = 1009;
}
extensions 100 to max;
}