We can't put a realmid above 8 in the worldserver.conf, else it returns "Realm ID not defined in configuration file"
We should be able to put realmid above 8, imagine if we have tons of realms or simply to sort them easily (dev realms on 10-20 IDs, testing realms on 20-30 etc...)
This part is responsible (thanks @Rochet2 for finding it in 10 sec)
https://github.com/azerothcore/azerothcore-wotlk/blob/master/src/server/worldserver/Master.cpp#L472
This is related to the auth.account.online column. In that column, the realmid is put when you are online on that realmid. However it uses a flag, which doesn't seem to make much sense (since you can't be online on several realms at the same time with the same account).
Rochet suggests to either change this to a flat number. :
simply scrapping the mask would already allow 255 realms or something
Or to change to uint 32 :
And by searching realmID in the source code you can find where the mask is used
For example there is this line of code LoginDatabase.DirectPExecute("UPDATE account SET online = online & ~(1<<(%u-1)) WHERE online & (1<<(%u-1))", realmID, realmID);
master
264dd0c65afc33e9613e42dee656697d088d8a74
i cant reproduce step 3 :(
Just remove the realmID > 8 from the function. Don't see why you would need 8 realms anyways.
@Meltie2013 beware of the part where the current system is built to use 8bit flag for the realm in account table
In a real scenario, is there any server that has more than 3 WotLK realms?
Barbz: or simply to sort them easily (dev realms on 10-20 IDs, testing realms on 20-30 etc...)
I had wasted precious time the first time I discovered this bug (since it's not on TC, and makes no sense, it made me believe I had issue with my firewall), hence why I think it's more important than a "priority low" (compared to a missing NPC text for example...).
Removed the priority label since it might cause confussion.
Back on topic, I understand what you are saying and agree that it _might be helpful_, but, in real case scenario I don't really see the need to work on this (considering modifications needed). I've worked with parallel realms, including one for development, and the ID is not a big issue, since in the realm selection they appear in a different tab, hence you don't need any type of "sorting".
I see this more like a personal requirement rather than a valuable feature. With the right documentation, and maybe a console warning, there shouldn't be anyone who might face this problem.
Removed the priority label since it might cause confussion.
Back on topic, I understand what you are saying and agree that it _might be helpful_, but, in real case scenario I don't really see the need to work on this (considering modifications needed). I've worked with parallel realms, including one for development, and the ID is not a big issue, since in the realm selection they appear in a different tab, hence you don't need any type of "sorting".
I see this more like a personal requirement rather than a valuable feature. With the right documentation, and maybe a console warning, there shouldn't be anyone who might face this problem.
Well I found this issue again because I want to organize the IDs logically and more importantly, automatically, so it's the second time I face this issue xD maybe other people did but never reported it either.
I'm gonna do what Meltie said and just remove the check and open a PR because on TC it seems like that.
Ok when just removing, it's not enough of course:
SQL: UPDATE account SET online = online | (1<<(10-1)) WHERE id = 1;
ERROR: [1264] Out of range value for column 'online' at row 1
Unhandled MySQL errno 1264. Unexpected behaviour possible.
https://github.com/azerothcore/azerothcore-wotlk/blob/master/src/server/worldserver/Master.cpp#L509
just saw that comment:
// pussywizard: tc query would set online=0 even if logged in on another realm >_>
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/worldserver/Main.cpp#L597
maybe @xinef1 can give us a hint on this
@Meltie2013 beware of the part where the current system is built to use 8bit flag for the realm in account table
@BarbzYHOOL I quote myself. It's not just removing the check, you also have to edit every related class in code, and the table structure in the database.
yeah I suspected that but still wanted to give it a quick try lol
just to give @BarbzYHOOL some support, I faced this issue a few weeks ago (i currenty have 11 realms) and I would love to see this change implemented.
Yes, it's really annoying for my setup actually. I don't have 11 realms but just to organize them logically it's a pain, so that's 2 issues in 1
Most helpful comment
i cant reproduce step 3 :(