mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 21:56:22 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user