diff --git a/server/matchserver/common/types.go b/server/matchserver/common/types.go index 1602d4ee..d58fbef0 100644 --- a/server/matchserver/common/types.go +++ b/server/matchserver/common/types.go @@ -22,12 +22,16 @@ type LoginRsp struct { HeadId string `json:"head_id"` HeroId string `json:"hero_id"` HeadFrame string `json:"head_frame"` + TotalLucky interface{} `json:"total_lucky"` + AdmissionItemNum interface{} `json:"admission_item_num"` } `json:"user_info"` HeroInfo struct { HeroUniId string `json:"hero_uniid"` HeroId string `json:"hero_id"` Quality string `json:"quality"` SpecSkill string `json:"spec_skill"` + Wealth interface{} `json:"wealth"` + ValidLefttime interface{} `json:"valid_lefttime"` } `json:"hero_info"` MapInfo MapInfoRsp `json:"map_info"` } `json:"info"` diff --git a/server/matchserver/listener/handlermgr.go b/server/matchserver/listener/handlermgr.go index 4287c2c3..c305bbac 100644 --- a/server/matchserver/listener/handlermgr.go +++ b/server/matchserver/listener/handlermgr.go @@ -29,6 +29,7 @@ func (this *HandlerMgr) Init() { cs.RegHandlerId(int(cs.CMMessageIdE__CMChooseHero), constant.PLAYER_HANDLER_ID) cs.RegHandlerId(int(cs.CMMessageIdE__CMChooseMap), constant.PLAYER_HANDLER_ID) cs.RegHandlerId(int(cs.CMMessageIdE__CMGrantInvitePermission), constant.PLAYER_HANDLER_ID) + cs.RegHandlerId(int(cs.CMMessageIdE__CMRefreshUser), constant.PLAYER_HANDLER_ID) } func (this *HandlerMgr) UnInit() { diff --git a/server/matchserver/player/player.go b/server/matchserver/player/player.go index 61d08938..33eeed61 100644 --- a/server/matchserver/player/player.go +++ b/server/matchserver/player/player.go @@ -17,6 +17,8 @@ type hero struct { heroId int32 quality int32 specSkill int32 + wealth int32 + validLeftTime int32 } type player struct { @@ -32,6 +34,8 @@ type player struct { state int32 isReady int32 permission int32 + admissionItemNum int32 + totalLucky int64 hero hero team common.Team sortIdx int32 @@ -52,11 +56,15 @@ func (this *player) init(req *pendingLoginRequest, rsp *common.LoginRsp){ this.name = rsp.Info.UserInfo.Name this.avatarUrl = rsp.Info.UserInfo.HeadId this.headFrame = rsp.Info.UserInfo.HeadFrame + q5.DuckToSimple(rsp.Info.UserInfo.AdmissionItemNum, &this.admissionItemNum) + q5.DuckToSimple(rsp.Info.UserInfo.TotalLucky, &this.totalLucky) { this.hero.heroUniId = rsp.Info.HeroInfo.HeroUniId this.hero.heroId = q5.ToInt32(rsp.Info.HeroInfo.HeroId) this.hero.quality = q5.ToInt32(rsp.Info.HeroInfo.Quality) this.hero.specSkill = q5.ToInt32(rsp.Info.HeroInfo.SpecSkill) + q5.DuckToSimple(rsp.Info.HeroInfo.Wealth, &this.hero.wealth) + q5.DuckToSimple(rsp.Info.HeroInfo.ValidLefttime, &this.hero.validLeftTime) } } @@ -378,6 +386,11 @@ func (this *player) CMChooseMap(hdr *f5.MsgHdr, msg *cs.CMChooseMap) { } } +func (this *player) CMRefreshUser(hdr *f5.MsgHdr, msg *cs.CMRefreshUser) { + rspMsg := new(cs.SMRefreshUser) + this.SendMsg(rspMsg) +} + func (this *player) updateChoose(skillId int32, heroUniId string, cb func (int32, string)) { params := map[string]string{