예제 #1
0
        public string Execute(
            [CustomSuggestions(nameof(GetClanTagSuggestions))]
            string clanTag)
        {
            var faction = FactionSystem.ServerGetFactionByClanTag(clanTag);

            var bannedCount = 0;

            foreach (var playerName in FactionSystem.ServerGetFactionMemberNames(faction))
            {
                var character = Server.Characters.GetPlayerCharacter(playerName);
                if (character == this.ExecutionContextCurrentCharacter)
                {
                    continue;
                }

                if (ServerPlayerAccessSystem.SetBlackListEntry(playerName, isEnabled: true))
                {
                    bannedCount++;
                }
            }

            if (bannedCount == 0)
            {
                return($"No need to add anyone from the faction [{clanTag}] to the blacklist (already added)");
            }

            return($"{bannedCount} player(s) of the faction [{clanTag}] were added to the blacklist");
        }
예제 #2
0
        public string Execute(
            [CustomSuggestions(nameof(GetCharacterNameSuggestions))]
            string playerName)
        {
            if (ServerPlayerAccessSystem.SetBlackListEntry(playerName, isEnabled: true))
            {
                return($"{playerName} added to the blacklist");
            }

            return($"{playerName} is already in the blacklist");
        }
        public string Execute(
            [CustomSuggestions(nameof(GetCharacterNameSuggestions))]
            string playerName)
        {
            if (ServerPlayerAccessSystem.SetBlackListEntry(playerName, isEnabled: false))
            {
                return($"{playerName} removed from the blacklist");
            }

            return($"{playerName} is not found in the blacklist");
        }