1
This commit is contained in:
parent
c1d413c169
commit
f46ef668cc
@ -73,6 +73,7 @@ type Player interface {
|
||||
SetTeam(Team)
|
||||
FillMFTeamMember(*cs.MFTeamMember)
|
||||
GetSortIdx() int32
|
||||
SetSortIdx(int32)
|
||||
}
|
||||
|
||||
type PlayerMgr interface {
|
||||
|
@ -31,6 +31,7 @@ type player struct {
|
||||
permission int32
|
||||
hero hero
|
||||
team common.Team
|
||||
sortIdx int32
|
||||
}
|
||||
|
||||
func (this *player) SendMsg(rspMsg proto.Message) {
|
||||
@ -128,7 +129,11 @@ func (this *player) SetTeam(team common.Team) {
|
||||
}
|
||||
|
||||
func (this *player) GetSortIdx() int32 {
|
||||
return 0
|
||||
return this.sortIdx
|
||||
}
|
||||
|
||||
func (this *player) SetSortIdx(sortIdx int32) {
|
||||
this.sortIdx = sortIdx
|
||||
}
|
||||
|
||||
func (this *player) FillMFTeamMember(member_pb *cs.MFTeamMember) {
|
||||
|
@ -18,6 +18,7 @@ type team struct {
|
||||
zoneId int32
|
||||
nodeId int32
|
||||
mapId int32
|
||||
sortIdx int32
|
||||
owner common.Player
|
||||
state int32
|
||||
startTime int64
|
||||
@ -26,6 +27,7 @@ type team struct {
|
||||
}
|
||||
|
||||
func (this *team) init(teamUuid string, owner common.Player, msg *cs.CMLogin) {
|
||||
this.sortIdx++
|
||||
this.teamUuid = teamUuid
|
||||
this.zoneId = owner.GetZoneId()
|
||||
this.nodeId = owner.GetNodeId()
|
||||
@ -33,6 +35,7 @@ func (this *team) init(teamUuid string, owner common.Player, msg *cs.CMLogin) {
|
||||
this.owner = owner
|
||||
this.stateNotifyMsg.JoinMsg.TeamUuid = proto.String(this.teamUuid)
|
||||
owner.SetTeam(this)
|
||||
owner.SetSortIdx(this.sortIdx)
|
||||
this.accountIdHash[owner.GetAccountId()] = owner
|
||||
}
|
||||
|
||||
@ -78,7 +81,9 @@ func (this *team) OnPlayerOnline(hum common.Player) {
|
||||
}
|
||||
|
||||
func (this *team) Join(hum common.Player) bool {
|
||||
this.sortIdx++
|
||||
hum.SetTeam(this)
|
||||
hum.SetSortIdx(this.sortIdx)
|
||||
this.accountIdHash[hum.GetAccountId()] = hum
|
||||
return true
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user