diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index 297bcc8f60f..ebb9cc60c5f 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -1,5 +1,5 @@ -datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0, var/banckey = null) +/datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0, var/banckey = null) if(!check_rights(R_BAN)) return @@ -318,7 +318,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) -
Search: + Search: Ckey: Admin ckey: diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 3c8a56a61c7..1c3e4850cb5 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -460,15 +460,16 @@ var/list/admin_verbs_mod = list( feedback_add_details("admin_verb","SM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! #define MAX_WARNS 3 -#define AUTOBANTIME 10 +#define AUTOBANTIME 15 /client/proc/warn(warned_ckey) + var/reason = "Autobanning due to too many formal warnings" if(!check_rights(R_ADMIN)) return if(!warned_ckey || !istext(warned_ckey)) return - if(warned_ckey in admin_datums) + /*if(warned_ckey in admin_datums) usr << "Error: warn(): You can't warn admins." - return + return*/ var/datum/preferences/D var/client/C = directory[warned_ckey] @@ -480,22 +481,26 @@ var/list/admin_verbs_mod = list( return if(++D.warns >= MAX_WARNS) //uh ohhhh...you'reee iiiiin trouuuubble O:) - ban_unban_log_save("[ckey] warned [warned_ckey], resulting in a [AUTOBANTIME] minute autoban.") + var/bantime = (++D.warnbans * AUTOBANTIME) + D.warns = 1 + ban_unban_log_save("[ckey] warned [warned_ckey], resulting in a [bantime] minute autoban.") if(C) - message_admins("[key_name_admin(src)] has warned [key_name_admin(C)] resulting in a [AUTOBANTIME] minute ban.") - C << "You have been autobanned due to a warning by [ckey].
This is a temporary ban, it will be removed in [AUTOBANTIME] minutes." - del(C) + message_admins("[key_name_admin(src)] has warned [key_name_admin(C)] resulting in a [bantime] minute ban.") + C << "You have been autobanned due to a warning by [ckey].
This is a temporary ban, it will be removed in [bantime] minutes." else - message_admins("[key_name_admin(src)] has warned [warned_ckey] resulting in a [AUTOBANTIME] minute ban.") - AddBan(warned_ckey, D.last_id, "Autobanning due to too many formal warnings", ckey, 1, AUTOBANTIME) + message_admins("[key_name_admin(src)] has warned [warned_ckey] resulting in a [bantime] minute ban.") + AddBan(warned_ckey, D.last_id, "Autobanning due to too many formal warnings", ckey, 1, bantime) + holder.DB_ban_record(BANTYPE_TEMP, null, bantime, reason, , ,warned_ckey) feedback_inc("ban_warn",1) + D.save_preferences() + del(C) else if(C) C << "You have been formally warned by an administrator.
Further warnings will result in an autoban.
" - message_admins("[key_name_admin(src)] has warned [key_name_admin(C)]. They have [MAX_WARNS-D.warns] strikes remaining.") + message_admins("[key_name_admin(src)] has warned [key_name_admin(C)]. They have [MAX_WARNS-D.warns] strikes remaining. And have been warn banned [D.warnbans] [D.warnbans == 1 ? "time" : "times"]") else - message_admins("[key_name_admin(src)] has warned [warned_ckey] (DC). They have [MAX_WARNS-D.warns] strikes remaining.") - + message_admins("[key_name_admin(src)] has warned [warned_ckey] (DC). They have [MAX_WARNS-D.warns] strikes remaining. And have been warn banned [D.warnbans] [D.warnbans == 1 ? "time" : "times"]") + D.save_preferences() feedback_add_details("admin_verb","WARN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! #undef MAX_WARNS diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 630253cda48..a895a0dd3c1 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -34,6 +34,7 @@ datum/preferences //non-preference stuff var/warns = 0 + var/warnbans = 0 var/muted = 0 var/last_ip var/last_id diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 64564552c95..6517ab26040 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -54,6 +54,8 @@ S["be_special"] >> be_special S["default_slot"] >> default_slot S["toggles"] >> toggles + S["warns"] >> warns + S["warnbans"] >> warnbans //Sanitize ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor)) @@ -62,7 +64,6 @@ be_special = sanitize_integer(be_special, 0, 65535, initial(be_special)) default_slot = sanitize_integer(default_slot, 1, MAX_SAVE_SLOTS, initial(default_slot)) toggles = sanitize_integer(toggles, 0, 65535, initial(toggles)) - return 1 /datum/preferences/proc/save_preferences() @@ -80,6 +81,8 @@ S["be_special"] << be_special S["default_slot"] << default_slot S["toggles"] << toggles + S["warns"] << warns + S["warnbans"] << warnbans return 1