This commit is contained in:
aozhiwei 2023-09-11 18:59:49 +08:00
parent c5a6ac4777
commit 66b4e6bb1b
4 changed files with 21 additions and 9 deletions

View File

@ -26,7 +26,8 @@ type Player interface {
GetAvatarUrl() string
GetHeroId() int32
GetPing() int32
SendMsg(rspMsg proto.Message)
GetTeamUuid() string
SendMsg(proto.Message)
}
type PlayerMgr interface {

View File

@ -62,3 +62,7 @@ func (this *player) GetHeroId() int32 {
func (this *player) GetPing() int32 {
return this.ping
}
func (this *player) GetTeamUuid() string {
return ""
}

View File

@ -35,6 +35,9 @@ func (this *room) init(roomId string, roomIdx int64, owner common.Player, passwd
this.members = map[string]*member{
owner.GetAccountId(): this.owner,
}
this.teams = map[string]*team {
"": newTeam(""),
}
this.owner.hum.SetRoom(this)
}

View File

@ -3,20 +3,24 @@ package room
import (
"q5"
//"f5"
"cs"
"main/common"
//"cs"
//"main/common"
//"github.com/golang/protobuf/proto"
)
type team struct {
joinTime int64
state int32
entry q5.ListHead
hum common.Player
teamUuid string
members q5.ListHead
}
func (this team) init(hum common.Player) {
func (this *team) addMember(m *member) {
if this.teamUuid != m.hum.GetTeamUuid() {
panic("team.addMember team_uuid error")
}
}
func (this team) fillMFMember(pb *cs.MFMember) {
func newTeam(teamUuid string) *team {
t := new(team)
t.teamUuid = teamUuid
return t
}