login.go 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. package msg
  2. import "leafstalk/covenant/model"
  3. // 服务器发送有用户登录
  4. type Login struct {
  5. AccId int64 `json:"accId"`
  6. OpenId string `json:"openId"`
  7. RemoteAddr string `json:"remoteAddr"`
  8. NickName string `json:"nickName"`
  9. ImgUrl string `json:"imgUrl"`
  10. GateId int64 `json:"gateId"`
  11. LineId int64 `json:"lineId"`
  12. ClickId string `json:"clickId"`
  13. AdId string `json:"adId"`
  14. AdSrc string `json:"adSrc"`
  15. Flag int `json:"flag"`
  16. Plat string `json:"plat"`
  17. SubPlat string `json:"subPlat"`
  18. SessionKey string `json:"sessionKey"`
  19. }
  20. type ResponseLogin struct {
  21. AccId int64 `json:"userId"`
  22. DocId int64 `json:"docId"`
  23. ErrCode int `json:"errCode"`
  24. }
  25. type Logout struct {
  26. RpcRequestMsg
  27. PlayerIds []int64 `json:"userIds"`
  28. }
  29. type ResponseLogout struct {
  30. RpcResponseMsg
  31. PlayerIds []int64 `json:"userIds"`
  32. }
  33. // Entry 登录
  34. type Entry struct {
  35. UserId int64 `json:"userId"` //客户端->gate:accid; gate->world:playerId
  36. PhoneType int64 `json:"phoneType"`
  37. ClientFlag string `json:"clientPlat"`
  38. Version string `json:"version"`
  39. Token string `json:"token"`
  40. LineId int64 `json:"serverId"`
  41. SubPlat string `json:"subPlat"`
  42. }
  43. type BuffData struct {
  44. BuffId int `json:"buffId"` //buFF id
  45. CoolDown int `json:"coolDown"` //倒计时
  46. }
  47. // type EntryDataFort struct {
  48. // Level int64 `json:"level"` //等级
  49. // Parts [6]*model.FortPart `json:"parts"` //部位
  50. // TalentTree [2]int64 `json:"talents"` //天赋树
  51. // Skin *model.FortSkin `json:"skin"` //皮肤
  52. // SkillIds [3]int64 `json:"skill"` //技能
  53. // }
  54. type GmPlayer struct {
  55. MsgId string `json:"msgId"`
  56. PlayerID int64 `json:"userId"`
  57. OperatorId int64 `json:"operatorId"`
  58. }
  59. type ResponseGmPlayer struct {
  60. ErrCode int `json:"errCode"`
  61. MsgId string `json:"msgId"`
  62. Data *EntryData
  63. }
  64. // 增加 金币、钻石、材料、装备
  65. type GmAddMaterial struct {
  66. MsgId string `json:"msgId"`
  67. PlayerID int64 `json:"userId"`
  68. Materials map[int64]int64 `json:"materials"`
  69. Runes map[int64]int64 `json:"runes"`
  70. Legends map[int64]int64 `json:"legends"`
  71. Equipments []int64 `json:"equipments"`
  72. Treasures []int64 `json:"treasures"`
  73. OperatorId int64 `json:"operatorId"`
  74. ClientPlat string `json:"clientPlat"`
  75. }
  76. type ResponseGmAddMaterial struct {
  77. ErrCode int `json:"errCode"`
  78. MsgId string `json:"msgId"`
  79. }
  80. // 要塞时装(皮肤)
  81. // type FortSkin struct {
  82. // Wear int64 `json:"wear"`
  83. // Skins map[int64]int64 `json:"skins"` //皮肤id:星级
  84. // }
  85. // type Hero struct {
  86. // ID int64 `json:"id"`
  87. // Level int64 `json:"level"` // 当等级=0时,表示英雄未解锁,可以拥有皮肤
  88. // Wear int64 `json:"wear"`
  89. // Skins []int64 `json:"skins"`
  90. // }
  91. type ChapterProcess struct {
  92. Standard int64 `json:"standard"` //主章节当前进度
  93. Advanced int64 `json:"advanced"` //精英
  94. Cooperation int64 `json:"cooperation"` //合作关卡
  95. Levels map[int64]*LevelProcess `json:"levels"`
  96. CDs []int64 `json:"cds"` //普通 困难 噩梦
  97. OpenServerTl int64 `json:"openServerTl"` //开服时长
  98. }
  99. type LevelProcess struct {
  100. Level int64 `json:"id"` //关卡
  101. Wave int64 `json:"wave"` //首通波次
  102. Geted int64 `json:"geted"` //首通获取到的波次
  103. SubWave int64 `json:"subWave"` //次通波次
  104. SubGeted int64 `json:"subGeted"` //次通获取到的波次
  105. }
  106. type Legend struct {
  107. Level int64 `json:"level"` // 精通等级
  108. SlotWear map[int64]int64 `json:"slotWear"` // {slotId:modelId}
  109. Legends map[int64]int64 `json:"legends"` // {modelId:num}
  110. }
  111. type PayParam struct {
  112. WxIosOpenLevel int64 `json:"wxIosOpenLevel"`
  113. PayMethod int `json:"payMethod"`
  114. }
  115. type EntryData struct {
  116. PlayerId int64 `json:"userId"`
  117. Level int `json:"userLevel"`
  118. AccId int64 `json:"accId"`
  119. Exp int64 `json:"userExp"`
  120. Heros map[int64]*model.Hero `json:"heros"`
  121. Fort *model.EntryDataFort `json:"fort"`
  122. Materials map[int64]int64 `json:"materials"`
  123. Runes map[string]*model.BagRune `json:"runes"`
  124. Treasures map[int64]*model.GrowableTreasure `json:"treasures"`
  125. Chapters *ChapterProcess `json:"chapters"`
  126. Crystals map[int64]int64 `json:"crystals"`
  127. Arenas model.ClientArena `json:"arenas"`
  128. Resonances []*model.GrowableResonance `json:"resonances"`
  129. Renown int64 `json:"renown"`
  130. LoginDays int64 `json:"loginDays"`
  131. Legends *Legend `json:"legends"`
  132. ServerTs int64 `json:"serverts"`
  133. HeadId int64 `json:"headId"`
  134. FrameId int64 `json:"frameId"`
  135. Nick string `json:"nick"`
  136. ChangedNickNum int64 `json:"changedNickNum"`
  137. CreditScore int64 `json:"creditScore"`
  138. CoopTickets map[int64]int64 `json:"coopTickets"`
  139. GameSyncEnterRoom *model.EnterRoomData `json:"gameSyncEnterRoom"`
  140. Pay PayParam `json:"pay"`
  141. LanuchShare UserShareData `json:"lanuchShare"`
  142. // TimeStamp int64 `json:"timeStamp"`
  143. // Stamina int `json:"stamina"`
  144. // LastLogoutTick int64 `json:"lastLogoutTick"`
  145. // FirstWeapon bool `json:"firstGame"`
  146. // Guide []int `json:"guide"`
  147. // Funs []int `json:"funs"`
  148. // Equipments []*model.DropEquipment `json:"equipments"`
  149. // Roles []*model.DropedRole `json:"roles"`
  150. // Treasures []*model.DropedTreasure `json:"treasures"`
  151. // Talents []*model.DropTalent `json:"talents"`
  152. // TalentPoint int `json:"talentPoint"`
  153. // PassRoom []*model.PlayerPassRoom `json:"passRoom"`
  154. // Buff *BuffData `json:"buff"`
  155. // LastChapter *model.ChapterSummary `json:"lastChapter"`
  156. // BodyParts []*model.BodyPart `json:"bodyParts"`
  157. // RoleCollocate []int `json:"roleCollocate"` // 角色羁绊
  158. // PayMethod *model.PayMethodData `json:"payMethod"`
  159. // DoubleAdCount int `json:"adCount"`
  160. // Location int `json:"adState"`
  161. // Flag int `json:"flag"`
  162. // MaxCombatEffe int64 `json:"maxCombatEffe"`
  163. // PaySwitch int `json:"paySwitch"`
  164. // New bool `json:"isNew"` // 新注册玩家
  165. // CreateTick int64 `json:"createTick"`
  166. // AutoCheckToken int `json:"autoCheckToken"` // 是否发送随机种子 0/1
  167. // NickName string `json:"nickName"`
  168. // ImgUrl string `json:"imgUrl"`
  169. // HeadId int `json:"headId"` // 头像 -1 代表使用 AvatarURL 微信授权头像
  170. // FrameId int `json:"frameId"` // 头像框
  171. // InviterStatus int `json:"inviterStatus"` // 邀请设置
  172. // List []*HeadFrameDataList `json:"framelist"`
  173. // VipId []int64 `json:"vipId"` // 截止到登录还生效的月卡 季卡 永久卡
  174. // CreateTime int64 `json:"createtime"`
  175. // NowTime int64 `json:"nowtime"`
  176. // RoleTreasure []*model.RoleTreasureInfo `json:"roleTreasure"` // 专属宝物
  177. }
  178. type ResponseEntry struct {
  179. ErrCode int `json:"errCode"`
  180. Msg string `json:"msg,omitempty"`
  181. Data *EntryData `json:"data"`
  182. }
  183. // ReLogin 重新连接
  184. type ReLogin struct {
  185. UID int64 `json:"userId"`
  186. ClientFlag int `json:"clientFlag"`
  187. Version string `json:"version"`
  188. Token string `json:"token"`
  189. }
  190. type ResponseReLogin struct {
  191. ErrCode int `json:"errCode"`
  192. Msg string `json:"msg,omitempty"`
  193. Data *EntryData `json:"data"`
  194. }