legacy bans, we hardly knew ye

This commit is contained in:
FlattestGuitar
2017-03-28 15:39:30 +02:00
parent a1830cb8b9
commit a25e3db39a
+15 -32
View File
@@ -149,35 +149,13 @@ DEBUG
if(!client || !ckey)
return
if(config.ban_legacy_system)
if(!ckey in jobban_keylist)
to_chat(src, "<span class='danger'>You have no active jobbans!</span>")
return
for(var/J in jobban_assoclist[ckey])
to_chat(src, "<span class='danger'>[J]: [jobban_assoclist[ckey][J]]</span>")
//using the legacy .txt ban system
to_chat(src, "The server is using the legacy ban system. Ask an administrator for help!")
else
//permas
var/DBQuery/select_query = dbcon.NewQuery("SELECT bantype, reason, job, a_ckey , bantime FROM [format_table_name("ban")] WHERE ckey like '[ckey]' AND bantype like 'JOB_PERMABAN' AND isnull(unbanned) ORDER BY bantime DESC LIMIT 100")
select_query.Execute()
var/is_actually_banned = 0
while(select_query.NextRow())
var/bantype = select_query.item[1]
var/reason = select_query.item[2]
var/job = select_query.item[3]
var/ackey = select_query.item[4]
var/bantime = select_query.item[5]
if(bantype != null)
is_actually_banned = 1
var/output = "[bantype]: [bantime] [job] - REASON: [reason], by [ackey]"
to_chat(src, "<span class='warning'>[output]</span>")
//temps
select_query = dbcon.NewQuery("SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey like '[ckey]' AND bantype like 'JOB_TEMPBAN' AND expiration_time > Now() AND isnull(unbanned) ORDER BY bantime DESC LIMIT 100")
//using the SQL ban system
var/is_actually_banned = FALSE
var/DBQuery/select_query = dbcon.NewQuery("SELECT bantime, bantype, reason, job, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey like '[ckey]' AND ((bantype like 'JOB_TEMPBAN' AND expiration_time > Now()) OR (bantype like 'JOB_PERMABAN')) AND isnull(unbanned) ORDER BY bantime DESC LIMIT 100")
select_query.Execute()
while(select_query.NextRow())
@@ -190,10 +168,15 @@ DEBUG
var/expiration = select_query.item[6]
var/ackey = select_query.item[7]
if(bantype != null)
is_actually_banned = 1
if(bantype == "JOB_PERMABAN")
to_chat(src, "<span class='warning'>[bantype]: [job] - REASON: [reason], by [ackey]; [bantime]</span>")
else if(bantype == "JOB_TEMPBAN")
to_chat(src, "<span class='warning'>[bantype]: [job] - REASON: [reason], by [ackey]; [bantime]; [duration]; expires [expiration]</span>")
to_chat(src, "<span class='warning'>[bantype]: [job] - REASON: [reason], by [ackey]; [bantime]; [duration]; expires [expiration]</span>")
is_actually_banned = TRUE
if(!is_actually_banned)
if(is_actually_banned)
if(config.banappeals)
to_chat(src, "<span class='warning'>You can appeal the bans at: [config.banappeals]</span>")
else
to_chat(src, "<span class='warning'>You have no active jobbans!</span>")