|
@@ -0,0 +1,432 @@
|
|
|
+syntax = "proto3";
|
|
|
+
|
|
|
+package common_pack;
|
|
|
+
|
|
|
+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就一直存在,
|
|
|
+ int32 online_status = 6;//在线=1 离线等0
|
|
|
+
|
|
|
+}
|
|
|
+//登录 请求
|
|
|
+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 HistoryRecord{
|
|
|
+ int32 id = 1;
|
|
|
+ int32 room_id = 2;
|
|
|
+ string user_id = 3;
|
|
|
+ string time = 4;
|
|
|
+}
|
|
|
+
|
|
|
+message ReqLudoHistory{
|
|
|
+ string user_id = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message ResLudoHistory{
|
|
|
+ bool success = 1;
|
|
|
+ MsgError err_msg = 2;
|
|
|
+ repeated HistoryRecord list = 3;
|
|
|
+}
|
|
|
+
|
|
|
+message ReqLudoRoomInfo{
|
|
|
+ int64 room_id = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message ResLudoRoomInfo{
|
|
|
+ bool success = 1;
|
|
|
+ MsgError err_msg = 2;
|
|
|
+ RoomInfo info = 3;
|
|
|
+}
|
|
|
+
|
|
|
+message BuyShopItem{
|
|
|
+ string id = 1;
|
|
|
+}
|
|
|
+
|
|
|
+//好友请求的结构
|
|
|
+message RequestAddFriendItem{
|
|
|
+ int32 id = 1;
|
|
|
+ string RequestID = 2; //请求id
|
|
|
+ string FromUserID = 3;
|
|
|
+ string ToUserID = 4;
|
|
|
+ int32 Status = 5; //状态
|
|
|
+ string Message = 6;
|
|
|
+}
|
|
|
+
|
|
|
+//请求好友列表
|
|
|
+message ReqFriendList{
|
|
|
+ string user_id = 1;
|
|
|
+}
|
|
|
+
|
|
|
+//响应好友列表请求,暂时没做分页
|
|
|
+message ResFriendList{
|
|
|
+ bool success = 1;
|
|
|
+ MsgError err_msg = 2;
|
|
|
+ repeated UserInfo list = 3;
|
|
|
+}
|
|
|
+
|
|
|
+//请求好友申请单个数据
|
|
|
+message FriendRequestItem{
|
|
|
+ UserInfo info = 1;
|
|
|
+ string request_msg = 2;
|
|
|
+ string create_time = 3;
|
|
|
+ int32 status = 4;
|
|
|
+}
|
|
|
+
|
|
|
+//请求好友申请列表
|
|
|
+message ReqFriendRequestList{
|
|
|
+ string user_id = 1;
|
|
|
+}
|
|
|
+
|
|
|
+//响应好友申请列表请求,暂时没做分页
|
|
|
+message ResFriendRequestList{
|
|
|
+ bool success = 1;
|
|
|
+ MsgError err_msg = 2;
|
|
|
+ repeated FriendRequestItem list = 3;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//请求添加好友
|
|
|
+message ReqAddFriend{
|
|
|
+ string ToUserID = 1;
|
|
|
+ string msg = 2;
|
|
|
+}
|
|
|
+
|
|
|
+//客户端接收到请求消息
|
|
|
+message RecvAddFriendRequest{
|
|
|
+ UserInfo info = 1;
|
|
|
+}
|
|
|
+
|
|
|
+//接收到的玩家对消息进行操作
|
|
|
+message OptAddFriendRequest{
|
|
|
+ RequestAddFriendItem info = 1;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//通知请求的玩家,对方的操作结果
|
|
|
+message NotifyOptFriend{
|
|
|
+ RequestAddFriendItem info = 1;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//根据玩家id搜索玩家
|
|
|
+message SearchUser{
|
|
|
+ string user_id = 1;
|
|
|
+}
|
|
|
+
|
|
|
+//响应搜索结果
|
|
|
+message ResSearchUser{
|
|
|
+ bool success = 1;
|
|
|
+ MsgError err_msg = 2;
|
|
|
+ UserInfo info = 3;
|
|
|
+}
|
|
|
+
|
|
|
+//删除好友
|
|
|
+message ReqDeleteFriend{
|
|
|
+ string ToUserID = 1;
|
|
|
+}
|
|
|
+
|
|
|
+//删除好友响应
|
|
|
+message ResDeleteFriend{
|
|
|
+ bool success = 1;
|
|
|
+ MsgError err_msg = 2;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+//好友上线/下线响应
|
|
|
+message ResFriendOnLineStatus{
|
|
|
+ bool success = 1;
|
|
|
+ MsgError err_msg = 2;
|
|
|
+ UserInfo info = 3;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//聊天消息
|
|
|
+message ChatMessage{
|
|
|
+ int32 id = 1;
|
|
|
+ string session_id = 2;
|
|
|
+ string sender_id = 3;
|
|
|
+ string content = 4;
|
|
|
+ string created_at = 5;
|
|
|
+ string content_type = 6;
|
|
|
+}
|
|
|
+
|
|
|
+//发送聊天内容
|
|
|
+message ReqSendChatMsg{
|
|
|
+ string content_type = 1; //消息类型
|
|
|
+ string to_userid = 2; //发送给谁
|
|
|
+ string content = 3; //消息内容
|
|
|
+}
|
|
|
+
|
|
|
+message ResSendChatMsg{
|
|
|
+ bool success = 1;
|
|
|
+ MsgError err_msg = 2;
|
|
|
+}
|
|
|
+//接收聊天内容
|
|
|
+message RecvChatMsg{
|
|
|
+ ChatMessage info = 1;
|
|
|
+}
|
|
|
+//请求获取聊天历史
|
|
|
+message ReqChatHistory{
|
|
|
+ string to_userid = 1;
|
|
|
+ int32 last_msgid = 2;
|
|
|
+}
|
|
|
+//响应获取聊天历史
|
|
|
+message ResChatHistory{
|
|
|
+ bool success = 1;
|
|
|
+ MsgError err_msg = 2;
|
|
|
+ repeated ChatMessage list = 3;
|
|
|
+}
|
|
|
+
|