diff --git a/SQL/database_changelog.txt b/SQL/database_changelog.txt index 45ea305c2b79..56e9a581f93c 100644 --- a/SQL/database_changelog.txt +++ b/SQL/database_changelog.txt @@ -1,13 +1,23 @@ Any time you make a change to the schema files, remember to increment the database schema version. Generally increment the minor number, major should be reserved for significant changes to the schema. Both values go up to 255. -The latest database version is 5.4; The query to update the schema revision table is: +The latest database version is 5.5; The query to update the schema revision table is: -INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 4); +INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 5); or -INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 4); +INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 5); In any query remember to add a prefix to the table names if you use one. +---------------------------------------------------- + +version 5.5 14 August 2021, by JamieD1 + +Adds column in mentor for position + +ALTER TABLE `mentor` ADD COLUMN `position` VARSET(32) UNSIGNED NOT NULL AFTER `ckey`; + +---------------------------------------------------- + version 5.4 18 May 2020, by TheGamer01 Adds table for antag tokens diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql index 729951dbaa42..72c86bfc269f 100644 --- a/SQL/tgstation_schema.sql +++ b/SQL/tgstation_schema.sql @@ -268,6 +268,7 @@ DROP TABLE IF EXISTS `mentor`; CREATE TABLE IF NOT EXISTS `mentor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ckey` varchar(32) NOT NULL, + `position` varchar(32) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=130 DEFAULT CHARSET=utf8; diff --git a/SQL/tgstation_schema_prefixed.sql b/SQL/tgstation_schema_prefixed.sql index fa0bd9f07495..e416bec46842 100644 --- a/SQL/tgstation_schema_prefixed.sql +++ b/SQL/tgstation_schema_prefixed.sql @@ -268,6 +268,7 @@ DROP TABLE IF EXISTS `SS13_mentor`; CREATE TABLE IF NOT EXISTS `SS13_mentor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ckey` varchar(32) NOT NULL, + `position` varchar(32) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=130 DEFAULT CHARSET=utf8; diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index a53e45ffca6d..392348bf8237 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -20,7 +20,7 @@ * * make sure you add an update to the schema_version stable in the db changelog */ -#define DB_MINOR_VERSION 4 +#define DB_MINOR_VERSION 5 //! ## Timing subsystem diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 9aaf3bd46e56..e7fdb43bdaea 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2223,7 +2223,10 @@ check_teams() // yogs start - mentors else if(href_list["makementor"]) - makeMentor(href_list["makementor"]) + makeMentor(href_list["makementor"], "Mentor") + + else if(href_list["wikimentor"]) + makeMentor(href_list["wikimentor"], "Wiki Staff") else if(href_list["removementor"]) removeMentor(href_list["removementor"]) diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 210196d14bc2..495a10bff0e5 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -148,3 +148,4 @@ var/list/active_music = list() var/datum/music/playing_music = null + var/mentor_position = null diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 06cbc29ea4ac..5634a11a5ade 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -115,8 +115,11 @@ GLOBAL_VAR_INIT(mentor_ooc_colour, YOGS_MENTOR_OOC_COLOUR) // yogs - mentor ooc oocmsg_toadmins = oocmsg else if(is_mentor()) // If the speaker is a mentor - oocmsg = "\[Mentor]" - oocmsg += "" + var mposition = "Mentor" + mposition = src.mentor_datum?.position + oocmsg = "\[" + oocmsg += "[mposition]" + oocmsg += "]" else oocmsg = "[(is_donator(src) && !CONFIG_GET(flag/everyone_is_donator)) ? "(Donator)" : ""]" oocmsg += "" diff --git a/tools/LinuxOneShot/SetupProgram/PreCompile.sh b/tools/LinuxOneShot/SetupProgram/PreCompile.sh index 328c2a3aef75..c4088a66ea1c 100644 --- a/tools/LinuxOneShot/SetupProgram/PreCompile.sh +++ b/tools/LinuxOneShot/SetupProgram/PreCompile.sh @@ -89,4 +89,4 @@ echo "Compiling tgui..." cd "$1" chmod +x tools/bootstrap/node # Workaround for https://github.com/tgstation/tgstation-server/issues/1167 chmod +x tgui/bin/tgui -env TG_BOOTSTRAP_CACHE="$original_dir" TG_BOOTSTRAP_NODE_LINUX=1 TG_BUILD_TGS_MODE=1 tools/bootstrap/node tools/build/build.js \ No newline at end of file +env TG_BOOTSTRAP_CACHE="$original_dir" TG_BOOTSTRAP_NODE_LINUX=1 TG_BUILD_TGS_MODE=1 tools/bootstrap/node tools/build/build.js diff --git a/yogstation/SQL/mentor.sql b/yogstation/SQL/mentor.sql index 4a6eef2d37cc..b4c10b8370f6 100644 --- a/yogstation/SQL/mentor.sql +++ b/yogstation/SQL/mentor.sql @@ -10,5 +10,6 @@ CREATE TABLE `mentor_memo` ( CREATE TABLE `mentor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ckey` varchar(32) NOT NULL, + `position` varchar(32) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; diff --git a/yogstation/code/modules/admin/admin.dm b/yogstation/code/modules/admin/admin.dm index b84a1c339795..097d99fa5e4e 100644 --- a/yogstation/code/modules/admin/admin.dm +++ b/yogstation/code/modules/admin/admin.dm @@ -2,6 +2,7 @@ var/body = "
" if(M.client) body += "Make mentor | " + body += "Make Wiki mentor | " body += "Remove mentor" return body @@ -23,4 +24,4 @@ toggle_dlooc() log_admin("[key_name(usr)] toggled Dead LOOC.") message_admins("[key_name_admin(usr)] toggled Dead LOOC.") - SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Dead LOOC", "[GLOB.dlooc_allowed ? "Enabled" : "Disabled"]")) \ No newline at end of file + SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Dead LOOC", "[GLOB.dlooc_allowed ? "Enabled" : "Disabled"]")) diff --git a/yogstation/code/modules/admin/topic.dm b/yogstation/code/modules/admin/topic.dm index f75c80682e41..3b6c87f0c157 100644 --- a/yogstation/code/modules/admin/topic.dm +++ b/yogstation/code/modules/admin/topic.dm @@ -18,7 +18,7 @@ usr << browse(edit_log,"window=mentormemoeditlist") qdel(query_memoedits) -/datum/admins/proc/makeMentor(ckey) +/datum/admins/proc/makeMentor(ckey, position) if(!usr.client) return @@ -34,7 +34,7 @@ to_chat(usr, "The client chosen is an admin! Cannot mentorize.", confidential=TRUE) return - new /datum/mentors(ckey) + new /datum/mentors(ckey, position) if(SSdbcore.Connect()) var/datum/DBQuery/query_get_mentor = SSdbcore.NewQuery("SELECT id FROM `[format_table_name("mentor")]` WHERE `ckey` = :ckey", list("ckey" = ckey)) @@ -45,7 +45,7 @@ return qdel(query_get_mentor) - var/datum/DBQuery/query_add_mentor = SSdbcore.NewQuery("INSERT INTO `[format_table_name("mentor")]` (`id`, `ckey`) VALUES (null, :ckey)", list("ckey" = ckey)) + var/datum/DBQuery/query_add_mentor = SSdbcore.NewQuery("INSERT INTO `[format_table_name("mentor")]` (`id`, `ckey`, `position`) VALUES (null, :ckey, :position)", list("ckey" = ckey, "position" = position)) if(!query_add_mentor.warn_execute()) qdel(query_add_mentor) return @@ -65,8 +65,8 @@ else to_chat(usr, "Failed to establish database connection. The changes will last only for the current round.", confidential=TRUE) - message_admins("[key_name_admin(usr)] added new mentor: [ckey]") - log_admin("[key_name(usr)] added new mentor: [ckey]") + message_admins("[key_name_admin(usr)] added new [position]: [ckey]") + log_admin("[key_name(usr)] added new [position]: [ckey]") /datum/admins/proc/removeMentor(ckey) if(!usr.client) diff --git a/yogstation/code/modules/mentor/mentor.dm b/yogstation/code/modules/mentor/mentor.dm index 1b1d0dc8eff5..33292ea6e038 100644 --- a/yogstation/code/modules/mentor/mentor.dm +++ b/yogstation/code/modules/mentor/mentor.dm @@ -10,8 +10,9 @@ GLOBAL_PROTECT(mentor_href_token) var/target // the mentor's ckey var/href_token // href token for mentor commands, uses the same token used by admins. var/mob/following + var/position = "Mentor" -/datum/mentors/New(ckey) +/datum/mentors/New(ckey, mentorposition) if(!ckey) QDEL_IN(src, 0) throw EXCEPTION("Mentor datum created without a ckey") @@ -28,6 +29,7 @@ GLOBAL_PROTECT(mentor_href_token) owner.add_mentor_verbs() if(!check_rights_for(owner, R_ADMIN,0)) // don't add admins to mentor list. GLOB.mentors += owner + position = mentorposition /datum/mentors/proc/CheckMentorHREF(href, href_list) var/auth = href_list["mentor_token"] @@ -87,14 +89,15 @@ GLOBAL_PROTECT(mentor_href_token) load_mentors() return - var/datum/DBQuery/query_load_mentors = SSdbcore.NewQuery("SELECT ckey FROM [format_table_name("mentor")]") + var/datum/DBQuery/query_load_mentors = SSdbcore.NewQuery("SELECT ckey, position FROM [format_table_name("mentor")]") if(!query_load_mentors.Execute()) qdel(query_load_mentors) return while(query_load_mentors.NextRow()) var/ckey = ckey(query_load_mentors.item[1]) - new /datum/mentors(ckey) + var/position = query_load_mentors.item[2] + new /datum/mentors(ckey, position) qdel(query_load_mentors) @@ -109,4 +112,4 @@ GLOBAL_PROTECT(mentor_href_token) // new client var: mentor_datum. Acts the same way holder does towards admin: it holds the mentor datum. if set, the guy's a mentor. /client - var/datum/mentors/mentor_datum \ No newline at end of file + var/datum/mentors/mentor_datum diff --git a/yogstation/code/modules/mentor/mentor_verbs.dm b/yogstation/code/modules/mentor/mentor_verbs.dm index 3c69e3f7b237..4abae6311834 100644 --- a/yogstation/code/modules/mentor/mentor_verbs.dm +++ b/yogstation/code/modules/mentor/mentor_verbs.dm @@ -41,11 +41,13 @@ GLOBAL_PROTECT(mentor_verbs) /client/verb/mentorwho() set name = "Mentorwho" set category = "Mentor" - - var/msg = "Current Mentors:\n" + var/position = "Mentor" + var/msg = "Current Mentors & Wiki:\n" if(holder) for(var/client/C in GLOB.mentors) - msg += "\t[C] is a mentor" + if(C.mentor_datum.position) + position = C.mentor_datum.position + msg += "\t[C] is a [position]" if(C.holder && C.holder.fakekey) msg += " (as [C.holder.fakekey])" @@ -62,10 +64,12 @@ GLOBAL_PROTECT(mentor_verbs) msg += "\n" else for(var/client/C in GLOB.mentors) + if(C.mentor_datum.position) + position = C.mentor_datum.position if(C.holder && C.holder.fakekey) - msg += "\t[C.holder.fakekey] is a mentor" + msg += "\t[C.holder.fakekey] is a [position]" else - msg += "\t[C] is a mentor" + msg += "\t[C] is a [position]" msg += "\n" msg += "Mentorhelps are also seen by admins. If no mentors are available in game adminhelp instead and an admin will see it and respond." to_chat(src, msg, confidential=TRUE) @@ -98,9 +102,11 @@ GLOBAL_PROTECT(mentor_verbs) set name = "Dementor" set category = "Mentor" set desc = "Shed your mentor powers." - if(GLOB.mentors.len <= 2) - to_chat(src, "There are not enough mentors on for you to De-Mentor yourself!", confidential=TRUE) - return + if(mentor_datum.position == "Mentor") + if(GLOB.mentors.len <= 2) + to_chat(src, "There are not enough mentors on for you to De-Mentor yourself!", confidential=TRUE) + return + mentor_position = mentor_datum.position remove_mentor_verbs() mentor_datum = null GLOB.mentors -= src @@ -115,7 +121,7 @@ GLOBAL_PROTECT(mentor_verbs) set desc = "Gain your mentor powers." remove_verb(src, /client/proc/rementor) spawn(20) // Now UselessTheremin being a shit too. - new /datum/mentors(ckey) + new /datum/mentors(ckey, mentor_position) to_chat(src, "You are now a Mentor again.", confidential=TRUE) log_admin("[src] rementored themself.") message_admins("[src] rementored themself.")