From 78a50fdeef7c30e85366531668d199572b0a4687 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 13 Mar 2024 19:34:05 +0800 Subject: [PATCH] 1 --- server/matchserver/common/types.go | 7 ++++++ server/matchserver/player/player.go | 5 +++- server/matchserver/team/team.go | 36 +++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/server/matchserver/common/types.go b/server/matchserver/common/types.go index 7de414bc..cc7e126c 100644 --- a/server/matchserver/common/types.go +++ b/server/matchserver/common/types.go @@ -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 { diff --git a/server/matchserver/player/player.go b/server/matchserver/player/player.go index 7bc4832f..37eafd22 100644 --- a/server/matchserver/player/player.go +++ b/server/matchserver/player/player.go @@ -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) diff --git a/server/matchserver/team/team.go b/server/matchserver/team/team.go index 336cfade..8ebaa042 100644 --- a/server/matchserver/team/team.go +++ b/server/matchserver/team/team.go @@ -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"`