diff --git a/code/modules/admin/banjob.dm b/code/modules/admin/banjob.dm index bfcfe53eac6..3dffd403caf 100644 --- a/code/modules/admin/banjob.dm +++ b/code/modules/admin/banjob.dm @@ -149,35 +149,13 @@ DEBUG if(!client || !ckey) return if(config.ban_legacy_system) - if(!ckey in jobban_keylist) - to_chat(src, "You have no active jobbans!") - return - for(var/J in jobban_assoclist[ckey]) - to_chat(src, "[J]: [jobban_assoclist[ckey][J]]") + //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, "[output]") - - //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, "[bantype]: [job] - REASON: [reason], by [ackey]; [bantime]") + else if(bantype == "JOB_TEMPBAN") + to_chat(src, "[bantype]: [job] - REASON: [reason], by [ackey]; [bantime]; [duration]; expires [expiration]") - to_chat(src, "[bantype]: [job] - REASON: [reason], by [ackey]; [bantime]; [duration]; expires [expiration]") + is_actually_banned = TRUE - if(!is_actually_banned) + if(is_actually_banned) + if(config.banappeals) + to_chat(src, "You can appeal the bans at: [config.banappeals]") + else to_chat(src, "You have no active jobbans!")