This commit is contained in:
aozhiwei 2024-04-18 16:37:27 +08:00
parent 0ad350f224
commit a7603610e5
2 changed files with 10 additions and 4 deletions

View File

@ -34,7 +34,7 @@ type LoginRsp struct {
}
type MapInfoRsp struct {
ModeId int32 `json:"mode_id"`
ModeId interface{} `json:"mode_id"`
MapId int32 `json:"map_id"`
IsMoba int32 `json:"is_moba"`
IsOpen int32 `json:"is_open"`

View File

@ -358,7 +358,7 @@ func (this *team) genStartGameInfo() {
} {
ZoneId: this.GetZoneId(),
NodeId: this.GetNodeId(),
ModeId: this.mapInfo.ModeId,
ModeId: q5.ToInt32(this.getModeId()),
MapId: this.mapInfo.MapId,
RoomUuid: q5.ToString(this.getMainTeam().GetTeamUuid()),
StartTime: int32(this.startTime),
@ -511,7 +511,7 @@ func (this *team) SendUpdateNotify() {
notifyMsg := &cs.SMTeamUpdateNotify{}
notifyMsg.TeamInfo = &cs.MFTeam{}
notifyMsg.TeamInfo.TeamUuid = proto.String(this.teamUuid)
notifyMsg.TeamInfo.ModeId = proto.Int32(this.mapInfo.ModeId)
notifyMsg.TeamInfo.ModeId = proto.Int32(this.getModeId())
notifyMsg.TeamInfo.MapId = proto.Int32(this.mapInfo.MapId)
q5.NewSlice(&notifyMsg.TeamInfo.Members, 0, 1)
for _, m := range this.memberIdHash {
@ -530,7 +530,7 @@ func (this *team) canMatch(targetT *team) bool {
if this == targetT {
return false
}
if this.mapInfo.ModeId != targetT.mapInfo.ModeId {
if this.getModeId() != targetT.getModeId() {
return false
}
if this.mapInfo.MapId != targetT.mapInfo.MapId {
@ -547,6 +547,12 @@ func (this *team) canMatch(targetT *team) bool {
return true
}
func (this *team) getModeId() int32 {
var modeId int32
q5.DuckToSimple(this.mapInfo.ModeId, &modeId)
return modeId
}
func newTeam() *team {
t := new(team)
t.state = constant.TEAM_STATE_INIT