diff --git a/code/__DEFINES.dm b/code/__DEFINES.dm index 3fc45960d98..fc723ffac68 100644 --- a/code/__DEFINES.dm +++ b/code/__DEFINES.dm @@ -328,6 +328,7 @@ var/static/list/scarySounds = list('sound/weapons/thudswoosh.ogg','sound/weapons #define BANTYPE_JOB_PERMA 3 #define BANTYPE_JOB_TEMP 4 #define BANTYPE_ANY_FULLBAN 5 //used to locate stuff to unban. +#define BANTYPE_APPEARANCE 6 #define SEE_INVISIBLE_MINIMUM 5 diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index ff4472ee668..90787627c5a 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -25,6 +25,9 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = if(BANTYPE_JOB_TEMP) bantype_str = "JOB_TEMPBAN" bantype_pass = 1 + if(BANTYPE_APPEARANCE) + bantype_str = "APPEARANCE_BAN" + bantype_pass = 1 if( !bantype_pass ) return if( !istext(reason) ) return if( !isnum(duration) ) return @@ -107,6 +110,9 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "") if(BANTYPE_JOB_TEMP) bantype_str = "JOB_TEMPBAN" bantype_pass = 1 + if(BANTYPE_APPEARANCE) + bantype_str = "APPEARANCE_BAN" + bantype_pass = 1 if(BANTYPE_ANY_FULLBAN) bantype_str = "ANY" bantype_pass = 1 @@ -291,6 +297,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) output += "" output += "" output += "" + output += "" output += "" output += "Ckey: " output += "Duration: " @@ -378,6 +385,8 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) typedesc = "JOBBAN
([job])" if("JOB_TEMPBAN") typedesc = "TEMP JOBBAN
([job])
([duration] minutes
Expires [expiration]" + if("APPEARANCE_BAN") + typedesc = "APPEARANCE/NAME BAN" output += "" output += "[typedesc]" diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index eedc78f47e9..1055324f57d 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -50,6 +50,7 @@ var/global/floorIsLava = 0 body += "Warn | " body += "Ban | " body += "Jobban | " + body += "Appearance Ban | " body += "Notes " if(M.client) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index bd8a31bea20..8462b271f1a 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -360,9 +360,56 @@ /////////////////////////////////////new ban stuff - else if(href_list["jobban2"]) -// if(!check_rights(R_BAN)) return + else if(href_list["appearanceban"]) + if(!check_rights(R_BAN)) + return + var/mob/M = locate(href_list["appearanceban"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob" + return + if(!M.ckey) //sanity + usr << "This mob has no ckey" + return + var/banreason = appearance_isbanned(M) + if(banreason) + /* if(!config.ban_legacy_system) + usr << "Unfortunately, database based unbanning cannot be done through this panel" + DB_ban_panel(M.ckey) + return */ + switch(alert("Reason: '[banreason]' Remove appearance ban?","Please Confirm","Yes","No")) + if("Yes") + ban_unban_log_save("[key_name(usr)] removed [key_name(M)]'s appearance ban") + log_admin("[key_name(usr)] removed [key_name(M)]'s appearance ban") + feedback_inc("ban_appearance_unban", 1) + DB_ban_unban(M.ckey, BANTYPE_APPEARANCE) + appearance_unban(M) + message_admins("\blue [key_name_admin(usr)] removed [key_name_admin(M)]'s appearance ban", 1) + M << "\red[usr.client.ckey] has removed your appearance ban." + + else switch(alert("Appearance ban [M.ckey]?",,"Yes","No", "Cancel")) + if("Yes") + var/reason = input(usr,"Reason?","reason","Metafriender") as text|null + if(!reason) + return + ban_unban_log_save("[key_name(usr)] appearance banned [key_name(M)]. reason: [reason]") + log_admin("[key_name(usr)] appearance banned [key_name(M)]. \nReason: [reason]") + feedback_inc("ban_appearance",1) + DB_ban_record(BANTYPE_APPEARANCE, M, -1, reason) + appearance_fullban(M, "[reason]; By [usr.ckey] on [time2text(world.realtime)]") + notes_add(M.ckey, "Appearance banned - [reason]") + message_admins("\blue [key_name_admin(usr)] appearance banned [key_name_admin(M)]", 1) + M << "\redYou have been appearance banned by [usr.client.ckey]." + M << "\red The reason is: [reason]" + M << "\red Appearance ban can be lifted only upon request." + if(config.banappeals) + M << "\red To try to resolve this matter head to [config.banappeals]" + else + M << "\red No ban appeals URL has been set." + if("No") + return + + else if(href_list["jobban2"]) var/mob/M = locate(href_list["jobban2"]) if(!ismob(M)) usr << "This can only be used on instances of type /mob" diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 93e25325213..5bc1bc91554 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -132,8 +132,10 @@ datum/preferences dat += "

Occupation Choices

" dat += "Set Occupation Preferences
" - dat += "

Indentity

" + dat += "

Identity

" dat += "
" + if(appearance_isbanned(user)) + dat += "You are banned from using custom names and appearances. You can continue to adjust your characters, but you will be randomised once you join the game.
" dat += "Random Name " dat += "Always Random Name: [be_random_name ? "Yes" : "No"]
" diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 4149e763329..f7abec2be59 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -308,7 +308,7 @@ var/mob/living/carbon/human/new_character = new(loc) new_character.lastarea = get_area(loc) - if(ticker.random_players) + if(ticker.random_players || appearance_isbanned(new_character)) new_character.gender = pick(MALE, FEMALE) client.prefs.real_name = random_name() client.prefs.randomize_appearance_for(new_character) diff --git a/code/world.dm b/code/world.dm index 41ef45c11c6..a4cb68eca71 100644 --- a/code/world.dm +++ b/code/world.dm @@ -31,6 +31,7 @@ if(config.usewhitelist) load_whitelist() jobban_loadbanfile() + appearance_loadbanfile() jobban_updatelegacybans() LoadBans() investigate_reset() diff --git a/tgstation.dme b/tgstation.dme index cf351ee3ad6..56619a0ed88 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -611,6 +611,7 @@ #include "code\modules\admin\admin_memo.dm" #include "code\modules\admin\admin_ranks.dm" #include "code\modules\admin\admin_verbs.dm" +#include "code\modules\admin\banappearance.dm" #include "code\modules\admin\banjob.dm" #include "code\modules\admin\create_mob.dm" #include "code\modules\admin\create_object.dm"