Open FileEX opened 8 months ago
Personally I don't use the MTA ban system. I have all the bans in a MySQL DB table which I cache in a lua table, and then in the onPlayerConnect event I just check if the serial/ip etc is banned. Works like a charm... but I get the intention here.
This should have been added like 15 years ago... At least a way to add additional meta information, doesnt have to be an account number.
I see your reason for doing so but it will have limitted use. The reason we (FFS) use SQL for such stuff is we also handle mutes and other punishements via serial and account IDs. Also other serverspecific punishments can only be handled there.
Therefore I dont really see a use case for that nowadays. If a server is about to use their own account system, they will likely also do other punishments than bans which have to be handled via SQL. So it would be pointless to handle them there and bans only on build in server functions.
What I really would like to see, especially in recent times with all the serial spoofers, more functions to identify a client. To be able to receive hardware information like CPU, RAM, mainboard vendor. Also operating system version and other stuff. This would be very helpful to identify spoofers.
If you're using accounts then this option would make no sense either way. User ID would only be assigned when the player actually joins. If he needs to login then jsut use default accounting system and getAccountData
.
I dont see a purpose for adding another parameter to the banPlayer
function.
The user ID is only intended to identify the ban. So that you can get a ban (getBanID) assigned to a given user ID, and not a serial that may be fake.
MTA was once prepared for connection with MTA Forum but i believe it has been abandoned ever since? I guess it would be nice to have it back - but i can bet that some people will dislike this idea.
Is your feature request related to a problem? Please describe.
I believe that the ability to add a custom player "id" to a ban is needed.
Most servers today use their own account system, where each player has an individual number such as "UID", "DBID" or "PID", etc.
The current banning system is based on banning practically only the serial number, which has unfortunately been forged very often recently. Server developers currently have no way to verify whether the serial number is fake or not.
From a performance standpoint, the built-in ban system is a much better option than querying the database in the
onPlayerConnect
event to check whether a player is banned or not. Especially when the server starts and many people enter at the same time.Just add one argument to the banPlayer function, such as "id". The player's uid could be given as such an id. Also then you would need functions such as
getBanID
to be able to find the ban of a given user.In a situation where the serial number is no longer fully reliable, it should be possible to identify players based on some identifier created by the server creators.
This would in no way serve to check whether a player is banned at the MTA level, as is the case with IP, nickname or serial number. This would only be an identifier for server developers, which would be a better security measure than just a serial number, which may be fake.
All you need to do is simply add a custom ID to your ban information. So that scripters can read and set it.
Practical example:
The server has an account system (MySQL), a login panel, and each user has their own individual number (uid).
The server wants to use the built-in ban system, but the only thing it can rely on is the serial number, which may be fake.
The scripter writes a punishments system, then wants to set the "banned" column to 0 in the database for a player who has been unbanned (onUnban event), but the only way is to unban the player based on a serial that may not be real. Therefore, such a scripter needs to somehow read the UID of this banned player, but the built-in banning system does not have such a custom ID function.
This is when such a scripter could use the getBanID function to rely on account IDs instead of serial numbers
Describe the solution you'd like
Add the ability to set a custom player "ID" to ban.
Example:
Describe alternatives you've considered
No response
Additional context
No response
Security Policy