mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
feat(core): Increased limit of realms (#1664)
This commit is contained in:
committed by
Francesco Borzì
parent
135b4470ce
commit
c1ebc70b58
@@ -471,11 +471,21 @@ bool Master::_StartDB()
|
||||
|
||||
///- Get the realm Id from the configuration file
|
||||
realmID = sConfigMgr->GetIntDefault("RealmID", 0);
|
||||
if (!realmID || realmID > 8) // pussywizard: above 8 spoils 8-bit online mask for the accounts
|
||||
if (!realmID)
|
||||
{
|
||||
sLog->outError("Realm ID not defined in configuration file");
|
||||
return false;
|
||||
}
|
||||
else if (realmID > 255)
|
||||
{
|
||||
/*
|
||||
* Due to the client only being able to read a realmID
|
||||
* with a size of uint8 we can "only" store up to 255 realms
|
||||
* anything further the client will behave anormaly
|
||||
*/
|
||||
sLog->outError("Realm ID must range from 1 to 255");
|
||||
return false;
|
||||
}
|
||||
sLog->outString("Realm running as realm ID %d", realmID);
|
||||
|
||||
///- Initialize the DB logging system
|
||||
@@ -507,7 +517,7 @@ void Master::ClearOnlineAccounts()
|
||||
{
|
||||
// Reset online status for all accounts with characters on the current realm
|
||||
// pussywizard: tc query would set online=0 even if logged in on another realm >_>
|
||||
LoginDatabase.DirectPExecute("UPDATE account SET online = online & ~(1<<(%u-1)) WHERE online & (1<<(%u-1))", realmID, realmID);
|
||||
LoginDatabase.DirectPExecute("UPDATE account SET online = 0 WHERE online = %u", realmID);
|
||||
|
||||
// Reset online status for all characters
|
||||
CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online <> 0");
|
||||
|
||||
Reference in New Issue
Block a user