package msg import ( "encoding/json" ) // Entry 登录 type GameSyncEntry struct { PlayerId int64 `json:"userId"` Token string `json:"token"` LineId int `json:"serverId"` SyncRoomId int64 `json:"syncRoomId,string"` ReLogin int32 `json:"reLogin"` // 重连1 } type ResponseGameSyncEntry struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data int `json:"data"` } type GameSyncHeartBeat struct { PlayerId int64 `json:"userId"` } type ResponseGameSyncHeartBeat struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data int64 `json:"data"` } // Entry 重连 type GameSyncReLogin struct { PlayerId int64 `json:"userId"` } // Entry 重连 type GameSynToken struct { PlayerId int64 `json:"userId"` } type GameJoinerAttr struct { PlayerId int64 `json:"userId"` } // 创建帧同步房间 type CreateGameFrameSyncGroupIs struct { RpcRequestMsg SyncRoomId int64 `json:"SyncRoomId,string"` Token string `json:"token"` Joiners []*JoinerAttr `json:"joiners"` } type ResponseCreateGameSyncRoomIs struct { RpcResponseMsg } type GameFrameSyncToServer struct { PlayerId int64 `json:"userId"` SyncRoomId int64 `json:"syncRoomId,string"` RawData []json.RawMessage `json:"raw,omitempty"` // 客户端某一个行为的数据 // FrameId int64 `json:"frameId"` } // 客户端上报章节同步已准备好 type GameSyncReady struct { PlayerId int64 `json:"userId"` SyncRoomId int64 `json:"syncRoomId,string"` } type ResponseGameSyncReady struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data int `json:"data,string"` } type GameSyncCache struct { PlayerId int64 `json:"userId"` SyncRoomId int64 `json:"syncRoomId,string"` SyncCacheId int64 `json:"syncCacheId"` // 缓存快照id SyncCache json.RawMessage `json:"syncCache,omitempty"` // 缓存快照 } type ResponseGameSyncCache struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data int `json:"data,string"` } // 服务端通知开始章节同步 type GameSyncStart struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data int64 `json:"data,string"` //syncroomid } type GameSyncSettle struct { PlayerId int64 `json:"userId"` SyncRoomId int64 `json:"syncRoomId,string"` Id int64 `json:"id"` Wave int64 `json:"wave"` Rewards int64 `json:"rewards"` // 多倍奖励原因 0:无多倍奖励;1:广告 Score int64 `json:"score"` // 积分 Data json.RawMessage `json:"log,omitempty"` } type GameSyncSettleIs struct { PublishMsg PlayerId int64 `json:"userId"` SyncRoomId int64 `json:"syncRoomId,string"` Id int64 `json:"id"` Wave int64 `json:"wave"` Rewards int64 `json:"rewards"` // 多倍奖励原因 0:无多倍奖励;1:广告 FriendId int64 `json:"friendId"` // 好友id 以下服务端填充用 Score int64 `json:"score"` // 积分 Data json.RawMessage `json:"log,omitempty"` // 战斗日志 } type GameSyncDisconnectRoomIs struct { PublishMsg PlayerId int64 `json:"userId"` } // 房间结算 type ResponseGameSyncSettle struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data int64 `json:"data"` //syncroomid } type GameFrameSyncInfo struct { PlayerId int64 `json:"userId"` SyncRoomId int64 `json:"syncRoomId,string"` FrameId int64 `json:"frameId"` // 起始帧号 } type GameFrameSyncInfoData struct { FrameId int64 `json:"maxFrameId"` // 当前最大帧号 Data map[int64][]json.RawMessage `json:"raw,omitempty"` // 帧数据 SyncCacheId int64 `json:"syncCacheId"` // 缓存快照id SyncCache json.RawMessage `json:"syncCache,omitempty"` // 缓存快照 } type ResponseGameFrameSyncInfo struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *GameFrameSyncInfoData `json:"data"` } // 数据到服务器 type GameSyncToServer struct { PlayerId int64 `json:"userId"` SyncRoomId int64 `json:"syncRoomId,string"` RawData json.RawMessage `json:"raw,omitempty"` } // 数据到客户端 type GameSyncToClient struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data GameSyncToClientData `json:"data"` } type GameSyncToClientData struct { FrameId int64 `json:"id"` SyncCacheFlag bool `json:"syncCacheFlag"` // true 代表当前帧号为同步缓存帧号 Datas []json.RawMessage `json:"raws"` } type GameSyncChat struct { PlayerId int64 `json:"userId"` SyncRoomId int64 `json:"syncRoomId,string"` // Chat json.RawMessage `json:"chat,omitempty"` // 聊天内容 Chat *GameSyncChatData `json:"sendChatInfo"` //新聊天信息 } type GameSyncChatData struct { SenderId int64 `json:"senderId"` MsgType string `json:"msgType"` // text:文本 emoji:表情 Content string `json:"content"` // 聊天内容 } type ResponseGameSyncChat struct { ErrCode int `json:"errCode"` Msg string `json:"msg,omitempty"` Data *GameSyncChatData `json:"data"` //新聊天信息 }