From dfd2660a85e4f0891c63009ee8425b2796586409 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 6 Jan 2018 01:21:59 +0100 Subject: Core/Misc: Added compatibility layer for boost 1.66 and future std:: networking stuff * Based on work done by @dimiandre in PR #21173 Closes #21171 Closes #21173 --- src/server/scripts/Commands/cs_account.cpp | 4 ++-- src/server/scripts/Commands/cs_battlenet_account.cpp | 4 ++-- src/server/scripts/Commands/cs_misc.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 70886e948e1..e4bb6a4494b 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -25,13 +25,13 @@ EndScriptData */ #include "AccountMgr.h" #include "Chat.h" #include "DatabaseEnv.h" +#include "IpAddress.h" #include "Language.h" #include "Log.h" #include "Player.h" #include "ScriptMgr.h" #include "World.h" #include "WorldSession.h" -#include class account_commandscript : public CommandScript { @@ -291,7 +291,7 @@ public: if (param == "on") { PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGON_COUNTRY); - uint32 ip = boost::asio::ip::address_v4::from_string(handler->GetSession()->GetRemoteAddress()).to_ulong(); + uint32 ip = Trinity::Net::address_to_uint(Trinity::Net::make_address_v4(handler->GetSession()->GetRemoteAddress())); EndianConvertReverse(ip); stmt->setUInt32(0, ip); PreparedQueryResult result = LoginDatabase.Query(stmt); diff --git a/src/server/scripts/Commands/cs_battlenet_account.cpp b/src/server/scripts/Commands/cs_battlenet_account.cpp index da560ca3242..93713d23182 100644 --- a/src/server/scripts/Commands/cs_battlenet_account.cpp +++ b/src/server/scripts/Commands/cs_battlenet_account.cpp @@ -20,13 +20,13 @@ #include "BigNumber.h" #include "Chat.h" #include "DatabaseEnv.h" +#include "IpAddress.h" #include "Language.h" #include "Log.h" #include "Player.h" #include "ScriptMgr.h" #include "Util.h" #include "WorldSession.h" -#include class battlenet_account_commandscript : public CommandScript { @@ -144,7 +144,7 @@ public: if (param == "on") { PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGON_COUNTRY); - uint32 ip = boost::asio::ip::address_v4::from_string(handler->GetSession()->GetRemoteAddress()).to_ulong(); + uint32 ip = Trinity::Net::address_to_uint(Trinity::Net::make_address_v4(handler->GetSession()->GetRemoteAddress())); EndianConvertReverse(ip); stmt->setUInt32(0, ip); PreparedQueryResult result = LoginDatabase.Query(stmt); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 4f7d34d01ac..a14ddcf1be8 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -26,6 +26,7 @@ #include "Group.h" #include "GroupMgr.h" #include "InstanceSaveMgr.h" +#include "IpAddress.h" #include "Item.h" #include "Language.h" #include "LFG.h" @@ -50,7 +51,6 @@ #include "WeatherMgr.h" #include "World.h" #include "WorldSession.h" -#include // temporary hack until database includes are sorted out (don't want to pull in Windows.h everywhere from mysql.h) #ifdef GetClassName @@ -1781,7 +1781,7 @@ public: lastIp = fields[4].GetString(); lastLogin = fields[5].GetString(); - uint32 ip = boost::asio::ip::address_v4::from_string(lastIp).to_ulong();; + uint32 ip = Trinity::Net::address_to_uint(Trinity::Net::make_address_v4(lastIp)); EndianConvertReverse(ip); // If ip2nation table is populated, it displays the country -- cgit v1.2.3