This commit is contained in:
aozhiwei 2024-03-12 10:53:14 +08:00
parent 27bd9607df
commit 1cb3f33c45

View File

@ -3,6 +3,8 @@ package team
import ( import (
"cs" "cs"
"main/common" "main/common"
"github.com/golang/protobuf/proto"
) )
type team struct { type team struct {
@ -77,6 +79,17 @@ func (this *team) IsCopy() bool {
return this.isCopy return this.isCopy
} }
func (this *team) broadcastMsg(msg proto.Message) {
for _, m := range this.accountIdHash {
m.SendMsg(msg)
}
}
func (this *team) SendUpdateNotify() {
notifyMsg := &cs.SMTeamUpdateNotify{}
this.broadcastMsg(notifyMsg)
}
func newTeam() *team { func newTeam() *team {
t := new(team) t := new(team)
t.accountIdHash = map[string]common.Player{} t.accountIdHash = map[string]common.Player{}