uncovery / uncovery_me

Full source of the uncovery.me minecraft server
GNU General Public License v3.0
12 stars 3 forks source link

Improved time reporting #125

Open ETcodehome opened 8 years ago

ETcodehome commented 8 years ago

Looking at adding a time played since

function umc_get_online_hours_since($user, $timestamp) { XMPP_ERROR_trace(FUNCTION, func_get_args()); $uuid = umc_uuid_getone($user, 'uuid'); $sql = "SELECT onlinetime FROM minecraft_srvr.UUID WHERE UUID='$uuid';"; $data = umc_mysql_fetch_all($sql); if (count($data) == 0) { return false; } $onlinetime = round($data[0]['onlinetime'] / 60 / 60); return $onlinetime; }

The issue i am running into is I have no reference for the table structure of the sql returned query.

Is there data on each login / logout event or is it just a "lump sum" value stored of time played? By my understanding of this return it does seem to be just the lump sum.

I was planning on using it down the line as part of a weighted basket for contest lot priority assignment post registration as discussed.

uncovery commented 8 years ago

Yes, there is only a single sum stored, no increments. The actual code to update the info is here: https://github.com/uncovery/uncovery_me/blob/master/includes/uuid.inc.php#L58

uncovery commented 8 years ago

There is no way you can add that function since the information is not there - unless you want to re-calculate it from the login-logout time stamps in the universal log.