Hello everyone,
today I'm releasing a mod for the game file which has always been sought, at least in the past.
It's the in-game ban command, which GMs can use in the same way they would use the "block chat" command.
The mod is applied to the game with the "dynamic library" method, but I haven't used any code from the one posted by niky90, everything's been done from scratch by me and only me: the "base" library is the same I will use on my server, [Only registered and activated users can see links. Click Here To Register...], but, obviously, there are just two modules in this one, the "Command extension" and the "Ban command" ones.
To use the library, download it and put it somewhere on your server, then edit the start script, to be more precise the line where it runs the "cores" (it'll probably look like "./corename"):
Warning: if you're using a 64-bit OS, you should use the "LD_32_PRELOAD" environment variable instead of that one.
You can check if the library has been loaded by the message it shows when the game starts:
The in-game usage is really simple:
The duration parameter is optional, in which case the ban will be permanent, otherwise you can specify the timespan you want the player to be banned in exactly the same way you would with the "block_chat" command. For redundancy, you might as well write "permanent" in the duration parameter, and it will execute as if you didn't write anything (which means a permanent ban).
To unban, just write:
The library requires that you have the "account" database named exactly like that, "account". If that database has another name on your server, the library will not work.
That should be all. I will probably update this when I have time, to make it show a notice to all players that a certain user has been (un)banned.
Credits:
me XD
[Only registered and activated users can see links. Click Here To Register...], since I wouldn't have made the library, nor could I have tested without this server.
Changelog:
today I'm releasing a mod for the game file which has always been sought, at least in the past.
It's the in-game ban command, which GMs can use in the same way they would use the "block chat" command.
The mod is applied to the game with the "dynamic library" method, but I haven't used any code from the one posted by niky90, everything's been done from scratch by me and only me: the "base" library is the same I will use on my server, [Only registered and activated users can see links. Click Here To Register...], but, obviously, there are just two modules in this one, the "Command extension" and the "Ban command" ones.
To use the library, download it and put it somewhere on your server, then edit the start script, to be more precise the line where it runs the "cores" (it'll probably look like "./corename"):
Code:
env LD_PRELOAD="/full/path/to/the/lib.so" ./corename
You can check if the library has been loaded by the message it shows when the game starts:
The in-game usage is really simple:
Code:
/ban playername [duration]
To unban, just write:
Code:
/ban playername 0
That should be all. I will probably update this when I have time, to make it show a notice to all players that a certain user has been (un)banned.
Credits:
me XD
[Only registered and activated users can see links. Click Here To Register...], since I wouldn't have made the library, nor could I have tested without this server.
Changelog:
- 29/04/2013: Initial release, added automatic disconnect and database query in case the banned player is not online.
Quote:
Update: someone asked via PM to have the source of the ban function. While it's not a problem for me to post that, it would be to post the source for my whole library. So, I'm posting this just for reference, to let people see how it works (and also check if there is any bug, why not). You probably won't be able to compile the source as it is, if you don't have the right header files XD
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Password: UniversalElements
Password: UniversalElements