feat(Core/Chat): new argument parsing and unify chat hyperlink parsing (#6243)

This commit is contained in:
Kargatum
2021-10-23 15:15:42 +07:00
committed by GitHub
parent 1101f9dd2a
commit bc9473482e
90 changed files with 4280 additions and 2508 deletions

View File

@@ -39,36 +39,42 @@ enum BanMode
BAN_IP
};
#if AC_COMPILER == AC_COMPILER_GNU
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
using namespace Acore::ChatCommands;
class ban_commandscript : public CommandScript
{
public:
ban_commandscript() : CommandScript("ban_commandscript") { }
std::vector<ChatCommand> GetCommands() const override
ChatCommandTable GetCommands() const override
{
static std::vector<ChatCommand> unbanCommandTable =
static ChatCommandTable unbanCommandTable =
{
{ "account", SEC_GAMEMASTER, true, &HandleUnBanAccountCommand, "" },
{ "character", SEC_GAMEMASTER, true, &HandleUnBanCharacterCommand, "" },
{ "playeraccount", SEC_GAMEMASTER, true, &HandleUnBanAccountByCharCommand, "" },
{ "ip", SEC_GAMEMASTER, true, &HandleUnBanIPCommand, "" }
{ "account", SEC_ADMINISTRATOR, true, &HandleUnBanAccountCommand, "" },
{ "character", SEC_ADMINISTRATOR, true, &HandleUnBanCharacterCommand, "" },
{ "playeraccount", SEC_ADMINISTRATOR, true, &HandleUnBanAccountByCharCommand, "" },
{ "ip", SEC_ADMINISTRATOR, true, &HandleUnBanIPCommand, "" }
};
static std::vector<ChatCommand> banlistCommandTable =
static ChatCommandTable banlistCommandTable =
{
{ "account", SEC_GAMEMASTER, true, &HandleBanListAccountCommand, "" },
{ "character", SEC_GAMEMASTER, true, &HandleBanListCharacterCommand, "" },
{ "ip", SEC_GAMEMASTER, true, &HandleBanListIPCommand, "" }
};
static std::vector<ChatCommand> baninfoCommandTable =
static ChatCommandTable baninfoCommandTable =
{
{ "account", SEC_GAMEMASTER, true, &HandleBanInfoAccountCommand, "" },
{ "character", SEC_GAMEMASTER, true, &HandleBanInfoCharacterCommand, "" },
{ "ip", SEC_GAMEMASTER, true, &HandleBanInfoIPCommand, "" }
};
static std::vector<ChatCommand> banCommandTable =
static ChatCommandTable banCommandTable =
{
{ "account", SEC_GAMEMASTER, true, &HandleBanAccountCommand, "" },
{ "character", SEC_GAMEMASTER, true, &HandleBanCharacterCommand, "" },
@@ -76,12 +82,12 @@ public:
{ "ip", SEC_GAMEMASTER, true, &HandleBanIPCommand, "" }
};
static std::vector<ChatCommand> commandTable =
static ChatCommandTable commandTable =
{
{ "ban", SEC_GAMEMASTER, true, nullptr, "", banCommandTable },
{ "baninfo", SEC_GAMEMASTER, true, nullptr, "", baninfoCommandTable },
{ "banlist", SEC_GAMEMASTER, true, nullptr, "", banlistCommandTable },
{ "unban", SEC_GAMEMASTER, true, nullptr, "", unbanCommandTable }
{ "ban", SEC_GAMEMASTER, true, nullptr, "", banCommandTable },
{ "baninfo", SEC_GAMEMASTER, true, nullptr, "", baninfoCommandTable },
{ "banlist", SEC_GAMEMASTER, true, nullptr, "", banlistCommandTable },
{ "unban", SEC_ADMINISTRATOR, true, nullptr, "", unbanCommandTable }
};
return commandTable;