123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- package msg
- import "leafstalk/covenant/model"
- // 随机匹配 c->s
- type RandMatch struct {
- PlayerId int64 `json:"userId"`
- LevelId int64 `json:"levelId"`
- Level int64 `json:"level"`
- }
- type ResponseRandMatch struct {
- ErrCode int `json:"errCode"`
- Msg string `json:"msg,omitempty"`
- Data int64 `json:"data"` //0:成功 1:已匹配
- PlayerId int64 `json:"userId,omitempty"`
- }
- // 心跳检测 c->s
- type MatchHeartBeat struct {
- PlayerId int64 `json:"userId"`
- }
- type ResponseMatchHeartBeat struct {
- ErrCode int `json:"errCode"`
- Msg string `json:"msg,omitempty"`
- Data int64 `json:"data"` //0:正在匹配 1:非匹配状态
- }
- // 取消匹配 c->s
- type CancleMatch struct {
- PlayerId int64 `json:"userId"`
- }
- type ResponseCancleMatch struct {
- ErrCode int `json:"errCode"`
- Msg string `json:"msg,omitempty"`
- Data int64 `json:"data"`
- PlayerId int64 `json:"userId,omitempty"`
- }
- // 匹配确认与状态检查 s->s
- // 体力是否够, 是否正在匹配 是否已解锁
- type MatchSure struct {
- PublishMsg
- // RpcRequestMsg
- PlayerId int64 `json:"userId"`
- LevelId int64 `json:"levelId"`
- }
- // 返回战斗装备
- type ResponseMatchSure struct {
- RpcResponseMsg
- PlayerId int64 `json:"userId"`
- Data *model.EnterChapterDataItem `json:"data"`
- // ErrCode int64 `json:"errCode"` //0:正在匹配 2:取消匹配 3:在战斗中
- }
- // 匹配失败通知
- type MatchFailNotify struct {
- PublishMsg
- PlayerId int64 `json:"userId"`
- LevelId int64 `json:"levelId"`
- Step int64 `json:"step"`
- Reason int64 `json:"reason"`
- }
- // 删除房间
- type GameSyncDelRoom struct {
- PlayerId int64 `json:"userId"`
- SyncRoomId int64 `json:"syncRoomId,string"`
- }
- type ResponseGameSyncDelRoom struct {
- ErrCode int `json:"errCode"`
- Msg string `json:"msg,omitempty"`
- Data int64 `json:"data"`
- }
- type GameSyncDelRoomIs struct {
- PlayerId int64 `json:"userId"`
- SyncRoomId int64 `json:"syncRoomId,string"`
- }
- // 匹配状态查询 s->c
- type QueryMatchStatus struct {
- ErrCode int `json:"errCode"`
- Msg string `json:"msg,omitempty"`
- Data int64 `json:"data"`
- }
- // c ->s
- type ResponseQueryMatchStatus struct {
- PlayerId int64 `json:"userId"`
- MatchState int64 `json:"matchState"`
- }
- type QueryMatchStatusResult struct {
- PlayerId int64 `json:"userId"`
- Status int64 `json:"status"` //1:正在匹配 2:取消匹配 3:在战斗中
- }
- // 通知服务器扣除体力 s->s
- type MatchSucess struct {
- PublishMsg
- // RpcRequestMsg
- PlayerId int64 `json:"userId"`
- LevelId int64 `json:"levelId"`
- }
- // 返回房间id
- type ResponseMatchSucess struct {
- RpcResponseMsg
- PlayerId int64 `json:"userId"`
- // ErrCode int64 `json:"errCode"` //0:成功 1:失败
- }
- // 告诉同步服务器创建房间
- type CreateRoom struct {
- RpcRequest
- PlayerIds []int64 `json:"userIds"`
- }
- type ResponseCreateRoom struct {
- RpcResponse
- }
- // 告诉客户端进入房间
- // 附带双方装备 s->s->c
- type EnterRoomIs struct {
- PublishMsg
- PlayerId int64 `json:"userId"`
- Data *model.EnterRoomData `json:"data"`
- }
- type EnterRoom struct {
- ErrCode int `json:"errCode"`
- Msg string `json:"msg,omitempty"`
- Data *model.EnterRoomData `json:"data"`
- }
- // type EnterRoomData struct {
- // SyncRoomId int64 `json:"syncRoomId,string"`
- // Seed int64 `json:"seed"`
- // LevelId int64 `json:"chapterId"`
- // Players []*model.EnterChapterDataItem `json:"players"`
- // GameSyncAddr string `json:"gameSyncAddr"`
- // }
- // 玩家状态上报
- type ReportStatus struct {
- }
- type PublishMsger interface {
- SetPublisher(string)
- }
- type PublishMsg struct {
- Publisher string `json:"publisher"`
- }
- func (pm *PublishMsg) SetPublisher(publisher string) {
- pm.Publisher = publisher
- }
- // 创建邀请代码 c->s
- type CreateCoopTeam struct {
- PlayerId int64 `json:"userId"`
- LevelId int64 `json:"levelId"`
- Level int64 `json:"level"`
- }
- type ResponseCreateCoopTeam struct {
- ErrCode int `json:"errCode"`
- Msg string `json:"msg,omitempty"`
- Data string `json:"data"` // 邀请码
- PlayerId int64 `json:"userId,omitempty"`
- }
- // 加入队伍
- type JoinCoopTeam struct {
- PlayerId int64 `json:"userId"`
- InviteCode string `json:"inviteCode"`
- }
- type ResponseJoinCoopTeam struct {
- ErrCode int `json:"errCode"` //1:状态错误 2:队伍已开始或已解散
- Msg string `json:"msg,omitempty"`
- Data string `json:"data"` // 邀请码
- PlayerId int64 `json:"userId,omitempty"` //客户端不用
- }
- // 玩家退出
- type PlayerExit struct {
- PlayerIds []int64 `json:"userIds"`
- }
- // 查询队伍是否存在
- // type QueryCoopTeamExist struct {
- // PlayerId int64 `json:"userId"`
- // InviteCodes []string `json:"inviteCodes"`
- // }
- // type ResponseQueryCoopTeamExist struct {
- // ErrCode int `json:"errCode"`
- // Msg string `json:"msg,omitempty"`
- // Data QueryCoopTeamExistData `json:"data"` // 邀请码
- // PlayerId int64 `json:"userId,omitempty"` //客户端不用
- // }
- // type QueryCoopTeamExistData struct {
- // Founds []string `json:"founds"` // 存在
- // NoFounds []string `json:"noFounds"` // 不存在
- // }
- // // 请求加入队伍
- // type RequestJoinTeamIs struct {
- // PublishMsg
- // PlayerId int64 `json:"userId"`
- // InviteCode string `json:"inviteCode"`
- // }
- // // 返回房间id
- // type ResponseRequestJoinTeamIs struct {
- // PlayerId int64 `json:"userId"`
- // ErrCode int64 `json:"errCode"` //0:成功 1:失败
- // }
|