Bug in Player Count

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Bug in Player Count

    Danter:
    I think there is a bug in the "Online Player Count" in the overview of 2moons 2.0. The online count is performed before the update, when the current player was online. So it will sometimes count the active player and sometimes not. To resolve this, count online player execpt the current user and add 1 to the result:

    PHP Source Code

    1. $onlineUserResult = $db->select("SELECT id FROM %%USERS%% WHERE NOT id =:userId AND onlinetime > :timeUser AND authlevel < :auth ;", array(
    2. ':timeUser' => TIMESTAMP - 15*60,
    3. ':auth' => AUTH_ADM,
    4. ':userId' => $USER['id'],
    5. ));
    6. $onlineUser = $db->rowCount($onlineUserResult) + 1; //And me
  • yes, and I haven't retouched the source code of version 2.0 at all because the best thing is to do it in js to have dynamic rendering without refreshing on our view.