Documentation ¶
Index ¶
- Constants
- Variables
- type BroadCast_GameHint
- type BroadCast_GameOver
- type Broadcast_MsgNoticePlayer
- type Broadcast_NoticePlayerEmail
- type Broadcast_PlayerUpGrade
- type C2GL_GameLogin
- type C2GWS_GetPlayerEmailList
- type C2GWS_PlayerChooseGame
- type C2GWS_PlayerChooseGameMode
- type C2GWS_PlayerGameInit
- type C2GWS_PlayerGiveUp
- type C2GWS_PlayerLogin
- type C2GWS_PlayerMoveChess
- type C2GWS_PlayerRelinkGame
- type C2GWS_PlayerStirChess
- type C2GWS_QuitMatch
- type C2GWS_RaceBaoMing
- type C2GWS_ReadOrDelPlayerEmail
- type C2S_GameRaceBaoMing
- type C2S_HallPlayerLogin
- type C2S_PlayerAddGame
- type C2S_PlayerEntryGame
- type C2S_PlayerLogin
- type C2S_PlayerLoginS
- type C2S_PlayerMove
- type C2S_PlayerRun
- type DB_GameOver
- type DSQ2GW_BroadCast_GameOver
- type DSQ2GW_ConnServer
- type DSQ2GW_InitGame
- type DSQ2GW_PlayerMoveChess
- type DSQ2GW_PlayerRelinkGame
- type DSQ2GW_PlayerStirChess
- type DSQ_GameHint
- type G2GW_ConnServer
- type G2GW_GetPlayerEmailList
- type G2GW_PlayerEntryHall
- type G2GW_PlayerMatch
- type G2GW_PlayerMatchGame
- type G2GW_PlayerQuitMatchGame
- type G2GW_ReadOrDelPlayerEmail
- type GGW_Broadcast_GameRaceData
- type GGW_Broadcast_GameRaceStart
- type GGameList
- type GL2C_GameLogin
- type GMS2W_Get_PlayerEmailData
- type GMS2W_Modify_PlayerData
- type GMS2W_Modify_PlayerEmailData
- type GMS2W_Update_PlayerEmailData
- type GW2DSQ_ConnServer
- type GW2DSQ_InitGame
- type GW2DSQ_PlayerGiveUp
- type GW2DSQ_PlayerMoveChess
- type GW2DSQ_PlayerRelinkGame
- type GW2DSQ_PlayerStirChess
- type GW2G_ConnServer
- type GW2G_GetPlayerEmailList
- type GW2G_HeartBeat
- type GW2G_PlayerEntryHall
- type GW2G_PlayerMatch
- type GW2G_PlayerMatchGame
- type GW2G_PlayerQuitMatchGame
- type GW2G_ReadOrDelPlayerEmail
- type G_Broadcast_GameRaceData
- type G_Broadcast_GameRaceResult
- type G_Broadcast_GameRaceStart
- type G_Broadcast_MsgNoticePlayer
- type G_Broadcast_NoticePlayerEmail
- type G_Error_All
- type GateWay_HeartBeat
- type GateWay_Logout
- type GateWay_Relink
- type GateWay_Relink1
- type Net_HeartBeat
- type Net_Kicking_Player
- type Net_Relink
- type PlayerSt
- type S2C_GameRaceBaoMing
- type S2C_HallPlayerLogin
- type S2C_PlayerLogin
- type S2C_PlayerRun
- type S2GWS_GetPlayerEmailList
- type S2GWS_PlayerChooseGame
- type S2GWS_PlayerChooseGameMode
- type S2GWS_PlayerGameInit
- type S2GWS_PlayerLogin
- type S2GWS_PlayerMoveChess
- type S2GWS_PlayerRelinkGame
- type S2GWS_PlayerStirChess
- type S2GWS_QuitMatch
- type S2GWS_RaceBaoMing
- type S2GWS_ReadOrDelPlayerEmail
- type S2S_PlayerEntryGame
- type S2S_PlayerLoginS
- type S2S_PlayerMove
- type W2GMS_Get_PlayerEmailData
- type W2GMS_Modify_PlayerData
- type W2GMS_Modify_PlayerEmailData
- type W2GMS_Update_PlayerEmailData
Constants ¶
const ( Error_PROTO2 = iota G_Error_All_Proto // G_Error_All_Proto == 1 错误 )
Error_Proto 的子协议
const ( INITDSQ = iota // INITDSQ == 0 DSQ2GW_ConnServerProto2 // DSQ2GW_ConnServerProto2 == 1 DSQ主动链接 主动链接 gateway 进行注册 GW2DSQ_ConnServerProto2 // GW2DSQ_ConnServerProto2 == 2 选择链接 GW2DSQ_InitGameProto2 // GW2DSQ_InitGameProto2 == 3 初始化协议-- 相当于注册 DSQ2GW_InitGameProto2 // GW2DSQ_InitGameProto2 == 4 GW2DSQ_PlayerStirChessProto2 // GW2DSQ_PlayerStirChessProto2 == 5 玩家翻棋子 DSQ2GW_PlayerStirChessProto2 // DSQ2GW_PlayerStirChessProto2 == 6 广播同一个桌子上的,且接受到此协议后,已经移动的再无法移动棋子,对手获取操作权限 GW2DSQ_PlayerMoveChessProto2 // GW2DSQ_PlayerMoveChessProto2 == 7 玩家移动棋子 DSQ2GW_PlayerMoveChessProto2 // DSQ2GW_PlayerMoveChessProto2 == 8 GW2DSQ_PlayerGiveUpProto2 // GW2DSQ_PlayerGiveUpProto2 == 9玩家放弃 DSQ2GW_BroadCast_GameOverProto2 // DSQ2GW_BroadCast_GameOverProto2 ==10 结算 DB_GameOverProto2 // DB_GameOverProto2 ==11 DB结算 DSQ_GameHintProto2 // DSQ_GameHintProto2 ==12 斗兽棋通知 GW2DSQ_PlayerRelinkGameProto2 // GW2DSQ_PlayerRelinkGameProto2 == 13 玩家重新链接游戏 DSQ2GW_PlayerRelinkGameProto2 // DSQ2GW_PlayerRelinkGameProto2 == 14 )
G_GameDSQ_Proto == 10 斗兽棋
const ( DSQINIT_QZ = iota // DSQ_QZ == 0 Elephant // elephant == 1 大象 Lion // lion == 2 狮子 Tiger // tiger == 3 老虎 Leopard // leopard == 4 豹子 Wolf // wolf == 5 狼 Dog // dog == 6 狗 Cat // cat == 7 猫 Mouse // mouse == 8 老鼠 )
斗兽棋的棋子类型
const ( FANGXIANGINIT = iota // FANGXIANGINIT == 0 UP // UP == 1 DOWN // DOWN == 2 LEFT // LEFT == 3 RIGHT // RIGHT == 4 )
棋子的行动的方向
const ( ITYPEINIY = iota // ITYPEINIY == 0 MOVE // MOVE == 1 正常移动 DISAPPEAR // DISAPPEAR == 2 自残 ALLDISAPPEAR // ALLDISAPPEAR == 3 同归于尽 BEAT // BEAT == 4 击败对方 TEAMMATE // TEAMMATE == 5 队友 MOVESUCC // MOVESUCC == 6 移动成功 MOVEFAIL // MOVEFAIL == 7 移动失败 DATAERROR // DATAERROR == 8 数据错误 玩家的棋子已经被吃掉不存在了 DATANOEXIT // DATANOEXIT == 9 数据不存在 棋子的数据大于 16或者小于0 )
棋子的攻击方式
const ( GAMEINIT = iota // GAMEINIT == 0 W2GMS_Modify_PlayerDataProto2 // W2GMS_Modify_PlayerDataProto2 == 1 修改玩家的数据 :web请求 GM 系统 GMS2W_Modify_PlayerDataProto2 // GMS2W_Modify_PlayerDataProto2 == 2 /* 邮件 and 跑马灯 */ W2GMS_Modify_PlayerEmailDataProto2 // W2GMS_Modify_PlayerEmailDataProto2 == 3 修改邮件数据 GMS2W_Modify_PlayerEmailDataProto2 // GMS2W_Modify_PlayerEmailDataProto2 == 4 // 获取邮件 W2GMS_Get_PlayerEmailDataProto2 // W2GMS_Modify_PlayerEmailDataProto2 == 5 修改邮件数据 GMS2W_Get_PlayerEmailDataProto2 // GMS2W_Modify_PlayerEmailDataProto2 == 6 // 修改邮件 W2GMS_Update_PlayerEmailDataProto2 // W2GMS_Modify_PlayerEmailDataProto2 == 7 修改邮件数据 GMS2W_Update_PlayerEmailDataProto2 // GMS2W_Modify_PlayerEmailDataProto2 == 8 )
G_GameGM_Proto == 11 子协议
const ( MODIFYINIT = iota // MODIFYINIT == 0 MODIFY_COIN // MODIFY_COIN == 1 修改金币 MODIFY_LEV // MODIFY_LEV == 2 修改等级,大厅的等级 MODIFY_MASONRY // MODIFY_MASONRY == 3 修改砖石 MODIFY_MCARD // MODIFY_MCARD == 4 修改福卡 MODIFY_VIP_LEV // MODIFY_VIP_LEV == 5 修改VIP等级 )
const ( INIT_PROTO2 = iota C2S_PlayerLoginProto2 // C2S_PlayerLoginProto2 == 1 用户登陆协议 S2C_PlayerLoginProto2 // S2C_PlayerLoginProto2 == 2 C2S_ChooseRoomProto2 // C2S_ChooseRoomProto2 == 3 选择房间 S2C_ChooseRoomProto2 // S2C_ChooseRoomProto2 == 4 C2S_PlayerRunProto2 // C2S_PlayerRunProto2 == 5 模拟走路 S2C_PlayerRunProto2 // S2C_PlayerRunProto2 == 6 )
GameData_Proto 的子协议
const ( INIT_HALL = iota C2S_HallPlayerLoginProto2 // C2S_HallPlayerLoginProto2 == 1 用户登陆协议 S2C_HallPlayerLoginProto2 // S2C_HallPlayerLoginProto2 == 2 )
G_GameHall_Proto 的子协议
const ( INIT_GameLogin = iota C2GL_GameLoginProto2 // C2GL_GameLoginProto2 == 1 client -->登录请求 GL2C_GameLoginProto2 // GL2C_GameLoginProto2 == 2 返回数据 )
G_GameLogin_Proto 的子协议 属于HTTP 与 DBserver 进行通信 获取到登录正确的信息后,token 返回给网关server
const ( INIT_NetPROTO2 = iota Net_HeartBeatProto2 // Net_HeartBeatProto2 == 1 心跳协议 Net_Kicking_PlayerProto2 // Net_Kicking_PlayerProto2 == 2 踢人 Net_RelinkProto2 // Net_RelinkProto2 == 3 断线重新链接 )
GameNet_Proto 的子协议
const ( ININGATEWAY = iota // ININGATEWAY == 0 C2GWS_PlayerLoginProto2 // C2GWS_PlayerLoginProto2 == 1 登陆协议 S2GWS_PlayerLoginProto2 // S2GWS_PlayerLoginProto2 == 2 GateWay_HeartBeatProto2 // GateWay_HeartBeatProto2 == 3 心跳协议 GateWay_RelinkProto2 // GateWay_RelinkProto2 == 4 断线重新链接协议 C2GWS_PlayerChooseGameProto2 // C2GWS_PlayerChooseGameProto2 == 5 // 玩家选择游戏 S2GWS_PlayerChooseGameProto2 // S2GWS_PlayerChooseGameProto2 == 6 C2GWS_PlayerChooseGameModeProto2 // C2GWS_PlayerChooseGameModeProto2 == 7 // 玩家选择游戏模式 S2GWS_PlayerChooseGameModeProto2 // S2GWS_PlayerChooseGameModeProto2 == 8 C2GWS_PlayerGameInitProto2 // C2GWS_PlayerGameInitProto2 == 9 // 匹配成功后,客户端下发获取初始化牌型 S2GWS_PlayerGameInitProto2 // S2GWS_PlayerGameInitProto2 == 10 C2GWS_QuitMatchProto2 // C2GWS_QuitMatchProto2 == 11 退出协议 S2GWS_QuitMatchProto2 // S2GWS_QuitMatchProto2 == 12 GateWay_LogoutProto2 // GateWay_LogoutProto2 == 13 玩家登出 /* 斗兽棋 0表示空 1-8 A方,9-16 B方 ,17没有翻 ,18翻了 */ C2GWS_PlayerStirChessProto2 // C2GWS_PlayerStirChessProto2 == 14 玩家翻棋子 S2GWS_PlayerStirChessProto2 // S2GWS_PlayerStirChessProto2 == 15 C2GWS_PlayerMoveChessProto2 // C2GWS_PlayerMoveChessProto2 == 16 玩家移动 S2GWS_PlayerMoveChessProto2 // S2GWS_PlayerMoveChessProto2 == 17 C2GWS_PlayerGiveUpProto2 // C2GWS_PlayerGiveUpProto2 == 18 玩家放弃、认输 BroadCast_GameOverProto2 // BroadCast_GameOverProto2 == 19 广播玩家游戏结束 BroadCast_GameHintProto2 // BroadCast_GameHintProto2 == 20 广播玩家第七个回合没有吃 C2GWS_PlayerRelinkGameProto2 // C2GWS_PlayerRelinkGameProto2 == 21 玩家重新链接游戏 S2GWS_PlayerRelinkGameProto2 // S2GWS_PlayerRelinkGameProto2 == 22 /* 邮件系统 */ C2GWS_GetPlayerEmailListProto2 // C2GWS_GetPlayerEmailListProto2 == 23 获取邮件列表 S2GWS_GetPlayerEmailListProto2 // S2GWS_GetPlayerEmailListProto2 == 24 C2GWS_ReadOrDelPlayerEmailProto2 // C2GWS_ReadOrDelPlayerEmailProto2 == 25 读取或者删除 S2GWS_ReadOrDelPlayerEmailProto2 // S2GWS_ReadOrDelPlayerEmailProto2 == 26 Broadcast_NoticePlayerEmailProto2 // Broadcast_NoticePlayerEmailProto2 == 27 邮件通知 /* 消息系统 */ Broadcast_MsgNoticePlayerProto2 // Broadcast_MsgNoticePlayerProto2 == 28 消息通知 Broadcast_PlayerUpGradeProto2 // Broadcast_PlayerUpGradeProto2 == 29 玩家升级 /* 比赛系统: 报名,报名成功,根据绝体日期进行比赛 */ C2GWS_RaceBaoMingProto2 // C2GWS_RaceBaoMingProto2 == 30 比赛报名 S2GWS_RaceBaoMingProto2 // S2GWS_RaceBaoMingProto2 == 31 GGW_Broadcast_GameRaceStartProto2 // GGW_Broadcast_GameRaceStartProto2 == 32 比赛开始发送比赛的房间信息 GGW_Broadcast_GameRaceDataProto2 // GGW_Broadcast_GameRaceDataProto2 == 33 实时更新 比赛的信息 GGW_Broadcast_GameRaceResultProto2 // GGW_Broadcast_GameRaceResultProto2 == 34 比赛结束 )
G_GateWay_Proto
const ( ININGlobal = iota // 0 G2GW_ConnServerProto2 // G2GW_ConnServerProto2 == 1 Global主动链接 gateway GW2G_ConnServerProto2 // GW2G_ConnServerProto2 == 2 选择链接 GW2G_HeartBeatProto2 // GW2G_HeartBeatProto2 == 3 心跳协议 保活的操作 G2GW_PlayerMatchProto2 // G2GW_PlayerMatchProto2 == 4 玩家发送匹配的协议 GW2G_PlayerMatchProto2 // GW2G_PlayerMatchProto2 == 5 服务器返回数据对应匹配机制 G2GW_PlayerEntryHallProto2 // G2GW_PlayerEntryHallProto2 == 6 玩家进入大厅,显示的数据 GW2G_PlayerEntryHallProto2 // GW2G_PlayerEntryHallProto2 == 7 G2GW_PlayerMatchGameProto2 // G2GW_PlayerMatchGameProto2 == 8 玩家选择游戏匹配 GW2G_PlayerMatchGameProto2 // GW2G_PlayerMatchGameProto2 == 9 GW2G_PlayerQuitMatchGameProto2 // GW2G_PlayerQuitMatchGameProto2 == 10 玩家退出匹配 G2GW_PlayerQuitMatchGameProto2 // G2GW_PlayerQuitMatchGameProto2 == 11 玩家退出匹配 GW2G_GetPlayerEmailListProto2 // GW2G_GetPlayerEmailListProto2 == 12 获取邮件列表 G2GW_GetPlayerEmailListProto2 // G2GW_GetPlayerEmailListProto2 == 13 GW2G_ReadOrDelPlayerEmailProto2 // GW2G_ReadOrDelPlayerEmailProto2 == 14 读取或者删除 G2GW_ReadOrDelPlayerEmailProto2 // G2GW_ReadOrDelPlayerEmailProto2 == 15 G_Broadcast_NoticePlayerEmailProto2 // G_Broadcast_NoticePlayerEmailProto2 ==16 邮件通知 G_Broadcast_MsgNoticePlayerProto2 // Broadcast_MsgNoticePlayerProto2 == 17 消息通知 )
G_GameGlobal_Proto == 9 负责全局的游戏逻辑 的子协议 注:server类型为单点
const ( GameRaceINIT = iota // 协议初始化 C2S_GameRaceBaoMingProto2 // C2S_GameRaceBaoMingProto2 ==1 游戏报名 S2C_GameRaceBaoMingProto2 // S2C_GameRaceBaoMingProto2 ==2 服务器返回数据 G_Broadcast_GameRaceStartProto2 // G_Broadcast_GameRaceStartProto2 ==3 比赛开始发送比赛的房间信息 G_Broadcast_GameRaceDataProto2 // G_Broadcast_GameRaceDataProto2 ==4 广播比赛信息,包括正在比赛的玩家和结束的玩家 // 循环赛:人数限制需要配置,胜利场数排序 G_Broadcast_GameRaceResultProto2 // G_Broadcast_GameRaceResultProto2 ==5 循环赛结果全部发给每个客户端,按照胜利次数排行。 )
G_GameRace_Proto == 13 子协议
const ( ININSNAKE = iota C2S_PlayerLoginSProto2 // PlayerLoginSProto2 == 1 登陆协议 S2S_PlayerLoginSProto2 // S2S_PlayerLoginSProto2 == 2 登陆协议 C2S_PlayerEntryGameProto2 // C2S_PlayerEntryGameProto2 == 3 进入游戏 S2S_PlayerEntryGameProto2 // S2S_PlayerEntryGameProto2 == 4 C2S_PlayerMoveProto2 // C2S_PlayerMoveProto2 == 5 移动操作 S2S_PlayerMoveProto2 // S2S_PlayerMoveProto2 == 6 C2S_PlayerAddGameProto2 // C2S_PlayerAddGameProto2 == 7 玩家进入匹配成功后进入游戏 C2S_PlayerGameOverProto2 // C2S_PlayerGameOverProto2 == 8 游戏结束的协议 也是房间内广播 )
Variables ¶
var DSQ_GameExp int = 10
var DSQ_GameID int = 10001
Functions ¶
This section is empty.
Types ¶
type BroadCast_GameHint ¶
------------------------------------------------------------------------------ BroadCast_GameHintProto2
type BroadCast_GameOver ¶
type BroadCast_GameOver struct { Protocol int Protocol2 int IsDraw bool // 是否是平局 true表示平局,false表示不是平局 RoomID string // 房间列表 FailGameLev_Exp string // 格式: 1,10 SuccGameLev_Exp string // 格式: 1,10 FailPlayer map[string]interface{} // 失败者 SuccPlayer map[string]interface{} //*player.PlayerSt // 胜利者 }
------------------------------------------------------------------------------ BroadCast_GameOverProto2
type Broadcast_MsgNoticePlayer ¶
------------------------------------------------------------------------------ Broadcast_MsgNoticePlayerEmailProto2
type Broadcast_NoticePlayerEmail ¶
type Broadcast_NoticePlayerEmail struct { Protocol int Protocol2 int EmailData map[string]interface{} }
------------------------------------------------------------------------------ Broadcast_NoticePlayerEmailProto2
type Broadcast_PlayerUpGrade ¶
type Broadcast_PlayerUpGrade struct { Protocol int Protocol2 int OpenID string // 玩家唯一的ID BeforeLev int UpGradeLev int NowExp int AllExp int // 到达下一级的经验 }
------------------------------------------------------------------------------ Broadcast_PlayerUpGradeProto2
type C2GL_GameLogin ¶
type C2GL_GameLogin struct { Protocol int // 主协议 Protocol2 int // 子协议 LoginName string // 登录名字 LoginPW string // 登录密码 Timestamp int // 时间戳 }
------------------------------------------------------------------------------ C2GL_GameLoginProto2 客户端请求协议
type C2GWS_GetPlayerEmailList ¶
------------------------------------------------------------------------------ C2GWS_GetPlayerEmailListProto2
type C2GWS_PlayerChooseGame ¶
type C2GWS_PlayerChooseGame struct { Protocol int Protocol2 int OpenID string // 玩家唯一的ID 信息 GameID string // 游戏ID Timestamp int // 时间戳 }
------------------------------------------------------------------------------ C2GWS_PlayerChooseGameProto2 玩家请求进入游戏
type C2GWS_PlayerChooseGameMode ¶
type C2GWS_PlayerChooseGameMode struct { Protocol int Protocol2 int OpenID string // 玩家唯一标识 Itype string // Itype == 1:表示主动选择房间;Itype == 2:表示快速开始 RoomID string // 房间ID }
------------------------------------------------------------------------------ C2GWS_PlayerChooseGameModeProto2 玩家选择游戏模式
type C2GWS_PlayerGameInit ¶
------------------------------------------------------------------------------ C2GWS_PlayerGameInitProto2
type C2GWS_PlayerGiveUp ¶
------------------------------------------------------------------------------ C2GWS_PlayerGiveUpProto2 认输
type C2GWS_PlayerLogin ¶
type C2GWS_PlayerLogin struct { Protocol int Protocol2 int PlayerUID string // APP 的UID PlayerName string // 玩家的名字 HeadUrl string // 头像 Constellation string // 星座 PlayerSchool string // 玩家的学校 Sex string // 性别 Token string }
C2GWS_PlayerLoginProto2 登陆 客户端--> 服务器
type C2GWS_PlayerMoveChess ¶
type C2GWS_PlayerMoveChess struct { Protocol int Protocol2 int OpenID string RoomUID int OldPos string // 原来坐标 MoveDir int // 移动的方向,UP == 1,DOWN == 2,LEFT == 3,RIGHT == 4 }
------------------------------------------------------------------------------ C2GWS_PlayerMoveChessProto2
type C2GWS_PlayerRelinkGame ¶
type C2GWS_PlayerRelinkGame struct { Protocol int Protocol2 int Itype int // 暂时不用字段 OpenID string RoomUID int }
------------------------------------------------------------------------------ C2GWS_PlayerRelinkGameProto2
type C2GWS_PlayerStirChess ¶
type C2GWS_PlayerStirChess struct { Protocol int Protocol2 int OpenID string RoomUID int StirPos string // 翻动的位置 格式: x,y }
------------------------------------------------------------------------------ C2GWS_PlayerStirChessProto2
type C2GWS_QuitMatch ¶
------------------------------------------------------------------------------ C2GWS_QuitMatchProto2 玩家退出匹配
type C2GWS_RaceBaoMing ¶
------------------------------------------------------------------------------ C2GWS_RaceBaoMingProto2
type C2GWS_ReadOrDelPlayerEmail ¶
type C2GWS_ReadOrDelPlayerEmail struct { Protocol int Protocol2 int OpenID string Itype int // 1:读取打开,2:删除,3:领取附件 EmailID int // 邮件ID }
------------------------------------------------------------------------------ C2GWS_ReadOrDelPlayerEmailProto2
type C2S_GameRaceBaoMing ¶
type C2S_GameRaceBaoMing struct { Protocol int Protocol2 int OpenID string Itype int // 1:参加循环赛,2:参加积分赛,3:参加段位赛 }
------------------------------------------------------------------------------ C2S_GameRaceBaoMingProto2 游戏报名
type C2S_HallPlayerLogin ¶
type C2S_HallPlayerLogin struct { Protocol int // 主协议 -- 模块化 Protocol2 int // 子协议 -- 模块化的功能 Token string // 信息 token }
客户端-->服务器 C2S_HallPlayerLoginProto2
type C2S_PlayerAddGame ¶
type C2S_PlayerAddGame struct { Protocol int Protocol2 int OpenID string // 玩家的唯一的标识, 另外一个玩家的唯一标识 RoomID int // 房间ID PlayerHeadURL string // 玩家的头像数据 Init_X int // 初始化X Init_Y int // 初始化Y }
C2S_PlayerAddGameProto2 玩家进入匹配成功后进入游戏 服务器生产虚拟地图 -- 防止外挂修改本地数据导致数据不正确!!!!
type C2S_PlayerEntryGame ¶
进入游戏匹配
type C2S_PlayerLogin ¶
type C2S_PlayerLogin struct { Protocol int // 主协议 -- 模块化 Protocol2 int // 子协议 -- 模块化的功能 Itype int // 1 登陆,2 代表注册 Code string // 微信授权CODE StrLoginName string StrLoginPW string // 加密的数据 StrLoginEmail string // 收取验证码的 }
----------------------------------------------------------------------------- 客户端-->服务器 C2S_PlayerLoginProto2
type C2S_PlayerLoginS ¶
登陆 客户端--> 服务器
type C2S_PlayerMove ¶
type C2S_PlayerMove struct { Protocol int Protocol2 int OpenID string // 玩家的唯一的标识 RoomID int // 房间ID OP_ULRDP string // 玩家操作的方式:移动的方向 }
移动操作
type C2S_PlayerRun ¶
type C2S_PlayerRun struct { Protocol int // 主协议 -- 模块化 Protocol2 int // 子协议 -- 模块化的功能 OpenID string // 角色的ID 信息 token -- StrRunX string StrRunY string StrRunZ string // Z }
客户端-->服务器 C2S_PlayerRunProto2
type DB_GameOver ¶
type DB_GameOver struct { OpenID string GameID int GameLev int GameExp int GameScore int GameItem string // 游戏道具 GameTime int // 游戏的时间 }
------------------------------------------------------------------------------ 修改DB的协议
type DSQ2GW_BroadCast_GameOver ¶
type DSQ2GW_BroadCast_GameOver struct { Protocol int Protocol2 int OpenIDA string // 失败者 OpenIDB string // 胜利者 IsDraw bool // 是否是平局 FailGameLev_Exp string // 格式: 1,0 SuccGameLev_Exp string // 格式: 1,10 // FailPlayer map[string]*player.PlayerSt // 失败者 // SuccPlayer map[string]*player.PlayerSt // 胜利者 FailPlayer map[string]interface{} // 失败者 SuccPlayer map[string]interface{} // 胜利者 }
DSQ2GW_BroadCast_GameOverProto2
type DSQ2GW_ConnServer ¶
------------------------------------------------------------------------------ DSQ2GW_ConnServerProto2
type DSQ2GW_InitGame ¶
type DSQ2GW_InitGame struct { Protocol int Protocol2 int OpenID string RoomID string SeatNum int // 0 1 InitData [4][4]int // 斗兽棋的棋盘的数据 }
DSQ2GW_InitGameProto2
type DSQ2GW_PlayerMoveChess ¶
type DSQ2GW_PlayerMoveChess struct { Protocol int Protocol2 int OpenIDA string OpenIDB string RoomUID int OldPos string // 原来坐标 NewPos string // 新坐标 ResultID int }
DSQ2GW_PlayerMoveChessProto2 广播 同一个房间
type DSQ2GW_PlayerRelinkGame ¶
type DSQ2GW_PlayerRelinkGame struct { Protocol int Protocol2 int OpenIDA string OpenIDB string LeftTime int ChessData [4][4]int }
DSQ2GW_PlayerRelinkGameProto2
type DSQ2GW_PlayerStirChess ¶
type DSQ2GW_PlayerStirChess struct { Protocol int Protocol2 int OpenID string // 谁翻动了棋子 OpenID_b string // 另外一个人的ID StirPos string // 翻动的位置 格式:x,y ChessNum int // 1 - 16 正数 ResultID int }
DSQ2GW_PlayerStirChessProto2
type DSQ_GameHint ¶
type DSQ_GameHint struct { Protocol int Protocol2 int OpenIDA string OpenIDB string Itype int ResultID int }
------------------------------------------------------------------------------ DSQ_GameHintProto2
type G2GW_ConnServer ¶
------------------------------------------------------------------------------ G2GW_ConnServerProto2 去gateway去链接
type G2GW_GetPlayerEmailList ¶
type G2GW_GetPlayerEmailList struct { Protocol int Protocol2 int OpenID string EmailData map[int]*player.EmailST }
G2GW_GetPlayerEmailListProto2
type G2GW_PlayerEntryHall ¶
type G2GW_PlayerEntryHall struct { Protocol int Protocol2 int UID string // 用户唯一ID,app的数据库的ID信息 OpenID string // 用户唯一ID PlayerName string // 玩家的名字 HeadUrl string // 头像 Constellation string // 星座 PlayerSchool string // 学校 Sex string // 性别 Token string // 数据验证 }
------------------------------------------------------------------------------ G2GW_PlayerEntryHallProto2
type G2GW_PlayerMatch ¶
type G2GW_PlayerMatch struct { Protocol int Protocol2 int GWServerID int // 网关的ID信息,主要是数据统计需要 Type int // 匹配类型,1 1V1 ,2 2V2 ,3 5V5 OpenID string // 用户唯一ID }
------------------------------------------------------------------------------ G2GW_PlayerMatchProto2 玩家发送匹配的协议
type G2GW_PlayerMatchGame ¶
type G2GW_PlayerMatchGame struct { Protocol int Protocol2 int OpenID string // 玩家唯一标识 Itype string // Itype == 1:表示主动选择房间;Itype == 2:表示快速开始 RoomID string // 房间ID }
------------------------------------------------------------------------------ G2GW_PlayerMatchGameProto2
type G2GW_PlayerQuitMatchGame ¶
type G2GW_PlayerQuitMatchGame struct { Protocol int Protocol2 int OpenID string // 玩家唯一标识 ResultID int // 结果ID == 1表示成功; 0:表示失败 }
G2GW_PlayerQuitMatchGameProto2 退出的协议
type G2GW_ReadOrDelPlayerEmail ¶
type G2GW_ReadOrDelPlayerEmail struct { Protocol int Protocol2 int OpenID string Itype int // 0:失败,1:读取打开,2:删除,3:领取附件 EmailID int // 邮件ID }
G2GW_ReadOrDelPlayerEmailProto2
type GGW_Broadcast_GameRaceData ¶
type GGW_Broadcast_GameRaceData struct { Protocol int Protocol2 int Racing int // 比赛中 Raced int // 结束 }
------------------------------------------------------------------------------ GGW_Broadcast_GameRaceDataProto2
type GGW_Broadcast_GameRaceStart ¶
type GGW_Broadcast_GameRaceStart struct { Protocol int Protocol2 int RoomTmpID int // 自动匹配成功的房间ID信息 OpenIDA string OpenIDB string }
------------------------------------------------------------------------------ GGW_Broadcast_GameRaceStartProto2
type GL2C_GameLogin ¶
type GL2C_GameLogin struct { Protocol int // 主协议 Protocol2 int // 子协议 Tocken string // server 验证加密数据 PlayerST *player.PlayerSt // 玩家的结构 GateWayST *player.GateWayList // 大厅链接地址 GameList map[string]*conf.GameList // 游戏列表 GameListNew map[string]*conf.GameListNew // 游戏列表New BannerList map[string]*conf.Banner // 广告列表 RaceList map[string]*conf.RaceList // 广告列表 }
GL2C_GameLoginProto2 登录服务器返回给客户端协议
type GMS2W_Modify_PlayerData ¶
GMS2W_Modify_PlayerDataProto2 返回的操作是否成功
type GMS2W_Modify_PlayerEmailData ¶
type GMS2W_Modify_PlayerEmailData struct { Protocol int Protocol2 int IMsgtype int // 1:表示邮件,2:跑马灯消息 ResultID int // 结果ID,0:表示成功 }
GMS2W_Modify_PlayerEmailDataProto2
type GW2DSQ_ConnServer ¶
GW2DSQ_ConnServerProto2
type GW2DSQ_InitGame ¶
------------------------------------------------------------------------------ GW2DSQ_InitGameProto2
type GW2DSQ_PlayerGiveUp ¶
------------------------------------------------------------------------------ GW2DSQ_PlayerGiveUpProto2
type GW2DSQ_PlayerMoveChess ¶
type GW2DSQ_PlayerMoveChess struct { Protocol int Protocol2 int OpenID string RoomUID int OldPos string // 原来坐标 MoveDir int // 移动的方向,UP == 1,DOWN == 2,LEFT == 3,RIGHT == 4 }
------------------------------------------------------------------------------ GW2DSQ_PlayerMoveChessProto2
type GW2DSQ_PlayerRelinkGame ¶
------------------------------------------------------------------------------ GW2DSQ_PlayerRelinkGameProto2
type GW2DSQ_PlayerStirChess ¶
type GW2DSQ_PlayerStirChess struct { Protocol int Protocol2 int OpenID string RoomUID int StirPos string // 翻动的位置 格式: x,y }
------------------------------------------------------------------------------ GW2DSQ_PlayerStirChessProto2
type GW2G_ConnServer ¶
GW2G_ConnServerProto2 返回的数据链接
type GW2G_GetPlayerEmailList ¶
------------------------------------------------------------------------------ GW2G_GetPlayerEmailListProto2
type GW2G_HeartBeat ¶
------------------------------------------------------------------------------ GW2G_HeartBeatProto2 心跳协议
type GW2G_PlayerEntryHall ¶
type GW2G_PlayerEntryHall struct { Protocol int Protocol2 int OpenID string // 用户唯一ID PlayerName string // 玩家的名字 HeadUrl string // 头像 Constellation string // 星座 Sex string // 性别 GamePlayerNum map[string]interface{} // 每个游戏的玩家的人数,global server获取 RacePlayerNum map[string]interface{} // 大奖赛列表 Personal map[string]*player.PlayerSt // 个人信息 // Personal map[string]interface{} // 个人信息 DefaultMsg map[int]*player.MsgST // 默认跑马灯消息 DefaultAward map[string]interface{} // 默认兑换列表 AllPlayer map[string]interface{} // 玩家的信息 IsNewEmail bool // 是否有新邮件 }
GW2G_PlayerEntryHallProto2 查询需要返回的协议
type GW2G_PlayerMatch ¶
type GW2G_PlayerMatch struct { Protocol int Protocol2 int Type int // 匹配类型,1 1V1 ,2 2V2 ,3 5V5 RoomInfo string // 匹配成功后的房间中的信息 }
GW2G_PlayerMatchProto2 服务器返回数据对应匹配机制
type GW2G_PlayerMatchGame ¶
type GW2G_PlayerMatchGame struct { Protocol int Protocol2 int OpenID string // 玩家唯一标识 RoomUID int // 房间ID;注意匹配失败或者超时,数据为空 // MatchPlayer map[string]*match.RoomMatch // 匹配的玩家的信息;注意匹配失败或者超时,数据为空 MatchPlayer map[string]interface{} // 匹配的玩家的信息;注意匹配失败或者超时,数据为空 ChessBoard []interface{} // 棋盘的数据 ResultID int // 结果ID }
GW2G_PlayerMatchGameProto2
type GW2G_PlayerQuitMatchGame ¶
------------------------------------------------------------------------------ GW2G_PlayerQuitMatchGameProto2 GateWay --> Global server
type GW2G_ReadOrDelPlayerEmail ¶
type GW2G_ReadOrDelPlayerEmail struct { Protocol int Protocol2 int OpenID string Itype int // 1:读取打开,2:删除,3:领取附件 EmailID int }
------------------------------------------------------------------------------ GW2G_ReadOrDelPlayerEmailProto2
type G_Broadcast_GameRaceData ¶
type G_Broadcast_GameRaceData struct { Protocol int Protocol2 int Racing int // 比赛中 Raced int // 结束 }
------------------------------------------------------------------------------ G_Broadcast_GameRaceDataProto2 广播比赛信息,包括正在比赛的玩家和结束的玩家
type G_Broadcast_GameRaceResult ¶
type G_Broadcast_GameRaceResult struct { Protocol int Protocol2 int RaceResult map[string]interface{} // 比赛结果 }
------------------------------------------------------------------------------ G_Broadcast_GameRaceResultProto2 循环赛结果
type G_Broadcast_GameRaceStart ¶
type G_Broadcast_GameRaceStart struct { Protocol int Protocol2 int RoomTmpID int // 自动匹配成功的房间ID信息 OpenIDA string OpenIDB string }
------------------------------------------------------------------------------
G_Broadcast_GameRaceStartProto2 比赛开始
type G_Broadcast_MsgNoticePlayer ¶
type G_Broadcast_MsgNoticePlayer struct { Protocol int Protocol2 int OpenID string MsgData map[int]*player.MsgST // 消息系统 }
------------------------------------------------------------------------------ G_Broadcast_MsgNoticePlayerProto2
type G_Broadcast_NoticePlayerEmail ¶
type G_Broadcast_NoticePlayerEmail struct { Protocol int Protocol2 int OpenID string EmailData map[int]*player.EmailST }
------------------------------------------------------------------------------ G_Broadcast_NoticePlayerEmailProto2
type G_Error_All ¶
type G_Error_All struct { Protocol int // 主协议 -- 模块化 Protocol2 int // 子协议 -- 模块化的功能 ErrCode string // 玩家的结构 ErrMsg string }
错误处理
type GateWay_HeartBeat ¶
type GateWay_HeartBeat struct { Protocol int Protocol2 int OpenID string // 65位 玩家的唯一ID -- server ---> client (多数不需验证OpenID) }
GateWay_HeartBeatProto2 心跳协议
type GateWay_Logout ¶
type GateWay_Logout struct { Protocol int Protocol2 int OpenID string // 玩家唯一ID ResultID int // 结果ID }
------------------------------------------------------------------------------ GateWay_LogoutProto2 玩家登出
type GateWay_Relink ¶
type GateWay_Relink struct { Protocol int Protocol2 int OpenID string // 玩家唯一ID Istate int // 玩家所在的位置状态信息,例如 在游戏中、在其他的环节等;游戏中等待 ResultID int // 结果ID == 1表示成功; 0:表示失败 }
------------------------------------------------------------------------------ GateWay_RelinkProto2 重新链接网关
type GateWay_Relink1 ¶
------------------------------------------------------------------------------ 断线重连 网关
type Net_HeartBeat ¶
type Net_HeartBeat struct { Protocol int // 主协议 -- 模块化 Protocol2 int // 子协议 -- 模块化的功能 OpenID string // 65位 玩家的唯一ID -- server ---> client (多数不需验证OpenID) }
心跳协议
type Net_Kicking_Player ¶
type Net_Kicking_Player struct { Protocol int // 主协议 -- 模块化 Protocol2 int // 子协议 -- 模块化的功能 OpenID string // 玩家唯一ID ErrorCode int // 错误码 10001 10002 10003 StrMsg string // 原因 }
踢人
type Net_Relink ¶
type Net_Relink struct { Protocol int // 主协议 -- 模块化 Protocol2 int // 子协议 -- 模块化的功能 OpenID string // 玩家的唯一ID StrLoginName string // StrLoginPW string // 加密的数据 ISucc bool // 服务器返回的数据 }
断线重新链接 玩家的结构协议 ---- update
type S2C_GameRaceBaoMing ¶
type S2C_GameRaceBaoMing struct { Protocol int Protocol2 int IState int // 状态码 1:报名成功,2:报名已经结束,3:其他错误 }
S2C_GameRaceBaoMingProto2 游戏报名
type S2C_HallPlayerLogin ¶
type S2C_HallPlayerLogin struct { Protocol int // 主协议 -- 模块化 Protocol2 int // 子协议 -- 模块化的功能 GameList map[string]*GGameList // 游戏列表 }
服务器-->N*客户端(广播出去所有的玩家)
type S2C_PlayerLogin ¶
type S2C_PlayerLogin struct { Protocol int // 主协议 -- 模块化 Protocol2 int // 子协议 -- 模块化的功能 PlayerData *PlayerSt // 玩家的结构 }
服务器-->客户端
type S2C_PlayerRun ¶
type S2C_PlayerRun struct { Protocol int // 主协议 -- 模块化 Protocol2 int // 子协议 -- 模块化的功能 OpenID string // 角色的ID 信息 token -- StrRunX string StrRunY string StrRunZ string // Z }
服务器-->N*客户端(广播出去所有的玩家)
type S2GWS_GetPlayerEmailList ¶
type S2GWS_GetPlayerEmailList struct { Protocol int Protocol2 int EmailData map[string]interface{} }
S2GWS_GetPlayerEmailListProto2
type S2GWS_PlayerChooseGame ¶
S2GWS_PlayerChooseGameProto2
type S2GWS_PlayerChooseGameMode ¶
type S2GWS_PlayerChooseGameMode struct { Protocol int Protocol2 int OpenID string // 玩家唯一标识 RoomUID int // 房间ID;注意匹配失败或者超时,数据为空 MatchPlayer map[string]interface{} // 匹配的玩家的信息;注意匹配失败或者超时,数据为空 ChessBoard []interface{} // 棋盘的数据 ResultID int // 结果ID }
S2GWS_PlayerChooseGameModeProto2 服务器返回数据
type S2GWS_PlayerGameInit ¶
type S2GWS_PlayerGameInit struct { Protocol int Protocol2 int OpenID string RoomUID int SeatNum int // 0 1 ChessBoard []interface{} // 棋盘的数据 0表示空 }
S2GWS_PlayerGameInitProto2
type S2GWS_PlayerLogin ¶
type S2GWS_PlayerLogin struct { Protocol int Protocol2 int OpenID string PlayerName string // 玩家的名字 HeadUrl string // 头像 Constellation string // 星座 Sex string // 性别 GamePlayerNum map[string]interface{} // 每个游戏的玩家的人数,global server获取 RacePlayerNum map[string]interface{} // 大奖赛列表 Personal map[string]interface{} // 个人信息 DefaultMsg map[string]interface{} // 默认跑马灯消息 // DefaultAward map[string]interface{} // 默认兑换列表 AllPlayer map[string]interface{} // 玩家的信息 IsNewEmail bool // 是否有新邮件 }
S2GWS_PlayerLoginProto2
type S2GWS_PlayerMoveChess ¶
type S2GWS_PlayerMoveChess struct { Protocol int Protocol2 int OpenID string RoomUID int OldPos string // 原来坐标 NewPos string // 新坐标 ResultID int // 错误ID }
S2GWS_PlayerMoveChessProto2 广播 同一个房间
type S2GWS_PlayerRelinkGame ¶
type S2GWS_PlayerRelinkGame struct { Protocol int Protocol2 int LeftTime int ChessBoard []interface{} // 棋盘的数据 0表示空 ,17表示还没有翻开 }
------------------------------------------------------------------------------ S2GWS_PlayerRelinkGameProto2
type S2GWS_PlayerStirChess ¶
type S2GWS_PlayerStirChess struct { Protocol int Protocol2 int OpenID string // 谁翻动了棋子 StirPos string // 翻动的位置 格式:x,y ChessNum int // 1 - 16 正数 ResultID int // 错误ID }
S2GWS_PlayerStirChessProto2 广播
type S2GWS_QuitMatch ¶
type S2GWS_QuitMatch struct { Protocol int Protocol2 int OpenID string ResultID int // 结果ID == 1表示成功; 0:表示失败 }
S2GWS_QuitMatchProto2 玩家退出匹配 服务器清理数据
type S2GWS_RaceBaoMing ¶
type S2GWS_ReadOrDelPlayerEmail ¶
type S2GWS_ReadOrDelPlayerEmail struct { Protocol int Protocol2 int Itype int // 0:失败,1:读取打开,2:删除,3:领取附件 EmailID int // 邮件ID }
S2GWS_ReadOrDelPlayerEmailProto2
type S2S_PlayerEntryGame ¶
type S2S_PlayerEntryGame struct { Protocol int Protocol2 int RoomID int //房间ID Data []int MapPlayer map[int]*player.PlayerSt // 玩家的结构信息 }
返回数据操作
type S2S_PlayerLoginS ¶
type S2S_PlayerMove ¶
type S2S_PlayerMove struct { Protocol int Protocol2 int OpenID string // 玩家的唯一的标识 OP_ULRDP string // 玩家操作的方式:移动的方向 }
服务器广播给用户操作--同一个房间的,其他房间不广播
type W2GMS_Get_PlayerEmailData ¶
W2GMS_Get_PlayerEmailDataProto2
type W2GMS_Modify_PlayerData ¶
type W2GMS_Modify_PlayerData struct { Protocol int Protocol2 int UID string // 玩家的唯一ID信息 Itype string // MODIFYINIT 查看枚举 ModifyNum string // 正数表示增加,负数标识减少 }
------------------------------------------------------------------------------ W2GMS_Modify_PlayerDataProto2 修改玩家的数据的GM 指令
type W2GMS_Modify_PlayerEmailData ¶
type W2GMS_Modify_PlayerEmailData struct { Protocol int Protocol2 int IMsgtype int // 1:表示邮件,2:跑马灯消息,3:针对个人 OpenID string // 玩家唯一ID // EmailData *player.EmailST // 邮件的消息 EmailData *player.EmailGM // 邮件的消息 MsgData *player.MsgST // 跑马灯的消息 }
------------------------------------------------------------------------------
邮件*跑马灯
W2GMS_Modify_PlayerEmailDataProto2