Appearance_PERMABAN type removed. now a jobban
Added needed updating to the sql changelog
This commit is contained in:
Shadowlight213
2016-08-19 13:31:15 -07:00
parent 5f15792126
commit 0fb4757512
7 changed files with 11 additions and 53 deletions

View File

@@ -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 3 July 2016, by Jordie0608
Modified table 'poll_question', adding column 'dontshow' which was recently added to the server schema. Modified table 'poll_question', adding column 'dontshow' which was recently added to the server schema.

View File

@@ -14,7 +14,7 @@
#define BANTYPE_JOB_PERMA 3 #define BANTYPE_JOB_PERMA 3
#define BANTYPE_JOB_TEMP 4 #define BANTYPE_JOB_TEMP 4
#define BANTYPE_ANY_FULLBAN 5 //used to locate stuff to unban. #define BANTYPE_ANY_FULLBAN 5 //used to locate stuff to unban.
#define BANTYPE_APPEARANCE 6
#define BANTYPE_ADMIN_PERMA 7 #define BANTYPE_ADMIN_PERMA 7
#define BANTYPE_ADMIN_TEMP 8 #define BANTYPE_ADMIN_TEMP 8
#define BANTYPE_ANY_JOB 9 //used to remove jobbans #define BANTYPE_ANY_JOB 9 //used to remove jobbans

View File

@@ -36,10 +36,6 @@
if(BANTYPE_JOB_TEMP) if(BANTYPE_JOB_TEMP)
bantype_str = "JOB_TEMPBAN" bantype_str = "JOB_TEMPBAN"
bantype_pass = 1 bantype_pass = 1
if(BANTYPE_APPEARANCE)
bantype_str = "APPEARANCE_PERMABAN"
duration = -1
bantype_pass = 1
if(BANTYPE_ADMIN_PERMA) if(BANTYPE_ADMIN_PERMA)
bantype_str = "ADMIN_PERMABAN" bantype_str = "ADMIN_PERMABAN"
duration = -1 duration = -1
@@ -160,9 +156,6 @@
if(BANTYPE_JOB_TEMP) if(BANTYPE_JOB_TEMP)
bantype_str = "JOB_TEMPBAN" bantype_str = "JOB_TEMPBAN"
bantype_pass = 1 bantype_pass = 1
if(BANTYPE_APPEARANCE)
bantype_str = "APPEARANCE_PERMABAN"
bantype_pass = 1
if(BANTYPE_ADMIN_PERMA) if(BANTYPE_ADMIN_PERMA)
bantype_str = "ADMIN_PERMABAN" bantype_str = "ADMIN_PERMABAN"
bantype_pass = 1 bantype_pass = 1
@@ -361,7 +354,6 @@
output += "<option value='[BANTYPE_TEMP]'>TEMPBAN</option>" output += "<option value='[BANTYPE_TEMP]'>TEMPBAN</option>"
output += "<option value='[BANTYPE_JOB_PERMA]'>JOB PERMABAN</option>" output += "<option value='[BANTYPE_JOB_PERMA]'>JOB PERMABAN</option>"
output += "<option value='[BANTYPE_JOB_TEMP]'>JOB TEMPBAN</option>" output += "<option value='[BANTYPE_JOB_TEMP]'>JOB TEMPBAN</option>"
output += "<option value='[BANTYPE_APPEARANCE]'>IDENTITY BAN</option>"
output += "<option value='[BANTYPE_ADMIN_PERMA]'>ADMIN PERMABAN</option>" output += "<option value='[BANTYPE_ADMIN_PERMA]'>ADMIN PERMABAN</option>"
output += "<option value='[BANTYPE_ADMIN_TEMP]'>ADMIN TEMPBAN</option>" output += "<option value='[BANTYPE_ADMIN_TEMP]'>ADMIN TEMPBAN</option>"
output += "</select></td>" output += "</select></td>"
@@ -453,8 +445,6 @@
typedesc = "<b>JOBBAN</b><br><font size='2'>([job])" typedesc = "<b>JOBBAN</b><br><font size='2'>([job])"
if("JOB_TEMPBAN") if("JOB_TEMPBAN")
typedesc = "<b>TEMP JOBBAN</b><br><font size='2'>([job])<br>([duration] minutes [(unbanned) ? "" : "(<a href=\"byond://?src=\ref[src];dbbanedit=duration;dbbanid=[banid]\">Edit</a>))"]<br>Expires [expiration]" typedesc = "<b>TEMP JOBBAN</b><br><font size='2'>([job])<br>([duration] minutes [(unbanned) ? "" : "(<a href=\"byond://?src=\ref[src];dbbanedit=duration;dbbanid=[banid]\">Edit</a>))"]<br>Expires [expiration]"
if("APPEARANCE_PERMABAN")
typedesc = "<b>IDENTITY PERMABAN</b>"
if("ADMIN_PERMABAN") if("ADMIN_PERMABAN")
typedesc = "<b>ADMIN PERMABAN</b>" typedesc = "<b>ADMIN PERMABAN</b>"
if("ADMIN_TEMPBAN") if("ADMIN_TEMPBAN")

View File

@@ -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")

View File

@@ -203,12 +203,6 @@
if(!banckey || !banreason || !banjob || !banduration) if(!banckey || !banreason || !banjob || !banduration)
usr << "Not enough parameters (Requires ckey, reason and job)." usr << "Not enough parameters (Requires ckey, reason and job)."
return 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(BANTYPE_ADMIN_PERMA)
if(!banckey || !banreason) if(!banckey || !banreason)
usr << "Not enough parameters (Requires ckey and reason)." usr << "Not enough parameters (Requires ckey and reason)."

View File

@@ -39,7 +39,6 @@ var/global/list/map_transition_config = MAP_TRANSITION_CONFIG
load_admins() load_admins()
if(config.usewhitelist) if(config.usewhitelist)
load_whitelist() load_whitelist()
appearance_loadbanfile()
LoadBans() LoadBans()
investigate_reset() investigate_reset()

View File

@@ -840,7 +840,6 @@
#include "code\modules\admin\admin_memo.dm" #include "code\modules\admin\admin_memo.dm"
#include "code\modules\admin\admin_ranks.dm" #include "code\modules\admin\admin_ranks.dm"
#include "code\modules\admin\admin_verbs.dm" #include "code\modules\admin\admin_verbs.dm"
#include "code\modules\admin\banappearance.dm"
#include "code\modules\admin\banjob.dm" #include "code\modules\admin\banjob.dm"
#include "code\modules\admin\create_mob.dm" #include "code\modules\admin\create_mob.dm"
#include "code\modules\admin\create_object.dm" #include "code\modules\admin\create_object.dm"