コード例 #1
0
ファイル: AnarchyManager.cs プロジェクト: Lineyka/Anarchy
 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();
 }
コード例 #2
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}")}");
     };
 }