This commit is contained in:
aozhiwei 2023-09-15 19:12:15 +08:00
parent c36ab3105a
commit 2ccf8fab2c
4 changed files with 8 additions and 8 deletions

View File

@ -26,7 +26,7 @@ type Player interface {
GetSessionId() string GetSessionId() string
GetName() string GetName() string
GetAvatarUrl() string GetAvatarUrl() string
GetHeroId() int32 GetHeroId() string
GetPing() int32 GetPing() int32
GetTeamUuid() string GetTeamUuid() string
GetZoneId() int32 GetZoneId() int32

View File

@ -15,7 +15,7 @@ type player struct {
sessionId string sessionId string
name string name string
avatarUrl string avatarUrl string
heroId int32 heroId string
ping int32 ping int32
room common.Room room common.Room
} }
@ -38,7 +38,7 @@ func (this *player) SetRoom(room common.Room) {
this.room = room this.room = room
} }
func (this *player) init(req *pendingLoginRequest, name string, avatarUrl string, heroId int32){ func (this *player) init(req *pendingLoginRequest, name string, avatarUrl string, heroId string){
this.socket = req.hdr.GetSocket() this.socket = req.hdr.GetSocket()
this.accountId = req.msg.GetAccountId() this.accountId = req.msg.GetAccountId()
this.sessionId = req.msg.GetSessionId() this.sessionId = req.msg.GetSessionId()
@ -70,7 +70,7 @@ func (this *player) GetAvatarUrl() string {
return this.avatarUrl return this.avatarUrl
} }
func (this *player) GetHeroId() int32 { func (this *player) GetHeroId() string {
return this.heroId return this.heroId
} }

View File

@ -134,8 +134,8 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
RenameCount string `json:"rename_count"` RenameCount string `json:"rename_count"`
AccountID string `json:"account_id"` AccountID string `json:"account_id"`
Name string `json:"name"` Name string `json:"name"`
HeadId int32 `json:"head_id"` HeadId string `json:"head_id"`
HeroId int32 `json:"hero"` HeroId string `json:"hero_id"`
} `json:"info"` } `json:"info"`
}{} }{}
{ {
@ -157,7 +157,7 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
} }
hum := new(player) hum := new(player)
hum.init(pendingReq, rspObj.Info.Name, q5.ToString(rspObj.Info.HeadId), rspObj.Info.HeroId) hum.init(pendingReq, rspObj.Info.Name, rspObj.Info.HeadId, rspObj.Info.HeroId)
this.accountIdHash[hum.GetAccountId()] = hum this.accountIdHash[hum.GetAccountId()] = hum
this.socketHash[pendingReq.hdr.GetSocket()] = hum this.socketHash[pendingReq.hdr.GetSocket()] = hum

View File

@ -96,7 +96,7 @@ class TestCase {
}); });
this.userData = response; this.userData = response;
const endTick = getTickCount(); const endTick = getTickCount();
//console.log('login auth@User', endTick - startTick, String(err), response); console.log('login auth@User', endTick - startTick, String(err), response);
} }
async step3() { async step3() {