Beispiel #1
0
        private bool CheckForDeleteCheaterCommand(PlayerChatEventArgs args)
        {
            if (args.IsServerMessage || args.Text.IsNullOrTimmedEmpty())
            {
                return(false);
            }

            ServerCommand command = ServerCommand.Parse(args.Text);

            if (!command.Is(Command.DeleteCheater) || command.PartsWithoutMainCommand.Count == 0)
            {
                return(false);
            }

            string login = command.PartsWithoutMainCommand[0];

            if (!LoginHasRight(args.Login, true, Command.DeleteCheater))
            {
                return(true);
            }

            if (PlayerAdapter.RemoveAllStatsForLogin(login))
            {
                SendFormattedMessageToLogin(args.Login, Settings.CheaterDeletedMessage, "Login", login);

                DetermineLocalRecords();
                OnLocalRecordsDetermined(new List <RankEntry>(LocalRecords));
            }
            else
            {
                SendFormattedMessageToLogin(args.Login, Settings.CheaterDeletionFailedMessage, "Login", login);
            }

            return(true);
        }
Beispiel #2
0
        private void HandleCheater(string login, bool updateUI)
        {
            Context.RPCClient.Methods.BanAndBlackList(login, "Banned and blacklisted for cheating!", true);
            SendFormattedMessage(Settings.CheaterBannedMessage, "Login", login);
            PlayerAdapter.RemoveAllStatsForLogin(login);

            if (updateUI)
            {
                DetermineLocalRecords();
                OnLocalRecordsDetermined(new List <RankEntry>(LocalRecords));
            }
        }