chore(Core/Misc): Remove deprecated code (#19413)

* Config - Deprecated for 3 years
* ChatCommand - Deprecated for 2 years
* getLevel() - Deprecated for 2 years
* SendGlobalText - Deprecated for 8 years +
This commit is contained in:
Kitzunu
2024-07-20 07:41:01 +02:00
committed by GitHub
parent 5c09a3194e
commit 21f86d1c3c
13 changed files with 52 additions and 132 deletions

View File

@@ -248,19 +248,6 @@ namespace Acore::ChatCommands
ChatCommandBuilder(char const* name, std::vector<ChatCommandBuilder> const& subCommands)
: _name{ ASSERT_NOTNULL(name) }, _data{ std::in_place_type<SubCommandEntry>, subCommands } { }
[[deprecated("char const* parameters to command handlers are deprecated; convert this to a typed argument handler instead")]]
ChatCommandBuilder(char const* name, bool(&handler)(ChatHandler*, char const*), uint32 securityLevel, Acore::ChatCommands::Console allowConsole)
: ChatCommandBuilder(name, handler, AcoreStrings(), securityLevel, allowConsole) { }
template <typename TypedHandler>
[[deprecated("you are using the old-style command format; convert this to the new format ({ name, handler (not a pointer!), permission, Console::(Yes/No) })")]]
ChatCommandBuilder(char const* name, uint32 securityLevel, bool console, TypedHandler* handler, char const*)
: ChatCommandBuilder(name, *handler, AcoreStrings(), securityLevel, static_cast<Acore::ChatCommands::Console>(console)) { }
[[deprecated("you are using the old-style command format; convert this to the new format ({ name, subCommands })")]]
ChatCommandBuilder(char const* name, uint32, bool, std::nullptr_t, char const*, std::vector <ChatCommandBuilder> const& sub)
: ChatCommandBuilder(name, sub) { }
private:
std::string_view _name;
std::variant<InvokerEntry, SubCommandEntry> _data;

View File

@@ -451,7 +451,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
uint32 moneyRew = 0;
Player* player = _session->GetPlayer();
if (player && (player->getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)))
if (player && (player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || sScriptMgr->ShouldBeRewardedWithMoneyInsteadOfExp(player)))
{
moneyRew = quest->GetRewMoneyMaxLevel();
}

View File

@@ -1506,9 +1506,7 @@ public:
[[nodiscard]] bool IsTotem() const { return m_unitTypeMask & UNIT_MASK_TOTEM; }
[[nodiscard]] bool IsVehicle() const { return m_unitTypeMask & UNIT_MASK_VEHICLE; }
/// @deprecated Use GetLevel() instead!
[[nodiscard]] uint8 getLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); }
[[nodiscard]] uint8 GetLevel() const { return getLevel(); }
[[nodiscard]] uint8 GetLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); }
uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return GetLevel(); }
void SetLevel(uint8 lvl, bool showLevelChange = true);
[[nodiscard]] uint8 getRace(bool original = false) const;

View File

@@ -567,7 +567,6 @@ public:
virtual void LoadConfigSettings(bool reload = false) = 0;
virtual void SendWorldText(uint32 string_id, ...) = 0;
virtual void SendWorldTextOptional(uint32 string_id, uint32 flag, ...) = 0;
virtual void SendGlobalText(const char* text, WorldSession* self) = 0;
virtual void SendGMText(uint32 string_id, ...) = 0;
virtual void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) = 0;
virtual void SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) = 0;

View File

@@ -2649,24 +2649,6 @@ void World::SendGMText(uint32 string_id, ...)
va_end(ap);
}
/// @deprecated only for debug purpose. Send a System Message to all players (except self if mentioned)
void World::SendGlobalText(const char* text, WorldSession* self)
{
WorldPacket data;
// need copy to prevent corruption by strtok call in LineFromMessage original string
char* buf = strdup(text);
char* pos = buf;
while (char* line = ChatHandler::LineFromMessage(pos))
{
ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
SendGlobalMessage(&data, self);
}
free(buf);
}
/// Send a packet to all players (or players selected team) in the zone (except self if mentioned)
bool World::SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self, TeamId teamId)
{

View File

@@ -239,7 +239,6 @@ public:
void LoadConfigSettings(bool reload = false) override;
void SendWorldText(uint32 string_id, ...) override;
void SendGlobalText(const char* text, WorldSession* self) override;
void SendGMText(uint32 string_id, ...) override;
void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) override;
void SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) override;

View File

