Reworked the warning system, warns are now persistent and warn bans are exponentialy longer based on how many times youve been banned.

This commit is contained in:
d3athrow
2013-11-11 14:48:52 -06:00
parent 198e82847a
commit 3227232476
4 changed files with 24 additions and 15 deletions

View File

@@ -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 << "<font color='red'>Error: warn(): You can't warn admins.</font>"
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 << "<font color='red'><BIG><B>You have been autobanned due to a warning by [ckey].</B></BIG><br>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 << "<font color='red'><BIG><B>You have been autobanned due to a warning by [ckey].</B></BIG><br>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 << "<font color='red'><BIG><B>You have been formally warned by an administrator.</B></BIG><br>Further warnings will result in an autoban.</font>"
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