/// <summary> /// 收到释放战斗的消息,读取队伍信息修改队伍状态 /// </summary> /// <param name="releaseBattleToMatchTeamMessage"></param> private void OnReleaseBattle(ReleaseBattleToMatchTeamMessage releaseBattleToMatchTeamMessage) { Log.Info("匹配系统收到释放战斗的消息,修改各个队伍的状态 BattleId = " + releaseBattleToMatchTeamMessage.BattleId); foreach (var teamId in releaseBattleToMatchTeamMessage.Teams) { if (m_teamDic.TryGetValue(teamId, out var matchTeam)) { matchTeam.State = MatchTeam.MatchTeamState.OPEN; } } }
/// <summary> /// 以下要处理收到的消息 /// </summary> /// <param name="msg"></param> /// <returns></returns> public override Task OnMessage(ILocalMessage msg) { switch (msg.MessageId) { case GameServerConstDefine.MatchSystemCreateMatchTeam: CreateMatchTeamMessage createMatchTeamMessage = msg as CreateMatchTeamMessage; OnCreateMatchTeam(createMatchTeamMessage.playerId); break; case GameServerConstDefine.MatchSystemJoinMatchTeam: JoinMatchTeamMessage joinMatchTeamMessage = msg as JoinMatchTeamMessage; OnJoinMatchTeam(joinMatchTeamMessage.teamId, joinMatchTeamMessage.playerId); break; case GameServerConstDefine.MatchSystemExitMatchTeam: ExitMatchTeamMessage exitMatchTeamMessage = msg as ExitMatchTeamMessage; OnExitMatchTeam(exitMatchTeamMessage.teamId, exitMatchTeamMessage.playerId); break; case GameServerConstDefine.MatchSystemJoinMatchQueue: JoinMatchQueueMessage joinMatchQueueMessage = msg as JoinMatchQueueMessage; OnJoinMatchQueue(joinMatchQueueMessage.teamId, joinMatchQueueMessage.playerId, joinMatchQueueMessage.barrierId); break; case GameServerConstDefine.MatchSystemExitMatchQueue: ExitMatchQueueMessage exitMatchQueueMessage = msg as ExitMatchQueueMessage; OnExitMatchQueue(exitMatchQueueMessage.teamId, exitMatchQueueMessage.playerId); break; case GameServerConstDefine.MatchQueueCompleteSingle: //来自 MatcingSystemQueue 的消息,通知system匹配完成 MatchQueueCompleteSingleMessage matchQueueCompleteSingleMessage = msg as MatchQueueCompleteSingleMessage; OnCompleteMatching(matchQueueCompleteSingleMessage.teamIds, matchQueueCompleteSingleMessage.barrierId); break; case GameServerConstDefine.MatchSysteamMatchTeamUpdateInfo: MatchTeamUpdateInfoMessage matchTeamUpdateInfoMessage = msg as MatchTeamUpdateInfoMessage; OnUpdateMatchTeam(matchTeamUpdateInfoMessage.teamId); break; case GameServerConstDefine.MatchSystemPlayerShutdown: ToMatchPlayerShutdownMessage toMatchPlayerShutdownMessage = msg as ToMatchPlayerShutdownMessage; OnShutdownPlayer(toMatchPlayerShutdownMessage); break; case GameServerConstDefine.UpdateOnlinePlayerList: //更新客户端在线玩家状态 UpdateOnlinePlayerMessage updateOnlinePlayerMessage = msg as UpdateOnlinePlayerMessage; OnUpdateOnlinePlayerRpc(updateOnlinePlayerMessage); break; case GameServerConstDefine.ReleaseBattleToMatchTeam: ReleaseBattleToMatchTeamMessage releaseBattleToMatchTeamMessage = msg as ReleaseBattleToMatchTeamMessage; OnReleaseBattle(releaseBattleToMatchTeamMessage); break; default: break; } return(base.OnMessage(msg)); }