SA-MP Forums Archive
Why do we do it like this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Why do we do it like this? (/showthread.php?tid=154002)



Why do we do it like this? - jameskmonger - 11.06.2010

Why do we load the ban files from one large file? Why not just make a folder called /bans/, and every time a person gets banned, a file is created (IP.cfg).
In this file, we would have this:
Код:
Names = 
BanDate =
UnbanDate = 
Reason =
For example, if someone was banned for 1 day for being rude to admins, and when they were banned, they logged in (from the same IP) with a different name, it would look like this:
(The person was banned on "JohnnyA" and then evaded on JohnnyB")
Код:
Names = JohnnyA, JohnnyB
BanDate = 29/01/2014
UnbanDate = 30/01/2014
Reason = Rudeness/insults to admins
You could then use a byte searcher to scan through the files for the name (for example, they log into JohnnyA from a different IP), and then create a new file like this:
Код:
Names = JohnnyA
BanDate = 29/01/2014
UnbanDate = 0
Reason = Evasion: Rudeness/insults to admins
And so on.


Re: Why do we do it like this? - TheInnocentOne - 11.06.2010

Because that is scriptable if you have the knowledge...
The ban system SA-MP comes with is just a basic one. Most of the big servers have their own custom ban system.


Re: Why do we do it like this? - jameskmonger - 11.06.2010

I know, but why doesn't SAMP make a better default one?

(And I know it can be scripted, I was posting this hoping someone would say that, thanks :P)


Re: Why do we do it like this? - jameskmonger - 13.06.2010

Bump.


Re: Why do we do it like this? - DJDhan - 13.06.2010

Well, it's not very memory friendly to create separate ban files for all players. And especially on the popular servers, 10 people are banned each day, that means 10 files each day,instead of just ten lines in the samp.ban file.


Re: Why do we do it like this? - cessil - 13.06.2010

why did you bump this? sa-mp has a basic ban log, if you want a better one script it.


Re: Why do we do it like this? - jameskmonger - 13.06.2010

Quote:
Originally Posted by DJDhan
Well, it's not very memory friendly to create separate ban files for all players. And especially on the popular servers, 10 people are banned each day, that means 10 files each day,instead of just ten lines in the samp.ban file.
Because on those "popular servers", it has to search through a file of sometimes 1000+ lines to find if the player is banned or not.


Re: Why do we do it like this? - DJDhan - 13.06.2010

Better than searching for bans in "even more" player files.


Re: Why do we do it like this? - jameskmonger - 13.06.2010

Quote:
Originally Posted by DJDhan
Better than searching for bans in "even more" player files.
No it's not. Sure, it's inefficient because it creates a seperate file, but it's quicker to read.


Re: Why do we do it like this? - TheInnocentOne - 13.06.2010

Some servers have >50,000 account files. The wasted disk space would be stupid.