diff --git a/server/matchserver/common/types.go b/server/matchserver/common/types.go index 7936243d..1602d4ee 100644 --- a/server/matchserver/common/types.go +++ b/server/matchserver/common/types.go @@ -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"` diff --git a/server/matchserver/team/team.go b/server/matchserver/team/team.go index db0deef6..e73642a0 100644 --- a/server/matchserver/team/team.go +++ b/server/matchserver/team/team.go @@ -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(¬ifyMsg.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