1
This commit is contained in:
parent
ad2c59032f
commit
c3f615f8da
@ -2,6 +2,7 @@ package team
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"q5"
|
"q5"
|
||||||
|
"f5"
|
||||||
"cs"
|
"cs"
|
||||||
"main/common"
|
"main/common"
|
||||||
"main/constant"
|
"main/constant"
|
||||||
@ -19,6 +20,7 @@ type team struct {
|
|||||||
mapId int32
|
mapId int32
|
||||||
owner common.Player
|
owner common.Player
|
||||||
state int32
|
state int32
|
||||||
|
startTime int64
|
||||||
stateNotifyMsg *cs.SMTeamStateNotify
|
stateNotifyMsg *cs.SMTeamStateNotify
|
||||||
accountIdHash map[string]common.Player
|
accountIdHash map[string]common.Player
|
||||||
}
|
}
|
||||||
@ -105,7 +107,36 @@ func (this *team) CanStartGame(hum common.Player) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *team) StartGame() {
|
func (this *team) StartGame() {
|
||||||
|
if !this.Started() {
|
||||||
|
this.state = constant.TEAM_STATE_STARTED
|
||||||
|
this.startTime = f5.GetApp().GetNowSeconds()
|
||||||
|
startInfo := struct {
|
||||||
|
ZoneId int32 `json:"zone_id"`
|
||||||
|
NodeId int32 `json:"node_id"`
|
||||||
|
MapId int32 `json:"map"`
|
||||||
|
RoomUuid string `json:"room_uuid"`
|
||||||
|
StartTime int32 `json:"start_time"`
|
||||||
|
TeamList []struct {
|
||||||
|
TeamUuid string `json:"team_uuid"`
|
||||||
|
Members []struct {
|
||||||
|
AccountId string `json:"account_id"`
|
||||||
|
} `json:"members"`
|
||||||
|
} `json:"team_list"`
|
||||||
|
ObList []struct {
|
||||||
|
AccountId string `json:"account_id"`
|
||||||
|
} `json:"ob_list"`
|
||||||
|
} {
|
||||||
|
ZoneId: this.GetZoneId(),
|
||||||
|
NodeId: this.GetNodeId(),
|
||||||
|
MapId: this.mapId,
|
||||||
|
RoomUuid: q5.ToString(this.GetTeamUuid()),
|
||||||
|
StartTime: int32(this.startTime),
|
||||||
|
}
|
||||||
|
payload := q5.Md5Str(q5.EncodeJson(&startInfo) + "520d8eAbB(8cf1^#$^&!@d833a42c820432PDAFE^^)") + "|" +
|
||||||
|
q5.EncodeJson(&startInfo)
|
||||||
|
this.stateNotifyMsg.JoinMsg.TeamUuid = proto.String(this.GetTeamUuid())
|
||||||
|
this.stateNotifyMsg.JoinMsg.Payload = proto.String(payload)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *team) broadcastMsg(msg proto.Message) {
|
func (this *team) broadcastMsg(msg proto.Message) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user