1
This commit is contained in:
parent
a7f64b7063
commit
be61be7039
@ -28,7 +28,7 @@ type Player interface {
|
|||||||
GetName() string
|
GetName() string
|
||||||
GetAvatarUrl() string
|
GetAvatarUrl() string
|
||||||
GetHeroId() string
|
GetHeroId() string
|
||||||
GetHeadFrame() int32
|
GetHeadFrame() string
|
||||||
GetPing() int32
|
GetPing() int32
|
||||||
SendMsg(proto.Message)
|
SendMsg(proto.Message)
|
||||||
IsOnline() bool
|
IsOnline() bool
|
||||||
|
@ -19,7 +19,7 @@ type player struct {
|
|||||||
name string
|
name string
|
||||||
avatarUrl string
|
avatarUrl string
|
||||||
heroId string
|
heroId string
|
||||||
headFrame int32
|
headFrame string
|
||||||
ping int32
|
ping int32
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,8 @@ func (this *player) SetRoom(room common.Room) {
|
|||||||
this.room = room
|
this.room = room
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *player) init(req *pendingLoginRequest, name string, avatarUrl string, heroId string){
|
func (this *player) init(req *pendingLoginRequest, name string, avatarUrl string, heroId string,
|
||||||
|
headFrame 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()
|
||||||
@ -46,6 +47,7 @@ func (this *player) init(req *pendingLoginRequest, name string, avatarUrl string
|
|||||||
this.name = name
|
this.name = name
|
||||||
this.avatarUrl = avatarUrl
|
this.avatarUrl = avatarUrl
|
||||||
this.heroId = heroId
|
this.heroId = heroId
|
||||||
|
this.headFrame = headFrame
|
||||||
this.internalSetPing(req.msg.GetPing())
|
this.internalSetPing(req.msg.GetPing())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +89,7 @@ func (this *player) GetHeroId() string {
|
|||||||
return this.heroId
|
return this.heroId
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *player) GetHeadFrame() int32 {
|
func (this *player) GetHeadFrame() string {
|
||||||
return this.headFrame
|
return this.headFrame
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,6 +151,7 @@ func (this *playerMgr) apiAuthCb(hdr *f5.MsgHdr, msg *cs.CMLogin, rsp f5.HttpCli
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
HeadId string `json:"head_id"`
|
HeadId string `json:"head_id"`
|
||||||
HeroId string `json:"hero_id"`
|
HeroId string `json:"hero_id"`
|
||||||
|
HeadFrame string `json:"head_frame"`
|
||||||
} `json:"info"`
|
} `json:"info"`
|
||||||
}{}
|
}{}
|
||||||
{
|
{
|
||||||
@ -172,7 +173,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, rspObj.Info.HeadId, rspObj.Info.HeroId)
|
hum.init(pendingReq, rspObj.Info.Name, rspObj.Info.HeadId, rspObj.Info.HeroId, rspObj.Info.HeadFrame)
|
||||||
this.accountIdHash[hum.GetAccountId()] = hum
|
this.accountIdHash[hum.GetAccountId()] = hum
|
||||||
this.socketHash[pendingReq.hdr.GetSocket()] = hum
|
this.socketHash[pendingReq.hdr.GetSocket()] = hum
|
||||||
|
|
||||||
|
@ -112,8 +112,8 @@ message MFMember
|
|||||||
optional string account_id = 1; //账号id
|
optional string account_id = 1; //账号id
|
||||||
optional string name = 2; //
|
optional string name = 2; //
|
||||||
optional string avatar_url = 3; //头像
|
optional string avatar_url = 3; //头像
|
||||||
optional int32 hero_id = 4; //英雄id
|
optional string hero_id = 4; //英雄id
|
||||||
optional int32 head_frame = 5; //头像框
|
optional string head_frame = 5; //头像框
|
||||||
optional int32 state = 9; //0:准备 1:已准备
|
optional int32 state = 9; //0:准备 1:已准备
|
||||||
optional int32 ping = 20; //ping值(单位毫秒)
|
optional int32 ping = 20; //ping值(单位毫秒)
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,8 @@ func (this *member) fillMFMember(pb *cs.MFMember) {
|
|||||||
pb.AccountId = proto.String(this.hum.GetAccountId())
|
pb.AccountId = proto.String(this.hum.GetAccountId())
|
||||||
pb.Name = proto.String(this.hum.GetName())
|
pb.Name = proto.String(this.hum.GetName())
|
||||||
pb.AvatarUrl = proto.String(this.hum.GetAvatarUrl())
|
pb.AvatarUrl = proto.String(this.hum.GetAvatarUrl())
|
||||||
|
pb.HeroId = proto.String(this.hum.GetHeroId())
|
||||||
|
pb.HeadFrame = proto.String(this.hum.GetHeadFrame())
|
||||||
pb.State = proto.Int32(this.state)
|
pb.State = proto.Int32(this.state)
|
||||||
pb.Ping = proto.Int32(this.hum.GetPing())
|
pb.Ping = proto.Int32(this.hum.GetPing())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user