I want to make a ban system where I can view who is banned, for example:
Key - IP Address - Computer id - ban date - Unban Date
Howey - 124.345.24.12 - 4646436446 - 22:31 21/09/2009 - 22:31 22/09/2009
(HH/MM DD/MM/YYYY)
I also want to know how I would go around getting it to auto unban a player when it reaches the unban date. The rest of how I want my ban system to be I know I to do.
Any help please?
ID:158308
Sep 21 2009, 10:54 am
|
|
Sep 21 2009, 11:46 am
|
|
I like this idea, though I cannot do it, I would like to see and know how to do it too.. :D
|
Howey wrote:
I want to make a ban system where I can view who is banned Then store this data using a format of your choice... and add a method of your choice (e.g. verb) for your admins to have it displayed to them... in the form of your choice (window popup, statpanel, output, grid...). You could just dump all bans info (and data about the players in question, when available) into one fat log file that the admins can view, but you may want something tidier. You could use a datum to represent each ban (or identity of a person for that matter, since almost all of the data you want to keep track of is properties of that - and you might have a complex identity system where you even link identities of different keys and as such because overlapping of computer_ids etc), though you could also just use lists (associative or not) to represent each ban's data as well. Either way you'll want a global list(s) of all bans for easy access. Here's one way a ban datum-based structure I just came up could look like (where when a person is banned his key, IP as well as computer_id are all banned together): ban If you're not familiar with how world/IsBanned() is handled, look it up. At any case you don't strictly have to do the banchecking there, of course. Note: the above is not complete code of course, demonstration-only - lacking support for some features (e.g. permanent bans, in which you'd just flag the expiration date with a special value like -1 and account for it). You could also expand the system to take multiple IP addresses and keys per ban, so if you ban 2 different keys (or IPs) of the same person and it is possible to detect this by overlap of another identifying piece of data, the system will only use one ban object for the person instead of multiple. Also note you could actually pull off the same without a global bans list since you can just loop through all ban datums in existence with for(var/bans/B) instead, though you'd need of course to change the code a bit to keep the bans datum from being garbage collected and making sure they're still deleted when they're supposed to. I also want to know how I would go around getting it to auto unban a player when it reaches the unban date. The rest of how I want my ban system to be I know I to do. If you really want the ban to be completely clear from the system after it expires, you could check for expired bans in a loop that's reprocessed every few minutes (or even longer). However, you don't need to check for expired bans periodically at all if you're so inclined - simply when a person logs in and you check if he's banned, also check if his ban has expired in the process, and if it has, remove it altogether. It could also be useful for admins to still see expired bans (until the person first logs in after the ban is expired) in the bans list as a sort of keeping track of things (you'd mark the ban as expired, of course). By the way, most of the things discussed in this post could of course also be done similarly with other forms of punishments like mutes and as such (and those should always be linked to the identity or at the very least the client of player, by the way, rather than the mob which is a common design mistake). |
In response to Kaioken
|
|
God I always love seeing Kaioken program :)
|
In response to Kaioken
|
|
Kaioken wrote:
Howey wrote: > ban If you're not familiar with how world/IsBanned() is handled, look it up. At any case you don't strictly have to do the banchecking there, of course. i know i am late but i was lookin a this code the add ban proc has stuff like C.address, etc... Were does C get defined? ip = C.address c_id = C.computer_id ckey = C.ckey also how would you make it so you can set the amount of days the person was banned as this seems like a good ban system i would like to use :O |
In response to Darkness_Prince
|
|
It seems I renamed the argument but forgot to do so in all places. C would be the first argument, which is meant to be either a ckey or a client to grab all the info from.
You may want to also look at this post of mine. [link] And yeah... don't quote huge amounts of text. Especially without good reason. Especially while making a huge bump, even if it can be justified. :P |