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
Timerd not working properly?
Author Message
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #1
Timerd not working properly?
Am I the only one to notice that TIMERD is a bit imprecise? It makes @Timer fire after a "highly" variable amount of time and it's a problem if i need it to trigger after 0.1 or 0.2 seconds and it does after 0.4 or 0.7.

Tested with:
Code:
[ITEMDEF i_timerdtester]
ID=i_memory
TYPE=t_eq_script
NAME=TimerdTester

ON=@Timer
SERV.LOG timerd fired: <SERV.TIME>
REMOVE
RETURN 1

[FUNCTION timerdtest]
SERV.NEWITEM i_timerdtester,1,<UID>
NEW.TIMERD=<ARGN1>
SERV.LOG timerd: <SERV.TIME>; it should trigger at <EVAL <SERV.TIME>+<NEW.TIMERD>>

May it be related to the OnTick issue i pointed at here http://tracker.sphere.torfo.org/bugs/view.php?id=2546 ?

EDIT: lol, i posted in the wrong section, sorry
(This post was last modified: 01-16-2016 11:35 PM by karma.)
01-16-2016 08:35 PM
Find all posts by this user Like Post Quote this message in a reply
rastrero
Master
**

Posts: 250
Likes Given: 41
Likes Received: 28 in 24 posts
Joined: Jan 2016
Reputation: 3



Post: #2
RE: Timerd not working properly?
Yes, i Got the same problem.

Its happen to me in my jumpsystem.
sometimes take 0,1 sometimes 0,4
I thought my pc was overload. xD
01-16-2016 10:06 PM
Find all posts by this user Like Post Quote this message in a reply
RunBody
Apprentice
*

Posts: 12
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Dec 2015
Reputation: 0



Post: #3
RE: Timerd not working properly?
serv.log <argn>
new.timerD <argn>
01-17-2016 05:18 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #4
RE: Timerd not working properly?
Argn1 works equally
01-17-2016 05:22 AM
Find all posts by this user Like Post Quote this message in a reply
RunBody
Apprentice
*

Posts: 12
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Dec 2015
Reputation: 0



Post: #5
RE: Timerd not working properly?
try timerdtest 1.2
01-17-2016 05:23 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #6
RE: Timerd not working properly?
Same problem, if you try multiple times with the same argument, the interval of time between the two serv.log changes nearly every time and rarely it is what it is supposed to be.
01-17-2016 08:34 AM
Find all posts by this user Like Post Quote this message in a reply
RunBody
Apprentice
*

Posts: 12
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Dec 2015
Reputation: 0



Post: #7
RE: Timerd not working properly?
when i type timerdtest 1.2
in logs i see number 12,argn become decimal number, so problem i guess in that
01-17-2016 05:34 PM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #8
RE: Timerd not working properly?
Nope, to be "quick" in sphere numbers are always considered integers (with the exceptions of calculations on FLOAT variables), so when you pass values to something that is supposed to receive decimal numbers the integer you pass is considered decimal. So if you set TIMERD=10 it should be considered 1.0, as well as setting a skill value to 1000 will set it at 100.0%.
01-17-2016 07:48 PM
Find all posts by this user Like Post Quote this message in a reply
rastrero
Master
**

Posts: 250
Likes Given: 41
Likes Received: 28 in 24 posts
Joined: Jan 2016
Reputation: 3



Post: #9
RE: Timerd not working properly?
I think the problem is about the order sphere cues order commands execution.
01-17-2016 10:54 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #10
RE: Timerd not working properly?
Didn't understand completelly, however take in count that Sphere doesn't work in seconds, but on ticks ... on a well performanced server 1 tick should be the same as 0.1 second ... but this is very hard to achieve and sometimes it will take 0.10, sometimes 0.11, 0.12 ... depending on a lot of factors, this is one of the reasons why we tell people to keep their code the most small and clean possible.
01-18-2016 06:53 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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