This commit is contained in:
aozhiwei 2024-03-13 19:34:05 +08:00
parent a8939e79c8
commit 78a50fdeef
3 changed files with 47 additions and 1 deletions

View File

@ -45,6 +45,13 @@ type Team interface {
Started() bool
CanStartGame(Player) bool
StartGame()
Leave(Player)
Disband()
KickOut(Player)
HandoverLeader(Player, string)
CancelMatch()
SetReady(Player)
}
type TeamMgr interface {

View File

@ -153,7 +153,10 @@ func (this *player) FillMFTeamMember(member_pb *cs.MFTeamMember) {
func (this *player) CMLeaveTeam(hdr *f5.MsgHdr, msg *cs.CMLeaveTeam) {
rspMsg := &cs.SMLeaveTeam{}
if !this.GetTeam().Started() {
if this.GetTeam().Started() {
rspMsg.Errcode = proto.Int32(1)
rspMsg.Errmsg = proto.String("team already started")
} else {
}
this.SendMsg(rspMsg)

View File

@ -119,6 +119,42 @@ func (this *team) StartGame() {
}
}
func (this *team) Leave(common.Player) {
if !this.Started() {
}
}
func (this *team) Disband() {
if !this.Started() {
}
}
func (this *team) KickOut(common.Player) {
if !this.Started() {
}
}
func (this *team) HandoverLeader(common.Player, string) {
if !this.Started() {
}
}
func (this *team) CancelMatch() {
if !this.Started() {
}
}
func (this *team) SetReady(common.Player) {
if !this.Started() {
}
}
func (this *team) genStartGameInfo() {
startInfo := struct {
ZoneId int32 `json:"zone_id"`