123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- syntax = "proto3";
- option go_package = "./msg";
- enum roleType {
- ROLE_TYPE_UNKNOWN = 0;
- RED = 1; // 无操作
- BLUE = 4;
- YELLOW = 3;
- GREEN = 2;
- }
- enum OptType {
- OPT_TYPE_UNKNOWN = 0;
- ZHI_SHAI_ZI = 1;
- SELECT_ROLE = 2;
- }
- enum roomType {
- ROOM_TYPE_UNKNOWN = 0;
- SHUANG_REN = 1;
- SIREN_REN = 2;
- }
- enum roomMode {
- ROOM_MODE_UNKNOWN = 0;
- REN_JI = 1;
- WAN_JIA = 2;
- }
- enum roadType {
- ROAD_TYPE_UNKNOWN = 0;
- HOME =1;
- }
- enum playerStatus {
- PLAYER_STATUS_UNKNOWN = 0;
- SZ_ANIMATION =1;
- COLOR_FINISH = 2;
- COLOR_KICK = 3;
- COLOR_TIME_OUT = 4;
- }
- enum roomStatus {
- AWAIT = 0;
- START = 1;
- END = 2;
- }
- message round {
- roleType m_color = 1;
- string m_road = 2;
- OptType opt = 3;
- int32 szNumber = 4;
- }
- message RoomInfo {
- repeated RoleData roles = 1;
- repeated ColorData colors = 2;
- roomType room_type = 3;
- roomMode room_mode = 4;
- roleType cur_round_color = 5; //当前那个阵营的回合
- repeated round rounds = 6;
- repeated ColorData finish_colors = 7;
- repeated ColorData kict_colors = 8;
- int32 id = 9;
- int32 room_level = 10; //房间的每个等级都对应着不同的奖励和消耗
- roomStatus room_status = 11;
- NotifyPlayerOpt cur_color_opt_data = 12; //当前阵营操作的类型
- int32 opt_time = 13; //玩家当前剩余操作时间
- }
- message RoleData {
- roleType m_color = 1;
- int32 m_seat = 2;
- string m_id = 3;
- roadType m_cur_road = 4;
- int32 step = 5;
- int32 old_setp = 6;
- }
- message ColorData {
- string m_id = 1;
- roleType m_color = 2;
- bool is_kick = 3;
- bool is_finish = 4;
- int32 time_out_num = 5;
- string m_name = 6;
- string m_head = 7;
- int32 rank_num = 8;
- int32 m_coin = 9;
- int32 m_reward_coin = 10;
- }
- message MoveStepData {
- string m_id = 1;
- int32 step = 2;
- int32 old_setp = 3;
- }
- message SendColorSz {
- roleType color = 1; //
- }
- message SendRoleMove {
- roleType color = 1; //
- string roleId = 2;
- }
- message SendQuitRoom {
- roleType color = 1; //
- }
- message NotifyPlayerSzNumber {
- roleType color = 1; //
- int32 szNumber = 2; //
- MsgError err_msg = 3;
- }
- message NotifyPlayerMove {
- roleType color = 1; //
- MoveStepData step = 2; //
- repeated RoleData kick = 3;
- }
- message NotifyPlayerOpt {
- roleType color = 1; //
- OptType opt = 2; //
- repeated RoleData canMoveRoles = 3;
- int32 opt_time = 4;
- }
- message NotifyPlayerStatus {
- roleType color = 1; //
- playerStatus status = 2;
- repeated ColorData colors = 3;
- ColorData time_out_color = 4;
- }
- message NotifySettlement {
- roleType color = 1; //
- repeated ColorData finish_colors = 2;
- }
- message NotifyUpdateRoomInfo {
- RoomInfo room_info = 1; //
- }
- //----------------------------------
- //用户信息
- message UserInfo {
- string UserId = 1;
- string m_head = 2;
- int32 m_coin = 3;
- string name = 4;
- int32 room_id = 5; //如果用户在某一个房间玩,他的id就一直存在,
-
- }
- //登录 请求
- message ReqLogin {
- string account = 1;
- string password = 2;
- }
- //登录 响应
- message ResLogin {
- string userId = 1;
- string nikeName = 2;
- UserInfo userInfo = 3;
- MsgError err_msg = 4;
- }
- //注册 请求
- message ReqRegister {
- string nikeName = 1;
- string account = 2;
- string password = 3;
- string m_head = 4;
- }
- //注册 响应
- message ResRegister {
- bool success = 1;
- MsgError err_msg = 2;
- }
- //进入大厅
- message EnterHall {
- string userId = 1;
- }
- //进入大厅响应
- message ResEnterHall {
- bool success = 1;
- MsgError err_msg = 2;
- RoomInfo reconnect_room_info = 3;
- }
- //离开大厅
- message LeaveHall {
- string userId = 1;
- }
- //匹配ludo
- message MatchLudo {
- roomType select_room_type = 1;
- int32 room_level = 2;
- roleType select_color = 3;
- }
- //匹配ludo 响应
- message ResMatchLudo {
- bool success = 1;
- MsgError err_msg = 2;
- RoomInfo room = 3;
- }
- //error
- message MsgError {
- int32 error_code = 1;
- string error_msg = 2;
- }
- // 更新用户信息
- message UpdateUserInfo {
- UserInfo info = 1;
- }
- message ResHeartBeat {
- string msg = 1;
- }
- message ReqHeartBeat {
- string msg = 1;
- }
- message ShopItem{
- string name = 1;
- string id = 2;
- int32 price = 3;
- int32 num = 4;
- }
- //被踢登陆
- message BeKickLogin {
- MsgError err_msg = 1;
- }
- // 请求商城
- message ReqShop {
- int32 shopType = 1;
- }
- // 响应商城
- message ResShop {
- bool success = 1;
- MsgError err_msg = 2;
- repeated ShopItem list = 3;
- }
- message BuyShopItem{
- string id = 1;
- }
|