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 GetAvatarUrl() string
GetHeroId() int32 GetHeroId() int32
GetPing() int32 GetPing() int32
SendMsg(rspMsg proto.Message) GetTeamUuid() string
SendMsg(proto.Message)
} }
type PlayerMgr interface { type PlayerMgr interface {

View File

@ -62,3 +62,7 @@ func (this *player) GetHeroId() int32 {
func (this *player) GetPing() int32 { func (this *player) GetPing() int32 {
return this.ping 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{ this.members = map[string]*member{
owner.GetAccountId(): this.owner, owner.GetAccountId(): this.owner,
} }
this.teams = map[string]*team {
"": newTeam(""),
}
this.owner.hum.SetRoom(this) this.owner.hum.SetRoom(this)
} }

View File

@ -3,20 +3,24 @@ package room
import ( import (
"q5" "q5"
//"f5" //"f5"
"cs" //"cs"
"main/common" //"main/common"
//"github.com/golang/protobuf/proto" //"github.com/golang/protobuf/proto"
) )
type team struct { type team struct {
joinTime int64 teamUuid string
state int32 members q5.ListHead
entry q5.ListHead
hum common.Player
} }
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
} }