Created
November 4, 2009 22:14
-
-
Save Emtec/226435 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp | |
| index 512da99..06a0ff6 100644 | |
| --- a/src/game/CharacterHandler.cpp | |
| +++ b/src/game/CharacterHandler.cpp | |
| @@ -568,6 +568,15 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder) | |
| return; | |
| } | |
| + if(!pCurrChar->CheckAccessRealm(playerGuid)) | |
| + { | |
| + KickPlayer() | |
| + delete pCurrChar; | |
| + delete holder; | |
| + m_playerLoading = false; | |
| + return; | |
| + } | |
| + | |
| SetPlayer(pCurrChar); | |
| pCurrChar->SendDungeonDifficulty(false); | |
| diff --git a/src/game/Player.cpp b/src/game/Player.cpp | |
| index 03b5beb..49031e1 100644 | |
| --- a/src/game/Player.cpp | |
| +++ b/src/game/Player.cpp | |
| @@ -14237,6 +14237,25 @@ float Player::GetFloatValueFromDB(uint16 index, uint64 guid) | |
| return result; | |
| } | |
| +bool Player::CheckAccessRealm( uint32 guid ) | |
| +{ | |
| + QueryResult *result = loginDatabase.PQuery("SELECT realm_id FROM account_access WHERE account_id=%d", guid); | |
| + | |
| + if(!result) | |
| + return false; | |
| + | |
| + Field* fields = result->Fetch(); | |
| + uint32 acc_realm_id = fields[0].GetInt32(); | |
| + | |
| + if(!acc_realm_id != realmID) | |
| + return false; | |
| + | |
| + delete result; | |
| + delete fields; | |
| + | |
| + return true; | |
| +} | |
| + | |
| bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) | |
| { | |
| //// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
| diff --git a/src/game/Player.h b/src/game/Player.h | |
| index 058dac5..896cee6 100644 | |
| --- a/src/game/Player.h | |
| +++ b/src/game/Player.h | |
| @@ -1409,6 +1409,7 @@ class MANGOS_DLL_SPEC Player : public Unit | |
| /*********************************************************/ | |
| bool LoadFromDB(uint32 guid, SqlQueryHolder *holder); | |
| + bool CheckAccessRealm(uint32 guid); | |
| bool MinimalLoadFromDB(QueryResult *result, uint32 guid); | |
| static bool LoadValuesArrayFromDB(Tokens& data,uint64 guid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment