The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regarding Time Online
Author Message
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #16
RE: Regarding Time Online
in this case I think its better use just 1 function to all clients instead of a timer running separately on each player. The tag will be better stored as minutes and then convert it to hours/days/etc as you need. It will get a much more accurate result compared to a tag that just count at full hours

Code:
[EVENTS e_connection_time]
ON=@Login
CTAG.ConnectionTimestamp=<SERV.TIME> //set the current timestamp on login to prevent incorrect counting

[FUNCTION CountConnectionTime]
TAG0.OnlineMinutes += <eval (<SERV.TIME>-<CTAG0.ConnectionTimestamp>)/600>
CTAG.ConnectionTimestamp=<SERV.TIME>

just add the event on all clients and keep calling "SERV.ALLCLIENTS CountConnectionTime" at each X minutes (maybe the best way is use it directly on f_onserver_timer)

PS: needs a better testing, since I'm doing it without testing any result
(This post was last modified: 08-14-2013 04:23 AM by Coruja.)
08-14-2013 04:19 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Regarding Time Online - pinku - 08-05-2013, 01:56 PM
RE: Regarding Time Online - Rattlehead - 08-05-2013, 02:03 PM
RE: Regarding Time Online - pinku - 08-05-2013, 02:28 PM
RE: Regarding Time Online - Rattlehead - 08-05-2013, 05:53 PM
RE: Regarding Time Online - pinku - 08-06-2013, 01:15 AM
RE: Regarding Time Online - Mordaunt - 08-06-2013, 02:44 AM
RE: Regarding Time Online - darksun84 - 08-06-2013, 03:19 AM
RE: Regarding Time Online - pinku - 08-06-2013, 04:03 AM
RE: Regarding Time Online - darksun84 - 08-06-2013, 04:08 AM
RE: Regarding Time Online - Mordaunt - 08-06-2013, 05:28 AM
RE: Regarding Time Online - pinku - 08-06-2013, 05:35 AM
RE: Regarding Time Online - Mordaunt - 08-06-2013, 06:01 AM
RE: Regarding Time Online - Rattlehead - 08-06-2013, 07:42 AM
RE: Regarding Time Online - Coruja - 08-09-2013, 04:04 PM
RE: Regarding Time Online - Rattlehead - 08-13-2013, 07:43 AM
RE: Regarding Time Online - Coruja - 08-14-2013 04:19 AM
RE: Regarding Time Online - Rattlehead - 08-14-2013, 08:16 AM
RE: Regarding Time Online - RanXerox - 08-15-2013, 12:42 AM
RE: Regarding Time Online - Mordaunt - 08-15-2013, 01:17 AM
RE: Regarding Time Online - Coruja - 08-15-2013, 03:26 AM
RE: Regarding Time Online - Rattlehead - 08-15-2013, 08:30 AM
RE: Regarding Time Online - Mordaunt - 08-15-2013, 09:07 AM
RE: Regarding Time Online - Rattlehead - 08-15-2013, 12:40 PM

Forum Jump:


User(s) browsing this thread: 4 Guest(s)