using DiIiS_NA.LoginServer.AccountsSystem; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DiIiS_NA.GameServer.CommandManager { [AttributeUsage(AttributeTargets.Class)] public class CommandGroupAttribute : Attribute { /// /// Command group's name. /// public string Name { get; private set; } /// /// Help text for command group. /// public string Help { get; private set; } /// /// Minimum user level required to invoke the command. /// public Account.UserLevels MinUserLevel { get; private set; } /// /// For InGame commands only. If true, the command will be available only in the game. /// public bool InGameOnly { get; } public CommandGroupAttribute(string name, string help, Account.UserLevels minUserLevel = Account.UserLevels.Admin, bool inGameOnly = false) { Name = name.ToLower(); Help = help; MinUserLevel = minUserLevel; InGameOnly = inGameOnly; } } [AttributeUsage(AttributeTargets.Method)] public class CommandAttribute : Attribute { /// /// Command's name. /// public string Name { get; private set; } /// /// Help text for command. /// public string Help { get; private set; } /// /// Minimum user level required to invoke the command. /// public Account.UserLevels MinUserLevel { get; } /// /// Whether the command is only for in-game command. /// public bool InGameOnly { get; } public CommandAttribute(string command, string help, Account.UserLevels minUserLevel = Account.UserLevels.User, bool inGameOnly = false) { Name = command.ToLower(); Help = help; MinUserLevel = minUserLevel; InGameOnly = inGameOnly; } } [AttributeUsage(AttributeTargets.Method)] public class DefaultCommand : CommandAttribute { public DefaultCommand(Account.UserLevels minUserLevel = Account.UserLevels.User, bool inGameOnly = false) : base("", "", minUserLevel, inGameOnly) { } } }