This commit is contained in:
aozhiwei 2024-03-12 15:54:38 +08:00
parent 33e3b9aec4
commit 051a3a62ca
2 changed files with 13 additions and 1 deletions

View File

@ -8,6 +8,12 @@ import (
. "main/global"
)
type hero struct {
heroUniId string
heroId int32
quality int32
}
type player struct {
cs.MsgHandlerImpl
socket f5.WspCliConn
@ -25,6 +31,7 @@ type player struct {
state int32
isReady int32
permission int32
hero *hero
team common.Team
}
@ -139,7 +146,11 @@ func (this *player) FillMFTeamMember(member_pb *cs.MFTeamMember) {
member_pb.Name = proto.String(this.name)
member_pb.IsLeader = proto.Int32(this.isLeader)
member_pb.SpecSkill = proto.Int32(this.specSkill)
//hero
{
member_pb.Hero = &cs.MFHero{}
member_pb.Hero.HeroId = proto.Int32(this.hero.heroId)
member_pb.Hero.Quality = proto.Int32(this.hero.quality)
}
member_pb.State = proto.Int32(this.state)
if this.IsOnline() {
member_pb.Online = proto.Int32(1)

View File

@ -71,6 +71,7 @@ func (this *team) OnPlayerOnline(hum common.Player) {
}
func (this *team) Join(hum common.Player) bool {
hum.SetTeam(this)
this.accountIdHash[hum.GetAccountId()] = hum
return true
}