aboutsummaryrefslogtreecommitdiff
path: root/src/server/authserver/Realms
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2014-07-06 17:03:54 -0500
committerSubv <subv2112@gmail.com>2014-07-06 17:04:42 -0500
commit77caf33debab6153da46da11ff8aff5142b42b2a (patch)
treed8f21b5a64089c03b4f9cdc373b5f7c14286674c /src/server/authserver/Realms
parent59c8ffe4b3fec5979926d991c17cae84b41e46e2 (diff)
Removed some unneeded boost dependencies.
Ensure that the correct packet sizes are read in the authserver. Added some try catch to the authserver to deal with boost exceptions (this part is not finished)
Diffstat (limited to 'src/server/authserver/Realms')
-rw-r--r--src/server/authserver/Realms/RealmList.cpp46
1 files changed, 27 insertions, 19 deletions
diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp
index bf097abff9a..392d86b5621 100644
--- a/src/server/authserver/Realms/RealmList.cpp
+++ b/src/server/authserver/Realms/RealmList.cpp
@@ -83,25 +83,33 @@ void RealmList::UpdateRealms(bool init)
{
do
{
- Field* fields = result->Fetch();
- uint32 realmId = fields[0].GetUInt32();
- std::string name = fields[1].GetString();
- ip::address externalAddress = ip::address::from_string(fields[2].GetString());
- ip::address localAddress = ip::address::from_string(fields[3].GetString());
- ip::address localSubmask = ip::address::from_string(fields[4].GetString());
- uint16 port = fields[5].GetUInt16();
- uint8 icon = fields[6].GetUInt8();
- RealmFlags flag = RealmFlags(fields[7].GetUInt8());
- uint8 timezone = fields[8].GetUInt8();
- uint8 allowedSecurityLevel = fields[9].GetUInt8();
- float pop = fields[10].GetFloat();
- uint32 build = fields[11].GetUInt32();
-
- UpdateRealm(realmId, name, externalAddress, localAddress, localSubmask, port, icon, flag, timezone,
- (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build);
-
- if (init)
- TC_LOG_INFO("server.authserver", "Added realm \"%s\" at %s:%u.", name.c_str(), m_realms[name].ExternalAddress.to_string().c_str(), port);
+ try
+ {
+ Field* fields = result->Fetch();
+ uint32 realmId = fields[0].GetUInt32();
+ std::string name = fields[1].GetString();
+ ip::address externalAddress = ip::address::from_string(fields[2].GetString());
+ ip::address localAddress = ip::address::from_string(fields[3].GetString());
+ ip::address localSubmask = ip::address::from_string(fields[4].GetString());
+ uint16 port = fields[5].GetUInt16();
+ uint8 icon = fields[6].GetUInt8();
+ RealmFlags flag = RealmFlags(fields[7].GetUInt8());
+ uint8 timezone = fields[8].GetUInt8();
+ uint8 allowedSecurityLevel = fields[9].GetUInt8();
+ float pop = fields[10].GetFloat();
+ uint32 build = fields[11].GetUInt32();
+
+ UpdateRealm(realmId, name, externalAddress, localAddress, localSubmask, port, icon, flag, timezone,
+ (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build);
+
+ if (init)
+ TC_LOG_INFO("server.authserver", "Added realm \"%s\" at %s:%u.", name.c_str(), m_realms[name].ExternalAddress.to_string().c_str(), port);
+ }
+ catch (std::exception& ex)
+ {
+ TC_LOG_ERROR("server.authserver", "Realmlist::UpdateRealms has thrown an exception: %s", ex.what());
+ ASSERT(false);
+ }
}
while (result->NextRow());
}