Beispiel #1
0
 private void Awake()
 {
     StartCoroutine(OnGameWasOpened());
     DontDestroyOnLoad(this);
     Background              = new Background();
     MainMenu                = new UI.PanelMain();
     Pause                   = new PausePanel();
     PauseWindow             = new PauseWindow();
     ProfilePanel            = new ProfilePanel();
     SinglePanel             = new SinglePanel();
     ServerList              = new ServerListPanel();
     SettingsPanel           = new SettingsPanel();
     DebugPanel              = new DebugPanel();
     CharacterSelectionPanel = new CharacterSelectionPanel();
     Chat = new Chat();
     Log  = new Log();
     DontDestroyOnLoad(new GameObject("DiscordManager").AddComponent <Network.Discord.DiscordManager>());
     DestroyMainScene();
     GameModes.ResetOnLoad();
     //Antis.Spam.EventsCounter.OnEventsSpamDetected += (sender, args) =>
     //{
     //    if(args.SpammedObject == 200 || args.SpammedObject == 253 && args.Count < 130)
     //    {
     //        return;
     //    }
     //    PhotonPlayer player = PhotonPlayer.Find(args.Sender);
     //    if (player.RCIgnored)
     //    {
     //        return;
     //    }
     //    Log.AddLine("eventSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString());
     //};
     //Antis.Spam.RPCCounter.OnRPCSpamDetected += (sender, args) =>
     //{
     //    if(args.SpammedObject == "netPauseAnimation" || args.SpammedObject == "netCrossFade" && args.Count < 75)
     //    {
     //        return;
     //    }
     //    PhotonPlayer player = PhotonPlayer.Find(args.Sender);
     //    if (player.RCIgnored)
     //    {
     //        return;
     //    }
     //    Log.AddLine("rpcSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString());
     //};
     //Antis.Spam.InstantiateCounter.OnInstantiateSpamDetected += (sender, args) =>
     //{
     //    if (args.SpammedObject.Contains("TITAN") && args.Count <= 50)
     //    {
     //        return;
     //    }
     //    PhotonPlayer player = PhotonPlayer.Find(args.Sender);
     //    if (player.RCIgnored)
     //    {
     //        return;
     //    }
     //    Log.AddLine("instantiateSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString());
     //};
     Network.BanList.Load();
 }
Beispiel #2
0
 private void OnLevelWasLoaded(int id)
 {
     if (Application.loadedLevelName == "menu")
     {
         if (!Background.Active)
         {
             Background.Enable();
         }
         if (Chat != null && Chat.Active)
         {
             Chat.Disable();
             Chat.Clear();
         }
         if (Log != null && Log.Active)
         {
             Log.Disable();
             Log.Clear();
         }
         DestroyMainScene();
         GameModes.ResetOnLoad();
         Network.BanList.Save();
         Anarchy.Skins.Humans.HumanSkin.Storage.Clear();
     }
     else
     {
         if (Background.Active)
         {
             Background.Disable();
         }
         if (Application.loadedLevelName != "characterCreation" && Application.loadedLevelName != "SnapShot" && PhotonNetwork.inRoom)
         {
             if (Chat != null && !Chat.Active)
             {
                 Chat.Enable();
             }
             if (Log != null && !Log.Active)
             {
                 Log.Enable();
             }
         }
     }
     if (Pause != null)
     {
         Pause.Continue();
     }
     Settings.Apply();
     VideoSettings.Apply();
     if (PauseWindow.Active)
     {
         PauseWindow.DisableImmediate();
     }
 }