@@ -52,46 +52,46 @@ public:
{
static ChatCommandTable accountSetCommandTable =
{
{ "addon", SEC_GAMEMASTER, true, &HandleAccountSetAddonCommand, "" },
{ "gmlevel", SEC_CONSOLE, true, &HandleAccountSetGmLevelCommand, "" },
{ "password", SEC_CONSOLE, true, &HandleAccountSetPasswordCommand, "" },
{ "2fa", SEC_PLAYER, true, &HandleAccountSet2FACommand, "" }
{ "addon", HandleAccountSetAddonCommand, SEC_GAMEMASTER, Console::Yes },
{ "gmlevel", HandleAccountSetGmLevelCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "password", HandleAccountSetPasswordCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "2fa", HandleAccountSet2FACommand, SEC_PLAYER, Console::Yes }
};
static ChatCommandTable accountLockCommandTable
{
{ "country", SEC_PLAYER, true, &HandleAccountLockCountryCommand, "" },
{ "ip", SEC_PLAYER, true, &HandleAccountLockIpCommand, "" }
{ "country", HandleAccountLockCountryCommand, SEC_PLAYER, Console::Yes },
{ "ip", HandleAccountLockIpCommand, SEC_PLAYER, Console::Yes }
};
static ChatCommandTable account2faCommandTable
{
{ "setup", SEC_PLAYER, false, &HandleAccount2FASetupCommand, "" },
{ "remove", SEC_PLAYER, false, &HandleAccount2FARemoveCommand, "" },
{ "setup", HandleAccount2FASetupCommand, SEC_PLAYER, Console::No },
{ "remove", HandleAccount2FARemoveCommand, SEC_PLAYER, Console::No }
};
static ChatCommandTable accountRemoveCommandTable
{
{ "country", SEC_ADMINISTRATOR, true, &HandleAccountRemoveLockCountryCommand, "" }
{ "country", HandleAccountRemoveLockCountryCommand, SEC_ADMINISTRATOR, Console::Yes },
};
static ChatCommandTable accountCommandTable =
{
{ "2fa", SEC_PLAYER, true, nullptr, "", account2faCommandTable },
{ "addon", SEC_MODERATOR, false, &HandleAccountAddonCommand, "" },
{ "create", SEC_CONSOLE, true, &HandleAccountCreateCommand, "" },
{ "delete", SEC_CONSOLE, true, &HandleAccountDeleteCommand, "" },
{ "onlinelist", SEC_CONSOLE, true, &HandleAccountOnlineListCommand, "" },
{ "lock", SEC_PLAYER, false, nullptr, "", accountLockCommandTable },
{ "set", SEC_ADMINISTRATOR, true, nullptr, "", accountSetCommandTable },
{ "password", SEC_PLAYER, false, &HandleAccountPasswordCommand, "" },
{ "remove", SEC_ADMINISTRATOR, true, nullptr, "", accountRemoveCommandTable },
{ "", SEC_PLAYER, false, &HandleAccountCommand, "" }
{ "2fa", account2faCommandTable },
{ "addon", HandleAccountAddonCommand, SEC_MODERATOR, Console::No },
{ "create", HandleAccountCreateCommand, SEC_CONSOLE, Console::Yes },
{ "delete", HandleAccountDeleteCommand, SEC_CONSOLE, Console::Yes },
{ "onlinelist", HandleAccountOnlineListCommand, SEC_CONSOLE, Console::Yes },
{ "lock", accountLockCommandTable },
{ "set", accountSetCommandTable },
{ "password", HandleAccountPasswordCommand, SEC_PLAYER, Console::No },
{ "remove", accountRemoveCommandTable },
{ "", HandleAccountCommand, SEC_PLAYER, Console::No }
};
static ChatCommandTable commandTable =
{
{ "account", SEC_PLAYER, true, nullptr, "", accountCommandTable }
{ "account", accountCommandTable }
};
return commandTable;

View File

@@ -56,40 +56,40 @@ public:
{
static ChatCommandTable unbanCommandTable =
{
{ "account", SEC_ADMINISTRATOR, true, &HandleUnBanAccountCommand, "" },
{ "character", SEC_ADMINISTRATOR, true, &HandleUnBanCharacterCommand, "" },
{ "playeraccount", SEC_ADMINISTRATOR, true, &HandleUnBanAccountByCharCommand, "" },
{ "ip", SEC_ADMINISTRATOR, true, &HandleUnBanIPCommand, "" }
{ "account", HandleUnBanAccountCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "character", HandleUnBanCharacterCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "playeraccount", HandleUnBanAccountByCharCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "ip", HandleUnBanIPCommand, SEC_ADMINISTRATOR, Console::Yes }
};
static ChatCommandTable banlistCommandTable =
{
{ "account", SEC_GAMEMASTER, true, &HandleBanListAccountCommand, "" },
{ "character", SEC_GAMEMASTER, true, &HandleBanListCharacterCommand, "" },
{ "ip", SEC_GAMEMASTER, true, &HandleBanListIPCommand, "" }
{ "account", HandleBanListAccountCommand, SEC_GAMEMASTER, Console::Yes },
{ "character", HandleBanListCharacterCommand, SEC_GAMEMASTER, Console::Yes },
{ "ip", HandleBanListIPCommand, SEC_GAMEMASTER, Console::Yes }
};
static ChatCommandTable baninfoCommandTable =
{
{ "account", SEC_GAMEMASTER, true, &HandleBanInfoAccountCommand, "" },
{ "character", SEC_GAMEMASTER, true, &HandleBanInfoCharacterCommand, "" },
{ "ip", SEC_GAMEMASTER, true, &HandleBanInfoIPCommand, "" }
{ "account", HandleBanInfoAccountCommand, SEC_GAMEMASTER, Console::Yes },
{ "character", HandleBanInfoCharacterCommand, SEC_GAMEMASTER, Console::Yes },
{ "ip", HandleBanInfoIPCommand, SEC_GAMEMASTER, Console::Yes }
};
static ChatCommandTable banCommandTable =
{
{ "account", SEC_GAMEMASTER, true, &HandleBanAccountCommand, "" },
{ "character", SEC_GAMEMASTER, true, &HandleBanCharacterCommand, "" },
{ "playeraccount", SEC_GAMEMASTER, true, &HandleBanAccountByCharCommand, "" },
{ "ip", SEC_GAMEMASTER, true, &HandleBanIPCommand, "" }
{ "account", HandleBanAccountCommand, SEC_GAMEMASTER, Console::Yes },
{ "character", HandleBanCharacterCommand, SEC_GAMEMASTER, Console::Yes },
{ "playeraccount",HandleBanAccountByCharCommand, SEC_GAMEMASTER, Console::Yes },
{ "ip", HandleBanIPCommand, SEC_GAMEMASTER, Console::Yes }
};
static ChatCommandTable commandTable =
{
{ "ban", SEC_GAMEMASTER, true, nullptr, "", banCommandTable },
{ "baninfo", SEC_GAMEMASTER, true, nullptr, "", baninfoCommandTable },
{ "banlist", SEC_GAMEMASTER, true, nullptr, "", banlistCommandTable },
{ "unban", SEC_ADMINISTRATOR, true, nullptr, "", unbanCommandTable }
{ "ban", banCommandTable },
{ "baninfo", baninfoCommandTable },
{ "banlist", banlistCommandTable },
{ "unban", unbanCommandTable }
};
return commandTable;

View File

@@ -50,7 +50,7 @@ public:
static ChatCommandTable learnAllCommandTable =
{
{ "my", learnAllMyCommandTable },
{ "my", learnAllMyCommandTable },
{ "gm", HandleLearnAllGMCommand, SEC_GAMEMASTER, Console::No },
{ "crafts", HandleLearnAllCraftsCommand, SEC_GAMEMASTER, Console::No },
{ "default", HandleLearnAllDefaultCommand, SEC_GAMEMASTER, Console::No },
@@ -60,14 +60,14 @@ public:
static ChatCommandTable learnCommandTable =
{
{ "all", learnAllCommandTable },
{ "all", learnAllCommandTable },
{ "", HandleLearnCommand, SEC_GAMEMASTER, Console::No }
};
static ChatCommandTable commandTable =
{
{ "learn", learnCommandTable },
{ "unlearn", HandleUnLearnCommand, SEC_GAMEMASTER, Console::No }
{ "learn", learnCommandTable },
{ "unlearn", HandleUnLearnCommand, SEC_GAMEMASTER, Console::No }
};
return commandTable;
}

View File

@@ -42,17 +42,17 @@ public:
{
static ChatCommandTable wpCommandTable =
{
{ "add", SEC_ADMINISTRATOR, false, &HandleWpAddCommand, "" },
{ "event", SEC_ADMINISTRATOR, false, &HandleWpEventCommand, "" },
{ "load", SEC_ADMINISTRATOR, false, &HandleWpLoadCommand, "" },
{ "modify", SEC_ADMINISTRATOR, false, &HandleWpModifyCommand, "" },
{ "unload", SEC_ADMINISTRATOR, false, &HandleWpUnLoadCommand, "" },
{ "reload", SEC_ADMINISTRATOR, false, &HandleWpReloadCommand, "" },
{ "show", SEC_ADMINISTRATOR, false, &HandleWpShowCommand, "" }
{ "add", HandleWpAddCommand, SEC_ADMINISTRATOR, Console::No },
{ "event", HandleWpEventCommand, SEC_ADMINISTRATOR, Console::No },
{ "load", HandleWpLoadCommand, SEC_ADMINISTRATOR, Console::No },
{ "modify", HandleWpModifyCommand, SEC_ADMINISTRATOR, Console::No },
{ "unload", HandleWpUnLoadCommand, SEC_ADMINISTRATOR, Console::No },
{ "reload", HandleWpReloadCommand, SEC_ADMINISTRATOR, Console::No },
{ "show", HandleWpShowCommand, SEC_ADMINISTRATOR, Console::No }
};
static ChatCommandTable commandTable =
{
{ "wp", SEC_ADMINISTRATOR, false, nullptr, "", wpCommandTable }
{ "wp", wpCommandTable }
};
return commandTable;
}