Jump to content

[fix][8728] account online per realm


Guest EMTEC_GM
 Share

Recommended Posts

What bug does the patch fix? What features does the patch add?

Incorrect operation a line for more than one realmu.

For which repository revision was the patch created?

8697

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

No

Who has been writing this patch? Please include either forum user names or email addresses.

Andeeria (I'am)

http://pastebin.com/d20b24457

ALTER TABLE `account` ADD `ActiveRealmID` INT( 11 ) NOT NULL DEFAULT '0' AFTER `online` ;

Description:

Amendment changing the system to reset the number of people online. Erroneous query and design of this one:

"UPDATE account SET online = 0 WHERE online > 0 "

"AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID);

On one realm it works well, but when more than one realm, it resets all the online accounts that have characters on more than one realm.

Yours, probably still need to improve but some small ideology. :)

Link to comment
Share on other sites

Why not continue to use online and just store the value there? That way you don't break scripts (for the most part).

"for the most part" is the point here IMHO..."silent" changes break tools in subtle ways, I also favour keeping things clear by renaming to new meaning.

Link to comment
Share on other sites

Vladimir further optimized by removing all the rules. For which he thanks.

As for the scripts of statistics:

When someone is offline - active_realm_id column is zero (active_realm_id = 0),

When someone is online - active_realm_id column is greater than zero (active_realm_id> 0).

For those who do not understand what the error was. Look at the situations that you have two worlds (2 Realms).

You have included one world and it is, for example, 400 people, then you have the desire to attach a second world,

So first mangosd online status changed to zero for all accounts that have the form of two worlds.

So the statistics are based on online and so were wrong.

People who write scripts for statistics, I've seen different things. But if you generate a number of online accounts at

data base of the world through characters, this is not some circumspection. Since the base realmd (~ 50mb), and base characters (2GB) --

So is the difference in the size of databases, and optimization. you can easily do yourself

list of accounts that are currently in the game on a given realm.

For example, how to do this in PHP (the idea).

//             0      1        2           3        4
$sql = "SELECT rl.id, rl.name, rl.address, rl.port, (SELECT COUNT(*) FROM account acc WHERE acc.active_realm_id=rl.id) FROM realmlist rl ORDER BY name DESC"
$query = mysql_query($sql);

while($row = mysql_fetch_row()){
   echo "{$row[1]} - online {$row[4]}

           {$row[2]}:{$row[3]}";
}

Remember that if Vladimir left column line, which was virtually redundant once grown to a size of the database realmd

Link to comment
Share on other sites

  • 2 months later...
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use