1
This commit is contained in:
parent
c5a6ac4777
commit
66b4e6bb1b
@ -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 {
|
||||
|
@ -62,3 +62,7 @@ func (this *player) GetHeroId() int32 {
|
||||
func (this *player) GetPing() int32 {
|
||||
return this.ping
|
||||
}
|
||||
|
||||
func (this *player) GetTeamUuid() string {
|
||||
return ""
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user