From 71fe37a55b9d7e1170f19d58fe86b9de6ed2edc0 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Tue, 6 Jun 2017 11:29:00 +0200 Subject: [PATCH] build fix --- src/server/shared/Realm/Realm.cpp | 6 +++--- src/server/shared/Realm/Realm.h | 10 ++++------ src/server/shared/Realm/RealmList.cpp | 16 ++++++++-------- src/server/shared/Realm/RealmList.h | 6 ++---- src/server/worldserver/Main.cpp | 6 +++--- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/server/shared/Realm/Realm.cpp b/src/server/shared/Realm/Realm.cpp index d1f81e7ec8d..60d08964640 100644 --- a/src/server/shared/Realm/Realm.cpp +++ b/src/server/shared/Realm/Realm.cpp @@ -16,9 +16,9 @@ */ #include "Realm.h" -ip::tcp::endpoint Realm::GetAddressForClient(ip::address const& clientAddr) const +boost::asio::ip::tcp::endpoint Realm::GetAddressForClient(boost::asio::ip::address const& clientAddr) const { - ip::address realmIp; + boost::asio::ip::address realmIp; // Attempt to send best address for client if (clientAddr.is_loopback()) @@ -45,7 +45,7 @@ ip::tcp::endpoint Realm::GetAddressForClient(ip::address const& clientAddr) cons realmIp = ExternalAddress; } - ip::tcp::endpoint endpoint(realmIp, Port); + boost::asio::ip::tcp::endpoint endpoint(realmIp, Port); // Return external IP return endpoint; diff --git a/src/server/shared/Realm/Realm.h b/src/server/shared/Realm/Realm.h index 7b51e942d20..ecc8cd47c50 100644 --- a/src/server/shared/Realm/Realm.h +++ b/src/server/shared/Realm/Realm.h @@ -22,8 +22,6 @@ #include #include -using namespace boost::asio; - enum RealmFlags { REALM_FLAG_NONE = 0x00, @@ -82,9 +80,9 @@ struct TC_SHARED_API Realm { Battlenet::RealmHandle Id; uint32 Build; - ip::address ExternalAddress; - ip::address LocalAddress; - ip::address LocalSubnetMask; + boost::asio::ip::address ExternalAddress; + boost::asio::ip::address LocalAddress; + boost::asio::ip::address LocalSubnetMask; uint16 Port; std::string Name; uint8 Type; @@ -95,7 +93,7 @@ struct TC_SHARED_API Realm bool Updated; bool Keep; - ip::tcp::endpoint GetAddressForClient(ip::address const& clientAddr) const; + boost::asio::ip::tcp::endpoint GetAddressForClient(boost::asio::ip::address const& clientAddr) const; uint32 GetConfigId() const; static uint32 const ConfigIdByType[MAX_CLIENT_REALM_TYPE]; diff --git a/src/server/shared/Realm/RealmList.cpp b/src/server/shared/Realm/RealmList.cpp index 95ad6a5adaf..a69a30b3d69 100644 --- a/src/server/shared/Realm/RealmList.cpp +++ b/src/server/shared/Realm/RealmList.cpp @@ -51,8 +51,8 @@ void RealmList::Close() _updateTimer->cancel(); } -void RealmList::UpdateRealm(Battlenet::RealmHandle const& id, uint32 build, const std::string& name, ip::address const& address, ip::address const& localAddr, - ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, +void RealmList::UpdateRealm(Battlenet::RealmHandle const& id, uint32 build, const std::string& name, boost::asio::ip::address const& address, boost::asio::ip::address const& localAddr, + boost::asio::ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population) { // Create new if not exist or update existed @@ -100,7 +100,7 @@ void RealmList::UpdateRealms(boost::system::error_code const& error) Field* fields = result->Fetch(); uint32 realmId = fields[0].GetUInt32(); std::string name = fields[1].GetString(); - boost::asio::ip::tcp::resolver::query externalAddressQuery(ip::tcp::v4(), fields[2].GetString(), ""); + boost::asio::ip::tcp::resolver::query externalAddressQuery(boost::asio::ip::tcp::v4(), fields[2].GetString(), ""); boost::system::error_code ec; boost::asio::ip::tcp::resolver::iterator endPoint = _resolver->resolve(externalAddressQuery, ec); @@ -110,9 +110,9 @@ void RealmList::UpdateRealms(boost::system::error_code const& error) continue; } - ip::address externalAddress = (*endPoint).endpoint().address(); + boost::asio::ip::address externalAddress = (*endPoint).endpoint().address(); - boost::asio::ip::tcp::resolver::query localAddressQuery(ip::tcp::v4(), fields[3].GetString(), ""); + boost::asio::ip::tcp::resolver::query localAddressQuery(boost::asio::ip::tcp::v4(), fields[3].GetString(), ""); endPoint = _resolver->resolve(localAddressQuery, ec); if (endPoint == end || ec) { @@ -120,9 +120,9 @@ void RealmList::UpdateRealms(boost::system::error_code const& error) continue; } - ip::address localAddress = (*endPoint).endpoint().address(); + boost::asio::ip::address localAddress = (*endPoint).endpoint().address(); - boost::asio::ip::tcp::resolver::query localSubmaskQuery(ip::tcp::v4(), fields[4].GetString(), ""); + boost::asio::ip::tcp::resolver::query localSubmaskQuery(boost::asio::ip::tcp::v4(), fields[4].GetString(), ""); endPoint = _resolver->resolve(localSubmaskQuery, ec); if (endPoint == end || ec) { @@ -130,7 +130,7 @@ void RealmList::UpdateRealms(boost::system::error_code const& error) continue; } - ip::address localSubmask = (*endPoint).endpoint().address(); + boost::asio::ip::address localSubmask = (*endPoint).endpoint().address(); uint16 port = fields[5].GetUInt16(); uint8 icon = fields[6].GetUInt8(); diff --git a/src/server/shared/Realm/RealmList.h b/src/server/shared/Realm/RealmList.h index f521196d881..3fbb677d9b6 100644 --- a/src/server/shared/Realm/RealmList.h +++ b/src/server/shared/Realm/RealmList.h @@ -26,8 +26,6 @@ #include #include -using namespace boost::asio; - /// Storage object for the list of realms on the server class TC_SHARED_API RealmList { @@ -48,8 +46,8 @@ private: RealmList(); void UpdateRealms(boost::system::error_code const& error); - void UpdateRealm(Battlenet::RealmHandle const& id, uint32 build, const std::string& name, ip::address const& address, ip::address const& localAddr, - ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population); + void UpdateRealm(Battlenet::RealmHandle const& id, uint32 build, const std::string& name, boost::asio::ip::address const& address, boost::asio::ip::address const& localAddr, + boost::asio::ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population); RealmMap _realms; uint32 _updateInterval; diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index a45b09a1dee..34f8171e5af 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -483,7 +483,7 @@ bool LoadRealmInfo() Field* fields = result->Fetch(); realm.Name = fields[1].GetString(); - boost::asio::ip::tcp::resolver::query externalAddressQuery(ip::tcp::v4(), fields[2].GetString(), ""); + boost::asio::ip::tcp::resolver::query externalAddressQuery(boost::asio::ip::tcp::v4(), fields[2].GetString(), ""); boost::system::error_code ec; boost::asio::ip::tcp::resolver::iterator endPoint = resolver.resolve(externalAddressQuery, ec); @@ -495,7 +495,7 @@ bool LoadRealmInfo() realm.ExternalAddress = (*endPoint).endpoint().address(); - boost::asio::ip::tcp::resolver::query localAddressQuery(ip::tcp::v4(), fields[3].GetString(), ""); + boost::asio::ip::tcp::resolver::query localAddressQuery(boost::asio::ip::tcp::v4(), fields[3].GetString(), ""); endPoint = resolver.resolve(localAddressQuery, ec); if (endPoint == end || ec) { @@ -505,7 +505,7 @@ bool LoadRealmInfo() realm.LocalAddress = (*endPoint).endpoint().address(); - boost::asio::ip::tcp::resolver::query localSubmaskQuery(ip::tcp::v4(), fields[4].GetString(), ""); + boost::asio::ip::tcp::resolver::query localSubmaskQuery(boost::asio::ip::tcp::v4(), fields[4].GetString(), ""); endPoint = resolver.resolve(localSubmaskQuery, ec); if (endPoint == end || ec) {