Skip to content

Instantly share code, notes, and snippets.

@Emtec
Created November 5, 2009 21:18
Show Gist options
  • Save Emtec/227412 to your computer and use it in GitHub Desktop.
Save Emtec/227412 to your computer and use it in GitHub Desktop.
diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp
index 1de190b..39218a1 100644
--- a/src/game/WorldSocket.cpp
+++ b/src/game/WorldSocket.cpp
@@ -29,7 +29,7 @@
#include "WorldSocket.h"
#include "Common.h"
-
+#include "Config/ConfigEnv.h"
#include "Util.h"
#include "World.h"
#include "WorldPacket.h"
@@ -841,6 +841,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
OPENSSL_free ((void*) sStr);
OPENSSL_free ((void*) vStr);
+
///- Re-check ip locking (same check as in realmd).
if (fields[4].GetUInt8 () == 1) // if ip is locked
{
@@ -861,6 +862,20 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
if(security > SEC_ADMINISTRATOR) // prevent invalid security settings in DB
security = SEC_ADMINISTRATOR;
+ // CHECK ACCESS TO REALM - FOR ONLY TEST ACCOUNT
+ QueryResult *accAccess = loginDatabase.PQuery("SELECT realm_id FROM account_access WHERE acc_id = '%d'", id);
+
+ if(accAccess->GetRowCount() == 1){
+ Field* fieldsAcc = accAccess->Fetch();
+ uint32 accessRealm = fieldsAcc[0].GetInt32();
+ uint32 realmID = sConfig.GetIntDefault("RealmID", 0);
+ if(realmID != accessRealm){
+ delete accessRealm, realmID, fieldsAcc, accAccess;
+ return -1;
+ }
+ delete accessRealm, realmID, fieldsAcc, accAccess;
+ }
+
K.SetHexStr (fields[2].GetString ());
time_t mutetime = time_t (fields[8].GetUInt64 ());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment