From 0fb4757512040d43056ca9cae6fb5464fdadda77 Mon Sep 17 00:00:00 2001 From: Shadowlight213 Date: Fri, 19 Aug 2016 13:31:15 -0700 Subject: [PATCH] Fixes Appearance_PERMABAN type removed. now a jobban Added needed updating to the sql changelog --- SQL/database_changelog.txt | 10 ++++++++ code/__DEFINES/admin.dm | 2 +- code/modules/admin/DB_ban/functions.dm | 10 -------- code/modules/admin/banappearance.dm | 34 -------------------------- code/modules/admin/topic.dm | 6 ----- code/world.dm | 1 - tgstation.dme | 1 - 7 files changed, 11 insertions(+), 53 deletions(-) delete mode 100644 code/modules/admin/banappearance.dm diff --git a/SQL/database_changelog.txt b/SQL/database_changelog.txt index 85afa5fa07d..0d8a4d841fb 100644 --- a/SQL/database_changelog.txt +++ b/SQL/database_changelog.txt @@ -1,3 +1,13 @@ +19 August 2016, by Shadowlight213 + +Changed appearance bans to be jobbans. + +UPDATE `bans` SET `job` = "appearance", `bantype` = "JOB_PERMABAN" WHERE `bantype` = "APPEARANCE_PERMABAN" + +Remember to add a prefix to the table name if you use them + +---------------------------------------------------- + 3 July 2016, by Jordie0608 Modified table 'poll_question', adding column 'dontshow' which was recently added to the server schema. diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index 4df75c4a60e..50f83c2d947 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -14,7 +14,7 @@ #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 BANTYPE_ADMIN_PERMA 7 #define BANTYPE_ADMIN_TEMP 8 #define BANTYPE_ANY_JOB 9 //used to remove jobbans diff --git a/code/modules/admin/DB_ban/functions.dm b/code/modules/admin/DB_ban/functions.dm index 82f62503c32..02f585a502f 100644 --- a/code/modules/admin/DB_ban/functions.dm +++ b/code/modules/admin/DB_ban/functions.dm @@ -36,10 +36,6 @@ if(BANTYPE_JOB_TEMP) bantype_str = "JOB_TEMPBAN" bantype_pass = 1 - if(BANTYPE_APPEARANCE) - bantype_str = "APPEARANCE_PERMABAN" - duration = -1 - bantype_pass = 1 if(BANTYPE_ADMIN_PERMA) bantype_str = "ADMIN_PERMABAN" duration = -1 @@ -160,9 +156,6 @@ if(BANTYPE_JOB_TEMP) bantype_str = "JOB_TEMPBAN" bantype_pass = 1 - if(BANTYPE_APPEARANCE) - bantype_str = "APPEARANCE_PERMABAN" - bantype_pass = 1 if(BANTYPE_ADMIN_PERMA) bantype_str = "ADMIN_PERMABAN" bantype_pass = 1 @@ -361,7 +354,6 @@ output += "" output += "" output += "" - output += "" output += "" output += "" output += "" @@ -453,8 +445,6 @@ typedesc = "JOBBAN
([job])" if("JOB_TEMPBAN") typedesc = "TEMP JOBBAN
([job])
([duration] minutes [(unbanned) ? "" : "(Edit))"]
Expires [expiration]" - if("APPEARANCE_PERMABAN") - typedesc = "IDENTITY PERMABAN" if("ADMIN_PERMABAN") typedesc = "ADMIN PERMABAN" if("ADMIN_TEMPBAN") diff --git a/code/modules/admin/banappearance.dm b/code/modules/admin/banappearance.dm deleted file mode 100644 index 2a89cc41ac9..00000000000 --- a/code/modules/admin/banappearance.dm +++ /dev/null @@ -1,34 +0,0 @@ -//Code to update legacy appearance bans to jobbans - -/proc/appearance_loadbanfile() - if(config.ban_legacy_system) - return - else - if(!establish_db_connection()) - world.log << "Database connection failed." - diary << "Database connection failed." - config.ban_legacy_system = 1 - return - - //appearance bans - var/DBQuery/query = dbcon.NewQuery("SELECT ckey FROM [format_table_name("ban")] WHERE bantype = 'APPEARANCE_PERMABAN' AND NOT unbanned = 1") - query.Execute() - - while(query.NextRow()) - var/ckeyb = query.item[1] - - var/datum/admins/db = new() - db.DB_ban_unban(ckeyb, BANTYPE_APPEARANCE) - - var/mob/playermob - var/exist = 0 - for(var/mob/M in player_list) - if(M.ckey == ckeyb) - playermob = M - exist = 1 - break - - if(!exist) - playermob.ckey = ckeyb - - db.DB_ban_record(BANTYPE_JOB_PERMA, playermob, -1, "Legacy", "Appearance") diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 40558982139..462e3cd3a63 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -203,12 +203,6 @@ if(!banckey || !banreason || !banjob || !banduration) usr << "Not enough parameters (Requires ckey, reason and job)." return - if(BANTYPE_APPEARANCE) - if(!banckey || !banreason) - usr << "Not enough parameters (Requires ckey and reason)." - return - banduration = null - banjob = null if(BANTYPE_ADMIN_PERMA) if(!banckey || !banreason) usr << "Not enough parameters (Requires ckey and reason)." diff --git a/code/world.dm b/code/world.dm index 83454220e28..1f754d4b05b 100644 --- a/code/world.dm +++ b/code/world.dm @@ -39,7 +39,6 @@ var/global/list/map_transition_config = MAP_TRANSITION_CONFIG load_admins() if(config.usewhitelist) load_whitelist() - appearance_loadbanfile() LoadBans() investigate_reset() diff --git a/tgstation.dme b/tgstation.dme index 27f90292ede..d57af706b3b 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -840,7 +840,6 @@ #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"