Files
Paradise/code/modules/admin/banjob.dm
T
rastaf.zero@gmail.com e84f4ad519 Update by Lagius:
Admins cat see if other admin has left the game.
The game actually checks for configuration variable guest_jobban  (still be turned on by default).
Added white list for heads and some non-heads (as in guest jobbans). Add keys to file data/whitelist.txt and turn on the option USEWHITELIST in config.txt.
Cyborgs were added to the list of important jobs (for guests jobbans and whitelist).


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1568 316c924e-a436-60f5-8080-3fe189b3f50e
2011-05-11 19:31:59 +00:00

52 lines
1.4 KiB
Plaintext

var
jobban_runonce // Updates legacy bans with new info
jobban_keylist[0] //to store the keys & ranks
/proc/jobban_fullban(mob/M, rank)
if (!M || !M.key || !M.client) return
jobban_keylist.Add(text("[M.ckey] - [rank]"))
jobban_savebanfile()
/proc/jobban_isbanned(mob/M, rank)
if(M)
if (is_important_job(rank))
if(config.guest_jobban && IsGuestKey(M.key))
return 1
if(config.usewhitelist && check_whitelist(M))
return 1
if (jobban_keylist.Find(text("[M.ckey] - [rank]")))
return 1
else
return 0
/proc/jobban_loadbanfile()
var/savefile/S=new("data/job_full.ban")
S["keys[0]"] >> jobban_keylist
log_admin("Loading jobban_rank")
S["runonce"] >> jobban_runonce
if (!length(jobban_keylist))
jobban_keylist=list()
log_admin("jobban_keylist was empty")
/proc/jobban_savebanfile()
var/savefile/S=new("data/job_full.ban")
S["keys[0]"] << jobban_keylist
/proc/jobban_unban(mob/M, rank)
jobban_keylist.Remove(text("[M.ckey] - [rank]"))
jobban_savebanfile()
/proc/jobban_updatelegacybans()
if(!jobban_runonce)
log_admin("Updating jobbanfile!")
// Updates bans.. Or fixes them. Either way.
for(var/T in jobban_keylist)
if(!T) continue
jobban_runonce++ //don't run this update again
/proc/jobban_remove(X)
if(jobban_keylist.Find(X))
jobban_keylist.Remove(X)
jobban_savebanfile()
return 1
return 0