diff options
| author | Shauren <shauren.trinity@gmail.com> | 2017-05-13 11:49:09 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2017-05-13 11:49:09 +0200 |
| commit | beb3316089b350a43e917d896e682298df8dcfc0 (patch) | |
| tree | 8006c52594009f226d834991d101c97057699594 /src/server/scripts/Commands | |
| parent | c00316d3d4b57826cc8e38feed24faf84832c04b (diff) | |
Core/Shared: Include cleanup
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_account.cpp | 3 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_battlenet_account.cpp | 3 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 3b6010d4283..5c8332beba8 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -28,6 +28,7 @@ EndScriptData */ #include "Log.h" #include "Player.h" #include "ScriptMgr.h" +#include <boost/asio/ip/address_v4.hpp> class account_commandscript : public CommandScript { @@ -287,7 +288,7 @@ public: if (param == "on") { PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGON_COUNTRY); - uint32 ip = inet_addr(handler->GetSession()->GetRemoteAddress().c_str()); + uint32 ip = boost::asio::ip::address_v4::from_string(handler->GetSession()->GetRemoteAddress()).to_ulong(); 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 64d4647e8bf..c62db6d774b 100644 --- a/src/server/scripts/Commands/cs_battlenet_account.cpp +++ b/src/server/scripts/Commands/cs_battlenet_account.cpp @@ -23,6 +23,7 @@ #include "Player.h" #include "ScriptMgr.h" #include "Util.h" +#include <boost/asio/ip/address_v4.hpp> class battlenet_account_commandscript : public CommandScript { @@ -140,7 +141,7 @@ public: if (param == "on") { PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGON_COUNTRY); - uint32 ip = inet_addr(handler->GetSession()->GetRemoteAddress().c_str()); + uint32 ip = boost::asio::ip::address_v4::from_string(handler->GetSession()->GetRemoteAddress()).to_ulong(); 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 678c7342eda..470119122fb 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -41,6 +41,7 @@ #include "MiscPackets.h" #include "Transport.h" #include "MapManager.h" +#include <boost/asio/ip/address_v4.hpp> // temporary hack until database includes are sorted out (don't want to pull in Windows.h everywhere from mysql.h) #ifdef GetClassName @@ -1774,7 +1775,7 @@ public: lastIp = fields[4].GetString(); lastLogin = fields[5].GetString(); - uint32 ip = inet_addr(lastIp.c_str()); + uint32 ip = boost::asio::ip::address_v4::from_string(lastIp).to_ulong();; EndianConvertReverse(ip); // If ip2nation table is populated, it displays the country |