Beispiel #3
0
 private void Awake()
 {
     StartCoroutine(OnGameWasOpened());
     DontDestroyOnLoad(this);
     Feed                    = new GameFeed();
     Background              = new Background();
     MainMenu                = new UI.PanelMain();
     Pause                   = new PausePanel();
     PauseWindow             = new PauseWindow();
     ProfilePanel            = new ProfilePanel();
     SinglePanel             = new SinglePanel();
     ServerList              = new ServerListPanel();
     SettingsPanel           = new SettingsPanel();
     DebugPanel              = new DebugPanel();
     CharacterSelectionPanel = new CharacterSelectionPanel();
     Chat                    = new Chat();
     Log         = new Log();
     ChatHistory = new ChatHistoryPanel();
     StatsPanel  = new SingleStatsPanel();
     DontDestroyOnLoad(new GameObject("DiscordManager").AddComponent <Network.Discord.DiscordSDK>());
     DestroyMainScene();
     GameModes.ResetOnLoad();
     //Antis.Spam.EventsCounter.OnEventsSpamDetected += (sender, args) =>
     //{
     //    if (args.SpammedObject == 200 || args.SpammedObject == 253 && args.Count < 130)
     //    {
     //        return;
     //    }
     //    PhotonPlayer player = PhotonPlayer.Find(args.Sender);
     //    if (player.RCIgnored)
     //    {
     //        return;
     //    }
     //    Log.AddLine("eventSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString());
     //};
     //Antis.Spam.RPCCounter.OnRPCSpamDetected += (sender, args) =>
     //{
     //    if (args.SpammedObject == "netPauseAnimation" || args.SpammedObject == "netCrossFade" && args.Count < 75)
     //    {
     //        return;
     //    }
     //    PhotonPlayer player = PhotonPlayer.Find(args.Sender);
     //    if (player.RCIgnored)
     //    {
     //        return;
     //    }
     //    Log.AddLine("rpcSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString());
     //};
     //Antis.Spam.InstantiateCounter.OnInstantiateSpamDetected += (sender, args) =>
     //{
     //    if (args.SpammedObject.Contains("TITAN") && args.Count <= 50)
     //    {
     //        return;
     //    }
     //    PhotonPlayer player = PhotonPlayer.Find(args.Sender);
     //    if (player.RCIgnored)
     //    {
     //        return;
     //    }
     //    Log.AddLine("instantiateSpam", args.SpammedObject.ToString(), args.Sender.ToString(), args.Count.ToString());
     //};
     //Antis.AntisManager.ResponseAction += (id, ban, reason) =>
     //{
     //    var player = PhotonPlayer.Find(id);
     //    if(player == null)
     //    {
     //        return;
     //    }
     //    Network.Antis.Kick(player, ban, reason);
     //};
     Network.BanList.Load();
     Antis.AntisManager.ResponseAction     += (a, b, c) => { Network.Antis.Kick(PhotonPlayer.Find(a), b, c); };
     Antis.AntisManager.OnResponseCallback += (id, banned, reason) =>
     {
         Log.AddLineRaw($"Player [{id}] has been {(banned ? "banned" : "kicked")}. " +
                        $"{(reason == "" ? "" : $"reason: {reason}")}");
     };
 }
Beispiel #4
0
        private void OnLevelWasLoaded(int id)
        {
            if (Application.loadedLevelName == "menu")
            {
                if (!Background.IsActive)
                {
                    Background.Enable();
                }

                if (Chat != null && Chat.IsActive)
                {
                    Chat.Disable();
                    Chat.Clear();
                }

                if (Log != null && Log.IsActive)
                {
                    Log.Disable();
                    Log.Clear();
                }
                DestroyMainScene();
                GameModes.ResetOnLoad();
                Network.BanList.Save();
                Skins.Humans.HumanSkin.Storage.Clear();
            }
            else
            {
                if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
                {
                    SingleRunStats.Reset();
                }
                if (Background.IsActive)
                {
                    Background.Disable();
                }

                if (Application.loadedLevelName != "characterCreation" && Application.loadedLevelName != "SnapShot" &&
                    PhotonNetwork.inRoom)
                {
                    if (Chat != null && !Chat.IsActive)
                    {
                        Chat.Enable();
                    }

                    if (Log != null && !Log.IsActive)
                    {
                        Log.Enable();
                    }
                }
            }

            PhotonNetwork.player.SetCustomProperties(new ExitGames.Client.Photon.Hashtable {
                { PhotonPlayerProperty.anarchyFlags, 0 }, { PhotonPlayerProperty.anarchyAbuseFlags, 0 }
            });
            PhotonNetwork.SetModProperties();

            Pause?.Continue();
            Settings.Apply();
            VideoSettings.Apply();
            if (PauseWindow.IsActive)
            {
                PauseWindow.DisableImmediate();
            }
            if (StatsPanel.IsActive)
            {
                StatsPanel.DisableImmediate();
            }
        }