public override void ProcessInternalMessage(string msg) { ServerCommon.InternalMessage ret = null; #if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_IOS || UNITY_ANDROID #else ret = JsonConvert.DeserializeObject <ServerCommon.InternalMessage>(msg); #endif //Log.Information("ProcessInternalMessage {0}", msg); switch ((ServerCommon.InternalMessageType)ret.message_type) { case ServerCommon.InternalMessageType.Participant: { mPlayerAuth.Remove(ret.world_id); mPlayerAuth.Add(ret.world_id, ret); int player_count = ret.players.Where(x => x.Value.is_ai == false).Count(); Clear(ret.world_id); World.Instance(ret.world_id).Reset(true, NetworkManagerServer.sInstance); World.Instance(ret.world_id).GameMode.Init(ret.map_id, ret.match_id, player_count); World.Instance(ret.world_id).GameMode.game_mode.SetModeData(ret); mNewPlayerId[ret.world_id] = ret.players.Count + 1; foreach (var player in ret.players) { if (player.Value.is_ai == true) { AIController aiController = CreateAI(player.Value.character_type, player.Value.user_id, ret.world_id, new System.Guid(player.Key), player.Value.team, player.Value.player_id, player.Value.spawn_index, player.Value.character_level); // 게임 시작시 적당한 유저에게 할당 World.Instance(ret.world_id).GameMode.RegisterStartEvent(aiController.OnStart); } else { CreateActor(player.Value.character_type, player.Value.user_id, ret.world_id, new System.Guid(player.Key), player.Value.team, player.Value.player_id, player.Value.spawn_index, player.Value.character_level); } } } break; case ServerCommon.InternalMessageType.DebugCommand: { try { var actor = (SActor)World.Instance(ret.world_id).GetPlayer(ret.debug_command.ingame_player_id); if (actor == null) { Log.Error($"not found player {ret.debug_command.ingame_player_id}, world_id {ret.world_id}"); return; } Battle.DebugCommand.Execute(actor, ret.debug_command.cmd, ret.debug_command.param1, ret.debug_command.param2, ret.debug_command.param3, ret.debug_command.param4); } catch (Exception ex) { Log.Error(ex.ToString()); } } break; case ServerCommon.InternalMessageType.SuspendChannel: { #if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_IOS || UNITY_ANDROID #else Cache.sInstance.Suspend(); #endif Log.Information($"SuspendChannel"); } break; case ServerCommon.InternalMessageType.ResumeChannel: { #if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_IOS || UNITY_ANDROID #else Cache.sInstance.Resume(); #endif Log.Information($"ResumeChannel"); } break; } }