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-nmm7 (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-nmm7 (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-nmm7 (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
f_onserver_timer
Author Message
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #4
RE: f_onserver_timer
The server itself does not run according to a real-time clock... it uses its own timekeeping system called "ticks". Sometimes a tick takes a long time, sometimes short, which explains why it doesn't follow the real-time clock very closely. In the sphere ini file there are a bunch of settings that are described as "time it takes (in seconds) for..." In reality, those are all measured in "ticks" not "seconds".

The ONLY functions in the server that are aware of the real-time clock are RTICKS and RTIME:

RTICKS (Returns the real-world time, as a timestamp.)
RTIME (Returns the real-world time, as a formatted string.)

So if you need to time things in your game to a real-time clock, you need to use a scheduled timer (either f_onserver_timer or a TIMERF function - both of which are based on "ticks") and in your function, test the real-time clock and adapt accordingly depending on the precision you want.
11-22-2013 05:10 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 2 users Like RanXerox's post
Post Reply 


Messages In This Thread
f_onserver_timer - pinku - 11-22-2013, 12:40 AM
RE: f_onserver_timer - Runcuks - 11-22-2013, 03:13 AM
RE: f_onserver_timer - pinku - 11-22-2013, 04:26 AM
RE: f_onserver_timer - RanXerox - 11-22-2013 05:10 AM

Forum Jump:


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