1
This commit is contained in:
parent
a8939e79c8
commit
78a50fdeef
@ -45,6 +45,13 @@ type Team interface {
|
|||||||
Started() bool
|
Started() bool
|
||||||
CanStartGame(Player) bool
|
CanStartGame(Player) bool
|
||||||
StartGame()
|
StartGame()
|
||||||
|
|
||||||
|
Leave(Player)
|
||||||
|
Disband()
|
||||||
|
KickOut(Player)
|
||||||
|
HandoverLeader(Player, string)
|
||||||
|
CancelMatch()
|
||||||
|
SetReady(Player)
|
||||||
}
|
}
|
||||||
|
|
||||||
type TeamMgr interface {
|
type TeamMgr interface {
|
||||||
|
@ -153,7 +153,10 @@ func (this *player) FillMFTeamMember(member_pb *cs.MFTeamMember) {
|
|||||||
|
|
||||||
func (this *player) CMLeaveTeam(hdr *f5.MsgHdr, msg *cs.CMLeaveTeam) {
|
func (this *player) CMLeaveTeam(hdr *f5.MsgHdr, msg *cs.CMLeaveTeam) {
|
||||||
rspMsg := &cs.SMLeaveTeam{}
|
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)
|
this.SendMsg(rspMsg)
|
||||||
|
@ -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() {
|
func (this *team) genStartGameInfo() {
|
||||||
startInfo := struct {
|
startInfo := struct {
|
||||||
ZoneId int32 `json:"zone_id"`
|
ZoneId int32 `json:"zone_id"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user