SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 04/11/2018, 06:43 AM   #71
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 58
Reputation: 30
Default Re: Timer Fix

Quote:
Originally Posted by ****** View Post
I confirmed another bug in timers the other day, and looking at your code, yours has the same. If you spawn 2^32 timers the ID wraps around and returns 0 as a valid ID. Fixing it is easy - just check if the ID is 0, and increment it again if so.
Yes, you're right, but I use signed int, so 2^31. However, it's not easy to create such a number of timers, of course if you don't do it on purpose. Unfortunately, increasing ID will not help. If the first timer with ID 1 isn't killed, then we will get a collision. I can change type for this variable, but then the functions like SetTimer will return ID < 0.
KashCherry is offline   Reply With Quote
Old 04/11/2018, 06:59 AM   #72
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 58
Reputation: 30
Default Re: Timer Fix

Quote:
Originally Posted by StRaphael View Post
When I put this plugin on my server the timers are freezing. I put the include in the script + the plugin.
When I run the gamemode with crashdetect I got this:
Code:
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

[15:34:02] 
[15:34:02] Server Plugins
[15:34:02] --------------
[15:34:02]  Loading plugin: crashdetect.so
[15:34:02]   CrashDetect v4.15.1 is OK.
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: timerfix.so
[15:34:02]   Timer Fix plugin v1.05 by KashCherry loaded.
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: mysql_static.so
[15:34:02]  >> plugin.mysql: R34 successfully loaded.
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: Whirlpool.so
[15:34:02]  
[15:34:02]  ==================
[15:34:02]  
[15:34:02]   Whirlpool loaded
[15:34:02]  
[15:34:02]  ==================
[15:34:02]  
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: sscanf.so
[15:34:02] 

[15:34:02]  ===============================

[15:34:02]       sscanf plugin loaded.     

[15:34:02]          Version:  2.8.1        

[15:34:02]    (c) 2012 Alex "******" Cole  

[15:34:02]  ===============================

[15:34:02]   Loaded.
[15:34:02]  Loading plugin: streamer.so
[15:34:02] 

*** Streamer Plugin v2.9.3 by Incognito loaded ***

[15:34:02]   Loaded.
[15:34:02]  Loading plugin: pawncmd.so
[15:34:02] Pawn.CMD plugin v3.2.0 by urShadow has been loaded
[15:34:02]   Loaded.
[15:34:02]  Loaded 7 plugins.

[15:34:02] 
[15:34:02] Filterscripts
[15:34:02] ---------------
[15:34:02]   Loading filterscript 'GYM.amx'...
[15:34:02] [debug] Server crashed due to an unknown error
[15:34:02] [debug] Native backtrace:
[15:34:02] [debug] #0 f73e5e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[15:34:02] [debug] #1 f73debcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[15:34:02] [debug] #2 f73dfdbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[15:34:02] [debug] #3 f73e0226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[15:34:02] [debug] #4 f73e5adc in ?? () from plugins/crashdetect.so
[15:34:02] [debug] #5 f7749410 in ?? ()
[15:34:02] [debug] #6 f7749430 in ?? ()
[15:34:02] [debug] #7 f7439137 in gsignal () from /lib/libc.so.6
[15:34:02] [debug] #8 f743a973 in abort () from /lib/libc.so.6
[15:34:02] [debug] #9 f747ae15 in ?? () from /lib/libc.so.6
[15:34:02] [debug] #10 f74838ad in ?? () from /lib/libc.so.6
[15:34:02] [debug] #11 f767baef in _ZdlPv () from /lib/libstdc++.so.6
[15:34:02] [debug] #12 f72de6e9 in _ZN4Hook5ApplyEP6tagAMX () from plugins/timerfix.so
[15:34:02] [debug] #13 f72df80f in AmxLoad () from plugins/timerfix.so
[15:34:02] [debug] #14 080d1c89 in ?? () from ./samp03svr
[15:34:02] [debug] #15 080a1261 in ?? () from ./samp03svr
[15:34:02] [debug] #16 080ab601 in ?? () from ./samp03svr
[15:34:02] [debug] #17 080aba0b in ?? () from ./samp03svr
[15:34:02] [debug] #18 080aa0fd in ?? () from ./samp03svr
[15:34:02] [debug] #19 f74241b3 in __libc_start_main () from /lib/libc.so.6
[15:34:02] [debug] #20 0804b4e1 in ?? () from ./samp03svr
any solution?
UPDATE:
After I removed all filterscripts from my server the plugin is working, but after I added the necessary fs to the server again, the timers are working slow, like 5 seconds are gone and then 2 seconds to go -1 on the timer.
This is really strange becouse I have tried with some fs who don't use timers.
Video:
yt.com/watch?v=wCnbSGuT2ow
ALSO I have a question: I heard that some timer fixes plugins(not this one) are going crazy after ~20 days. I need to know if someone tested this timer plugin and got no problem with timers going "crazy".
Thanks
Can you give me this fs?
KashCherry is offline   Reply With Quote
Old 04/11/2018, 12:12 PM   #73
StRaphael
Big Clucker
 
Join Date: Nov 2016
Posts: 121
Reputation: 0
Default Re: Timer Fix

Quote:
Originally Posted by KashCherry View Post
Can you give me this fs?
For sure:
https://pastebin.com/SQDWfc6S (this fs I used in my video)
And another fs(that I didn't used in the video)
https://pastebin.com/9pSXpkQ0
StRaphael is offline   Reply With Quote
Old 07/11/2018, 11:41 AM   #74
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 58
Reputation: 30
Default Re: Timer Fix

Plugin updated to version 1.06

- Fixed (big) delays.
- Added warning message about a large number of timers.

Download from Releases page.
KashCherry is offline   Reply With Quote
Old 07/11/2018, 06:25 PM   #75
StRaphael
Big Clucker
 
Join Date: Nov 2016
Posts: 121
Reputation: 0
Default Re: Timer Fix

Quote:
Originally Posted by KashCherry View Post
Plugin updated to version 1.06

- Fixed (big) delays.
- Added warning message about a large number of timers.

Download from Releases page.
Hello, since I updated this plugin with the latest version I get this errors in server_log, so my server won't open:
[21:24:55] Loading plugin: timerfix.so
[21:24:55] Failed (plugins/timerfix.so: undefined symbol: pAMXFunctions)
StRaphael is offline   Reply With Quote
Old 07/11/2018, 06:50 PM   #76
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 58
Reputation: 30
Default Re: Timer Fix

Quote:
Originally Posted by StRaphael View Post
Hello, since I updated this plugin with the latest version I get this errors in server_log, so my server won't open:
[21:24:55] Loading plugin: timerfix.so
[21:24:55] Failed (plugins/timerfix.so: undefined symbol: pAMXFunctions)
oh, yes, I'm sorry.
Reload please.
KashCherry is offline   Reply With Quote
Old 07/11/2018, 08:30 PM   #77
StRaphael
Big Clucker
 
Join Date: Nov 2016
Posts: 121
Reputation: 0
Default Re: Timer Fix

Still the timers not working well with filterscripts. I mean the timers remains behind. I have tried to count with a crono, and when I add fs, the timers aren't really very accurate(-1 second by 20 seconds...or something...I think I checked 2 or 3 times).
I'm not really sure if I was really very accurate, but still I think this plugin it's not working very good with filterscripts.
StRaphael is offline   Reply With Quote
Old 08/11/2018, 07:55 AM   #78
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 58
Reputation: 30
Default Re: Timer Fix

Quote:
Originally Posted by StRaphael View Post
Still the timers not working well with filterscripts. I mean the timers remains behind. I have tried to count with a crono, and when I add fs, the timers aren't really very accurate(-1 second by 20 seconds...or something...I think I checked 2 or 3 times).
I'm not really sure if I was really very accurate, but still I think this plugin it's not working very good with filterscripts.
You could use this test.

And during testing, the really big delays were not visible (except ProcessTick delay).
Make sure the problem is valid.
KashCherry is offline   Reply With Quote
Old 08/11/2018, 11:28 AM   #79
StRaphael
Big Clucker
 
Join Date: Nov 2016
Posts: 121
Reputation: 0
Default Re: Timer Fix

Quote:
Originally Posted by KashCherry View Post
You could use this test.

And during testing, the really big delays were not visible (except ProcessTick delay).
Make sure the problem is valid.
I made 2 videos that proves my problem, one with filtrescripts and one without any fs.
Links:
yt.com/watch?v=It7Kx-hsKME (with fs(and yes, the fs is using timers))
yt.com/watch?v=Xo-kl0PkPZY (without any fs)

Last edited by StRaphael; 08/11/2018 at 12:12 PM.
StRaphael is offline   Reply With Quote
Old 08/11/2018, 12:26 PM   #80
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 58
Reputation: 30
Default Re: Timer Fix

Quote:
Originally Posted by StRaphael View Post
I made 2 videos that proves my problem, one with filtrescripts and one without any fs.
Links:
yt.com/watch?v=It7Kx-hsKME (with fs(and yes, the fs is using timers))
yt.com/watch?v=Xo-kl0PkPZY (without any fs)
Ok, thank you for the information. I'll try to figure out what the problem is.
KashCherry is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer ID stored in a variable gets wiped when timer hits ? NeXoR Scripting Help 2 25/03/2017 07:22 PM
Performance Question , Per Player Timer vs Timer that loops through all players BiosMarcel Scripting Help 14 12/12/2016 09:50 AM
If /foodsearch doesn't find item, set wait timer (TIMER HELP) Josh_Main Scripting Help 7 14/09/2016 04:13 PM
Which is better Per Player Timer or Global timer? (issue with timer) Dokins Scripting Help 4 07/06/2016 09:50 AM
Slice's Timer Fix include --> timer public function isn't getting called Riwerry Scripting Help 0 02/01/2016 03:50 PM


All times are GMT. The time now is 09:05 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.