SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/07/2020, 05:56 PM   #11
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,151
Reputation: 215
Default Re: samp.ban and temporary banning

Quote:
Originally Posted by Kwarde View Post
To unban him at the exct timestamp is nearly impossible. This would have to be achieved by using a timer, and you don't want to check for expired bans every second.
Keep in mind that SAMP is single threaded and thus can only do one thing at a time.
You're better off checking every few minutes (eg. every 30 minutes) to see if there are expired bans.
Samp is single threaded, but MySql plugin is multi threaded, so while sql is handling its thing samp server will continue its processes. Also he doesnt need to run query every second, running every minute would be sufficient without affecting servers performance in any way, hell if 1 minute seems to often then 5 will do (and 30 is just way to long). Its also possible to send query that will check when next ban expires and set timer to check for expired bans right after it expires. That will let you execute query and unban player nearly to a second without affecting performances.
DRIFT_HUNTER is offline   Reply With Quote
Old 04/07/2020, 09:00 PM   #12
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,735
Reputation: 1686
Default Re: samp.ban and temporary banning

Quote:
Originally Posted by DRIFT_HUNTER View Post
Samp is single threaded, but MySql plugin is multi threaded, so while sql is handling its thing samp server will continue its processes. Also he doesnt need to run query every second, running every minute would be sufficient without affecting servers performance in any way, hell if 1 minute seems to often then 5 will do (and 30 is just way to long). Its also possible to send query that will check when next ban expires and set timer to check for expired bans right after it expires. That will let you execute query and unban player nearly to a second without affecting performances.
MySQL is indeed multi threaded, I even use MySQL for things like sorting arrays through MySQL instead of PAWN array sort functions.
As for the timer set for the next ban; good one, didn't think of that -which is needless to say, if I did, I would had been the one to have posted that -
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde 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
Prevent samp fron banning localhost / a ip iLearner Scripting Help 3 18/12/2016 06:52 PM
[FilterScript] Temporary banning (SQLite) - Easy to use and it works! __ Filterscripts 17 27/03/2013 07:35 PM
Temporary Name Xlithan Scripting Help 10 17/01/2013 06:24 AM
VIP Temporary help! RyanPetersons Scripting Help 1 03/10/2012 11:27 AM
[HELP]Temporary ban? KeyWay Help Archive 1 13/06/2009 08:50 AM


All times are GMT. The time now is 06:34 PM.


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