- Fixes the broken population logging

- The current, file-based ban system is now a legacy system, the use of which is strongly discouraged for servers, which are constantly online.
- Added a database-based banning system, with a new baning panel, accessible through the 'banning panel' verb. Servers, which use this new banning system, will get the new panel up even if they use the old 'unban panel' or 'display job bans' verbs. These remain there for legacy support purposes. (Panel screenshot below)
- The most notable benefits of the new system are the ability to add offline bans, meaning the person does not have to be connected for a ban to be applied to their name. The second benefit is the ability to look up all previous bans that the person had.
- The major disadvantage is the complete incompatibility between the old and new system, meaning you have to either do a lot of copy-pasting or playing around in code to sync the old system with the new one. Servers upgrading to this system might want to consider a purge of all bans, if they don't want to go through this. Due to the incompatibility, there are no transition tools provided. Please contact me (errorage/rageroro) in #coderbus for help in syncing your database. The /tg/ legacy and database systems have been synced.
- The server configuration defaults to use the legacy system, as the new one requires the database to be set up. Please hash BAN_LEGACY_SYSTEM in config.txt as explained, to use the new system. If the database connection fails, the server reverts to the legacy system.

If any bugs or errors appear with either the legacy or new ban system, please let me know ASAP. The same applies if there are any syncronization problems between the legacy and new system, resulting in banned people unbanned or unbanned people banned.

Panel screenshot:
http://www.kamletos.si/new%20ban%20panel2.PNG

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5034 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2012-11-11 05:39:09 +00:00
parent b8cb37af2a
commit 2f57200e82
8 changed files with 386 additions and 47 deletions

View File

@@ -45,6 +45,60 @@
log_admin("[key_name(usr)] has spawned a death squad.")
if(!src.makeDeathsquad())
usr << "\red Unfortunatly there were no candidates available"
else if(href_list["dbsearchckey"] || href_list["dbsearchadmin"])
var/adminckey = href_list["dbsearchadmin"]
var/playerckey = href_list["dbsearchckey"]
DB_ban_panel(playerckey, adminckey)
return
else if(href_list["dbbanedit"])
var/banedit = href_list["dbbanedit"]
var/banid = text2num(href_list["dbbanid"])
if(!banedit || !banid)
return
DB_ban_edit(banid, banedit)
return
else if(href_list["dbbanaddtype"])
var/bantype = text2num(href_list["dbbanaddtype"])
var/banckey = href_list["dbbanaddckey"]
var/banduration = text2num(href_list["dbbaddduration"])
var/banjob = href_list["dbbanaddjob"]
var/banreason = href_list["dbbanreason"]
banckey = ckey(banckey)
switch(bantype)
if(BANTYPE_PERMA)
if(!banckey || !banreason)
usr << "Not enough parameters (Requires ckey and reason)"
return
banduration = null
banjob = null
if(BANTYPE_TEMP)
if(!banckey || !banreason || !banduration)
usr << "Not enough parameters (Requires ckey, reason and duration)"
return
banjob = null
if(BANTYPE_JOB_PERMA)
if(!banckey || !banreason || !banjob)
usr << "Not enough parameters (Requires ckey, reason and job)"
return
banduration = null
var/mob/playermob
for(var/mob/M in player_list)
if(M.ckey == banckey)
playermob = M
break
banreason = "(MANUAL BAN) "+banreason
DB_ban_record(bantype, playermob, banduration, banreason, banjob, null, banckey)
else if(href_list["editadminpermissions"])
var/adm_ckey = href_list["editadminckey"]
@@ -595,6 +649,10 @@
//Unbanning joblist
//all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned)
if(joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban.
if(!config.ban_legacy_system)
usr << "Unfortunately, database based unbanning cannot be done through this panel"
DB_ban_panel(usr.client.ckey)
return
var/msg
for(var/job in joblist)
var/reason = jobban_isbanned(M, job)