// // Licensed under the MIT License. See LICENSE file in the project root for full license information. // namespace MUnique.OpenMU.GameLogic.PlugIns.ChatCommands; using System.Runtime.InteropServices; using MUnique.OpenMU.GameLogic.PlugIns.ChatCommands.Arguments; using MUnique.OpenMU.PlugIns; /// /// A chat command plugin which handles banacc commands. /// [Guid("EF869270-847E-48D5-9012-F5D111D9C8EB")] [PlugIn] [Display(Name = nameof(PlugInResources.BanAccChatCommandPlugIn_Name), Description = nameof(PlugInResources.BanAccChatCommandPlugIn_Description), ResourceType = typeof(PlugInResources))] [ChatCommandHelp(Command, typeof(BanAccChatCommandArgs), CharacterStatus.GameMaster)] public class BanAccChatCommandPlugIn : ChatCommandPlugInBase { private const string Command = "/banacc"; /// public override string Key => Command; /// public override CharacterStatus MinCharacterStatusRequirement => CharacterStatus.GameMaster; /// protected override async ValueTask DoHandleCommandAsync(Player gameMaster, BanAccChatCommandArgs arguments) { await this.ChangeAccountStateByLoginNameAsync(gameMaster, arguments.AccountName ?? string.Empty, AccountState.Banned).ConfigureAwait(false); await gameMaster.ShowLocalizedBlueMessageAsync(nameof(PlayerMessage.AccountHasBeenBanned), this.Key, arguments.AccountName).ConfigureAwait(false); } }