Merge pull request #18 from SoulSeekkor/master

Fixed compiler deprecation warnings
This commit is contained in:
Stefano Borzì 2022-04-09 20:28:24 +02:00 committed by GitHub
commit 967fbbdb9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,7 +75,7 @@ public:
void OnLogin(Player* player) void OnLogin(Player* player)
{ {
// Announce Module // Announce Module
if (sConfigMgr->GetBoolDefault("Congrats.Announce", true)) if (sConfigMgr->GetOption<bool>("Congrats.Announce", true))
{ {
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00CongratsOnLevel |rmodule."); ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00CongratsOnLevel |rmodule.");
} }
@ -92,7 +92,7 @@ public:
void OnLevelChanged(Player* player, uint8 oldLevel) override void OnLevelChanged(Player* player, uint8 oldLevel) override
{ {
// If enabled... // If enabled...
if (sConfigMgr->GetBoolDefault("Congrats.Enable", true)) { if (sConfigMgr->GetOption<bool>("Congrats.Enable", true)) {
std::string level; std::string level;
uint32 money, item1, item2, spell; uint32 money, item1, item2, spell;
@ -100,10 +100,10 @@ public:
if (oldLevel < 10 && player->getLevel() == 10) if (oldLevel < 10 && player->getLevel() == 10)
{ {
// Level 10 // Level 10
const uint32 L101 = sConfigMgr->GetIntDefault("Congrats.L101", 0); const uint32 L101 = sConfigMgr->GetOption<uint32>("Congrats.L101", 0);
const uint32 L102 = sConfigMgr->GetIntDefault("Congrats.L102", 0); const uint32 L102 = sConfigMgr->GetOption<uint32>("Congrats.L102", 0);
const uint32 L10M = sConfigMgr->GetIntDefault("Congrats.L10M", 0); const uint32 L10M = sConfigMgr->GetOption<uint32>("Congrats.L10M", 0);
const uint32 L10S = sConfigMgr->GetIntDefault("Congrats.L10S", 0); const uint32 L10S = sConfigMgr->GetOption<uint32>("Congrats.L10S", 0);
level = "10"; level = "10";
item1 = L101; item1 = L101;
@ -114,10 +114,10 @@ public:
else if (oldLevel < 20 && player->getLevel() == 20) else if (oldLevel < 20 && player->getLevel() == 20)
{ {
// Level 20 // Level 20
const uint32 L201 = sConfigMgr->GetIntDefault("Congrats.L201", 0); const uint32 L201 = sConfigMgr->GetOption<uint32>("Congrats.L201", 0);
const uint32 L202 = sConfigMgr->GetIntDefault("Congrats.L202", 0); const uint32 L202 = sConfigMgr->GetOption<uint32>("Congrats.L202", 0);
const uint32 L20M = sConfigMgr->GetIntDefault("Congrats.L20M", 0); const uint32 L20M = sConfigMgr->GetOption<uint32>("Congrats.L20M", 0);
const uint32 L20S = sConfigMgr->GetIntDefault("Congrats.L20S", 0); const uint32 L20S = sConfigMgr->GetOption<uint32>("Congrats.L20S", 0);
level = "20"; level = "20";
item1 = L201; item1 = L201;
@ -128,10 +128,10 @@ public:
else if (oldLevel < 30 && player->getLevel() == 30) else if (oldLevel < 30 && player->getLevel() == 30)
{ {
// Level 30 // Level 30
const uint32 L301 = sConfigMgr->GetIntDefault("Congrats.L301", 0); const uint32 L301 = sConfigMgr->GetOption<uint32>("Congrats.L301", 0);
const uint32 L302 = sConfigMgr->GetIntDefault("Congrats.L302", 0); const uint32 L302 = sConfigMgr->GetOption<uint32>("Congrats.L302", 0);
const uint32 L30M = sConfigMgr->GetIntDefault("Congrats.L30M", 0); const uint32 L30M = sConfigMgr->GetOption<uint32>("Congrats.L30M", 0);
const uint32 L30S = sConfigMgr->GetIntDefault("Congrats.L30S", 0); const uint32 L30S = sConfigMgr->GetOption<uint32>("Congrats.L30S", 0);
level = "30"; level = "30";
item1 = L301; item1 = L301;
@ -142,10 +142,10 @@ public:
else if (oldLevel < 40 && player->getLevel() == 40) else if (oldLevel < 40 && player->getLevel() == 40)
{ {
// Level 40 // Level 40
const uint32 L401 = sConfigMgr->GetIntDefault("Congrats.L401", 0); const uint32 L401 = sConfigMgr->GetOption<uint32>("Congrats.L401", 0);
const uint32 L402 = sConfigMgr->GetIntDefault("Congrats.L402", 0); const uint32 L402 = sConfigMgr->GetOption<uint32>("Congrats.L402", 0);
const uint32 L40M = sConfigMgr->GetIntDefault("Congrats.L40M", 0); const uint32 L40M = sConfigMgr->GetOption<uint32>("Congrats.L40M", 0);
const uint32 L40S = sConfigMgr->GetIntDefault("Congrats.L40S", 0); const uint32 L40S = sConfigMgr->GetOption<uint32>("Congrats.L40S", 0);
level = "40"; level = "40";
item1 = L401; item1 = L401;
@ -156,10 +156,10 @@ public:
else if (oldLevel < 50 && player->getLevel() == 50) else if (oldLevel < 50 && player->getLevel() == 50)
{ {
// Level 50 // Level 50
const uint32 L501 = sConfigMgr->GetIntDefault("Congrats.L501", 0); const uint32 L501 = sConfigMgr->GetOption<uint32>("Congrats.L501", 0);
const uint32 L502 = sConfigMgr->GetIntDefault("Congrats.L502", 0); const uint32 L502 = sConfigMgr->GetOption<uint32>("Congrats.L502", 0);
const uint32 L50M = sConfigMgr->GetIntDefault("Congrats.L50M", 0); const uint32 L50M = sConfigMgr->GetOption<uint32>("Congrats.L50M", 0);
const uint32 L50S = sConfigMgr->GetIntDefault("Congrats.L50S", 0); const uint32 L50S = sConfigMgr->GetOption<uint32>("Congrats.L50S", 0);
level = "50"; level = "50";
item1 = L501; item1 = L501;
@ -170,10 +170,10 @@ public:
else if (oldLevel < 60 && player->getLevel() == 60) else if (oldLevel < 60 && player->getLevel() == 60)
{ {
// Level 60 // Level 60
const uint32 L601 = sConfigMgr->GetIntDefault("Congrats.L601", 0); const uint32 L601 = sConfigMgr->GetOption<uint32>("Congrats.L601", 0);
const uint32 L602 = sConfigMgr->GetIntDefault("Congrats.L602", 0); const uint32 L602 = sConfigMgr->GetOption<uint32>("Congrats.L602", 0);
const uint32 L60M = sConfigMgr->GetIntDefault("Congrats.L60M", 0); const uint32 L60M = sConfigMgr->GetOption<uint32>("Congrats.L60M", 0);
const uint32 L60S = sConfigMgr->GetIntDefault("Congrats.L60S", 0); const uint32 L60S = sConfigMgr->GetOption<uint32>("Congrats.L60S", 0);
level = "60"; level = "60";
item1 = L601; item1 = L601;
@ -184,10 +184,10 @@ public:
else if (oldLevel < 70 && player->getLevel() == 70) else if (oldLevel < 70 && player->getLevel() == 70)
{ {
// Level 70 // Level 70
const uint32 L701 = sConfigMgr->GetIntDefault("Congrats.L701", 0); const uint32 L701 = sConfigMgr->GetOption<uint32>("Congrats.L701", 0);
const uint32 L702 = sConfigMgr->GetIntDefault("Congrats.L702", 0); const uint32 L702 = sConfigMgr->GetOption<uint32>("Congrats.L702", 0);
const uint32 L70M = sConfigMgr->GetIntDefault("Congrats.L70M", 0); const uint32 L70M = sConfigMgr->GetOption<uint32>("Congrats.L70M", 0);
const uint32 L70S = sConfigMgr->GetIntDefault("Congrats.L70S", 0); const uint32 L70S = sConfigMgr->GetOption<uint32>("Congrats.L70S", 0);
level = "70"; level = "70";
item1 = L701; item1 = L701;
@ -198,10 +198,10 @@ public:
else if (oldLevel < 80 && player->getLevel() == 80) else if (oldLevel < 80 && player->getLevel() == 80)
{ {
// Level 80 // Level 80
const uint32 L801 = sConfigMgr->GetIntDefault("Congrats.L801", 0); const uint32 L801 = sConfigMgr->GetOption<uint32>("Congrats.L801", 0);
const uint32 L802 = sConfigMgr->GetIntDefault("Congrats.L802", 0); const uint32 L802 = sConfigMgr->GetOption<uint32>("Congrats.L802", 0);
const uint32 L80M = sConfigMgr->GetIntDefault("Congrats.L80M", 0); const uint32 L80M = sConfigMgr->GetOption<uint32>("Congrats.L80M", 0);
const uint32 L80S = sConfigMgr->GetIntDefault("Congrats.L80S", 0); const uint32 L80S = sConfigMgr->GetOption<uint32>("Congrats.L80S", 0);
level = "80"; level = "80";
item1 = L801; item1 = L801;
@ -211,7 +211,7 @@ public:
} }
// If enabled... // If enabled...
if (sConfigMgr->GetBoolDefault("CongratsPerLevel.Enable", true)) if (sConfigMgr->GetOption<bool>("CongratsPerLevel.Enable", true))
{ {
// Issue a server notification for the player on level up. // Issue a server notification for the player on level up.
std::ostringstream ss; std::ostringstream ss;