1
This commit is contained in:
parent
66b4e6bb1b
commit
9b47526bcc
@ -12,11 +12,13 @@ type member struct {
|
||||
joinTime int64
|
||||
state int32
|
||||
entry q5.ListHead
|
||||
teamEntry q5.ListHead
|
||||
hum common.Player
|
||||
}
|
||||
|
||||
func (this *member) init(hum common.Player) {
|
||||
this.entry.Init(this)
|
||||
this.teamEntry.Init(this)
|
||||
this.hum = hum
|
||||
this.joinTime = f5.GetApp().GetNowSeconds()
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ func (this *room) init(roomId string, roomIdx int64, owner common.Player, passwd
|
||||
owner.GetAccountId(): this.owner,
|
||||
}
|
||||
this.teams = map[string]*team {
|
||||
"": newTeam(""),
|
||||
owner.GetTeamUuid(): newTeam(this.owner),
|
||||
}
|
||||
this.owner.hum.SetRoom(this)
|
||||
}
|
||||
|
@ -17,10 +17,13 @@ func (this *team) addMember(m *member) {
|
||||
if this.teamUuid != m.hum.GetTeamUuid() {
|
||||
panic("team.addMember team_uuid error")
|
||||
}
|
||||
this.members.AddTail(&m.teamEntry)
|
||||
}
|
||||
|
||||
func newTeam(teamUuid string) *team {
|
||||
func newTeam(leader *member) *team {
|
||||
t := new(team)
|
||||
t.teamUuid = teamUuid
|
||||
t.members.Init(nil)
|
||||
t.teamUuid = leader.hum.GetTeamUuid()
|
||||
t.addMember(leader)
|
||||
return t
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user