")
+/// Adds a box around whatever message you're sending in chat. Can apply color and/or additional classes. Available colors: red, green, blue, purple. Use it like red_box
+#define custom_boxed_message(classes, str) ("
" + str + "
")
+/// Makes a fieldset with a neaty styled name. Can apply additional classes.
+#define fieldset_block(title, content, classes) ("")
+/// Makes a horizontal line with text in the middle
+#define separator_hr(str) ("
" + str + "
")
diff --git a/code/__defines/tgs.dm b/code/__defines/tgs.dm
index 30b8c6e748..b9b539c32e 100644
--- a/code/__defines/tgs.dm
+++ b/code/__defines/tgs.dm
@@ -164,7 +164,7 @@
* * minimum_required_security_level: The minimum required security level to run the game in which the DMAPI is integrated. Can be one of [TGS_SECURITY_ULTRASAFE], [TGS_SECURITY_SAFE], or [TGS_SECURITY_TRUSTED].
* * http_handler - Optional user defined [/datum/tgs_http_handler].
*/
-/world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_TRUSTED, datum/tgs_http_handler/http_handler) //CHOMPEdit we need trusted
+/world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_ULTRASAFE, datum/tgs_http_handler/http_handler)
CAN_BE_REDEFINED(TRUE)
return
@@ -181,7 +181,6 @@
/// Consumers MUST run this macro at the start of [/world/proc/Topic].
#define TGS_TOPIC var/tgs_topic_return = TgsTopic(args[1]); if(tgs_topic_return) return tgs_topic_return
-#define VGS_TOPIC var/vgs_topic_return = VgsTopic(args[1]); if(vgs_topic_return) return vgs_topic_return // VOREStation Edit - VGS
/// Consumers MUST call this as late as possible in [world/proc/Reboot] (BEFORE ..()).
/world/proc/TgsReboot()
diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm
index d484c28e3d..b4f97684ba 100644
--- a/code/controllers/configuration/entries/general.dm
+++ b/code/controllers/configuration/entries/general.dm
@@ -747,3 +747,7 @@
/// Turn this on if you want all admin-PMs to go to be sent to discord, and not only the first message of a ticket.
/datum/config_entry/flag/discord_ahelps_all
default = FALSE
+
+/datum/config_entry/number/rounds_until_hard_restart
+ default = -1
+ min_val = 0
diff --git a/code/controllers/configuration/entries/vorestation.dm b/code/controllers/configuration/entries/vorestation.dm
index ae9730dbc4..3aafac99e6 100644
--- a/code/controllers/configuration/entries/vorestation.dm
+++ b/code/controllers/configuration/entries/vorestation.dm
@@ -2,11 +2,7 @@
/datum/config_entry/flag/items_survive_digestion
default = TRUE
-/datum/config_entry/string/vgs_access_identifier // VGS
- default = null
- protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
-
-/datum/config_entry/number/vgs_server_port // VGS
+/datum/config_entry/number/register_server_port
default = null
min_val = 0
max_val = 65535
diff --git a/code/datums/elements/footstep.dm b/code/datums/elements/footstep.dm
index 59f8906ce7..4c570350d7 100644
--- a/code/datums/elements/footstep.dm
+++ b/code/datums/elements/footstep.dm
@@ -152,7 +152,7 @@
// we are wearing shoes
var/obj/item/clothing/shoes/feet = source.shoes
- if(feet.blocks_footsteps)
+ if(istype(feet) && feet.blocks_footsteps)
var/shoestep_type = prepared_steps[FOOTSTEP_MOB_SHOE]
if(!isnull(shoestep_type) && footstep_sounds[shoestep_type]) // shoestep type can be null
playsound(source.loc, pick(footstep_sounds[shoestep_type][1]),
diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm
index 6da919b139..1ecd7da806 100644
--- a/code/datums/helper_datums/getrev.dm
+++ b/code/datums/helper_datums/getrev.dm
@@ -1,82 +1,91 @@
/datum/getrev
- var/branch
- var/revision
+ var/commit // git rev-parse HEAD
var/date
- var/showinfo
+ var/originmastercommit // git rev-parse origin/master
var/list/testmerge = list()
/datum/getrev/New()
- if(world.TgsAvailable()) // Try TGS maybe
- testmerge = world.TgsTestMerges()
- var/datum/tgs_revision_information/REV = world.TgsRevision()
- if(REV)
- revision = REV.origin_commit || REV.commit
- branch = "-Using TGS-" // TGS doesn't provide branch info yet
- date = "-Using TGS-" // Or date
+ commit = rustg_git_revparse("HEAD")
+ if(commit)
+ date = rustg_git_commit_date(commit)
+ originmastercommit = rustg_git_revparse("origin/master")
- if(!revision) // File parse method
- var/list/head_branch = file2list(".git/HEAD", "\n")
- if(head_branch.len)
- branch = copytext(head_branch[1], 17)
+/datum/getrev/proc/load_tgs_info()
+ testmerge = world.TgsTestMerges()
+ var/datum/tgs_revision_information/revinfo = world.TgsRevision()
+ if(revinfo)
+ commit = revinfo.commit
+ originmastercommit = revinfo.origin_commit
+ date = revinfo.timestamp || rustg_git_commit_date(commit)
- var/list/head_log = file2list(".git/logs/HEAD", "\n")
- for(var/line=head_log.len, line>=1, line--)
- if(head_log[line])
- var/list/last_entry = splittext(head_log[line], " ")
- if(last_entry.len < 2) continue
- revision = last_entry[2]
- // Get date/time
- if(last_entry.len >= 5)
- var/unix_time = text2num(last_entry[5])
- if(unix_time)
- date = unix2date(unix_time)
- break
+ // goes to DD log and config_error.txt
+ log_world(get_log_message())
- to_world_log("-Revision Info-")
- to_world_log("Branch: [branch]")
- to_world_log("Date: [date]")
- to_world_log("Revision: [revision]")
+/datum/getrev/proc/get_log_message()
+ var/list/msg = list()
+ msg += "Running /tg/ revision: [date]"
+ if(originmastercommit)
+ msg += "origin/master: [originmastercommit]"
+
+ for(var/line in testmerge)
+ var/datum/tgs_revision_information/test_merge/tm = line
+ msg += "Test merge active of PR #[tm.number] commit [tm.head_commit]"
+ //SSblackbox.record_feedback("associative", "testmerged_prs", 1, list("number" = "[tm.number]", "commit" = "[tm.head_commit]", "title" = "[tm.title]", "author" = "[tm.author]"))
+
+ if(commit && commit != originmastercommit)
+ msg += "HEAD: [commit]"
+ else if(!originmastercommit)
+ msg += "No commit information"
+
+ msg += "Running rust-g version [rustg_get_version()]"
+
+ return msg.Join("\n")
/datum/getrev/proc/GetTestMergeInfo(header = TRUE)
- . = list()
if(!testmerge.len)
- return
- if(header)
- . += "The following pull requests are currently test merged:"
- for(var/datum/tgs_revision_information/test_merge/tm as anything in testmerge)
- var/cm = tm.head_commit //CHOMPStation Edit TGS4
+ return ""
+ . = header ? "The following pull requests are currently test merged: " : ""
+ for(var/line in testmerge)
+ var/datum/tgs_revision_information/test_merge/tm = line
+ var/cm = tm.head_commit
var/details = ": '" + html_encode(tm.title) + "' by " + html_encode(tm.author) + " at commit " + html_encode(copytext_char(cm, 1, 11))
- if(details && findtext(details, "\[s\]") && (!usr || !usr.client.holder))
- continue
- . += "#[tm.number][details]"
+ . += "#[tm.number][details] "
/client/verb/showrevinfo()
set category = "OOC.Game"
set name = "Show Server Revision"
set desc = "Check the current server code revision"
- if(!GLOB.revdata)
- to_chat(src, span_warning("Please wait until server initializations are complete."))
- return
-
var/list/msg = list()
+ // Round ID
+ if(GLOB.round_id)
+ msg += span_bold("Round ID") + ": [GLOB.round_id]"
- if(GLOB.revdata.revision)
- msg += span_bold("Server revision:") + " B:[GLOB.revdata.branch] D:[GLOB.revdata.date]"
- if(CONFIG_GET(string/githuburl))
- msg += span_bold("Commit:") + " [GLOB.revdata.revision]"
- else
- msg += span_bold("Commit:") + " [GLOB.revdata.revision]" // CHOMPEdit - Actually SHOW the revision
- else
- msg += span_bold("Server revision:") + " Unknown"
+ msg += span_bold("BYOND Version") + ": [world.byond_version].[world.byond_build]"
+ if(DM_VERSION != world.byond_version || DM_BUILD != world.byond_build)
+ msg += span_bold("Compiled with BYOND Version") + ": [DM_VERSION].[DM_BUILD]"
+ // Revision information
+ var/datum/getrev/revdata = GLOB.revdata
+ msg += span_bold("Server revision compiled on") + ": [revdata.date]"
+ var/pc = revdata.originmastercommit
+ if(pc)
+ msg += span_bold("Master commit") + ": [pc]"
+ if(length(revdata.testmerge))
+ msg += revdata.GetTestMergeInfo()
+ if(revdata.commit && revdata.commit != revdata.originmastercommit)
+ msg += span_bold("Local commit") + ": [revdata.commit]"
+ else if(!pc)
+ msg += "No commit information"
if(world.TgsAvailable())
var/datum/tgs_version/version = world.TgsVersion()
- msg += span_bold("TGS version:") + " [version.raw_parameter]"
- var/datum/tgs_version/api_version = world.TgsApiVersion()
- msg += span_bold("DMAPI version:") + " [api_version.raw_parameter]"
+ msg += span_bold("TGS version") + ": [version.raw_parameter]"
+ msg += span_bold("DMAPI version") + ": [TGS_DMAPI_VERSION]"
- if(GLOB.revdata.testmerge.len)
- msg += GLOB.revdata.GetTestMergeInfo()
-
- to_chat(src, msg.Join(" "))
+ // Game mode odds
+ //msg += " Current Informational Settings:"
+ //msg += "Protect Authority Roles From Traitor: [CONFIG_GET(flag/protect_roles_from_antagonist) ? "Yes" : "No"]"
+ //msg += "Protect Assistant Role From Traitor: [CONFIG_GET(flag/protect_assistant_from_antagonist) ? "Yes" : "No"]"
+ //msg += "Enforce Human Authority: [CONFIG_GET(string/human_authority) ? "Yes" : "No"]"
+ //msg += "Allow Latejoin Antagonists: [CONFIG_GET(flag/allow_latejoin_antagonists) ? "Yes" : "No"]"
+ to_chat(src, fieldset_block("Server Revision Info", span_infoplain(jointext(msg, " ")), "boxed_message"), type = MESSAGE_TYPE_INFO)
diff --git a/code/game/world.dm b/code/game/world.dm
index 21644e608e..fc0f79f6fc 100644
--- a/code/game/world.dm
+++ b/code/game/world.dm
@@ -1,3 +1,7 @@
+#define RESTART_COUNTER_PATH "data/round_counter.txt"
+
+GLOBAL_VAR(restart_counter)
+
#define RECOMMENDED_VERSION 513
/world/New()
world_startup_time = world.timeofday
@@ -32,7 +36,7 @@
if(byond_version < RECOMMENDED_VERSION)
to_world_log("Your server's byond version does not meet the recommended requirements for this server. Please update BYOND")
- TgsNew(new /datum/tgs_event_handler/impl, TGS_SECURITY_TRUSTED) // CHOMPEdit - tgs event handler
+ InitTgs()
config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER])
@@ -40,7 +44,6 @@
ConfigLoaded()
makeDatumRefLists()
- VgsNew()
var servername = CONFIG_GET(string/servername)
if(config && servername != null && CONFIG_GET(flag/server_suffix) && world.port > 0)
@@ -103,6 +106,11 @@
return
+/// Initializes TGS and loads the returned revising info into GLOB.revdata
+/world/proc/InitTgs()
+ TgsNew(new /datum/tgs_event_handler/impl, TGS_SECURITY_TRUSTED)
+ GLOB.revdata.load_tgs_info()
+
/// Runs after config is loaded but before Master is initialized
/world/proc/ConfigLoaded()
// Everything in here is prioritized in a very specific way.
@@ -119,12 +127,15 @@
else //probably windows, if not this should work anyway
CONFIG_SET(string/python_path, "python")
+ if(fexists(RESTART_COUNTER_PATH))
+ GLOB.restart_counter = text2num(trim(file2text(RESTART_COUNTER_PATH)))
+ fdel(RESTART_COUNTER_PATH)
+
var/world_topic_spam_protect_ip = "0.0.0.0"
var/world_topic_spam_protect_time = world.timeofday
/world/Topic(T, addr, master, key)
- VGS_TOPIC // VOREStation Edit - VGS //CHOMP Edit swapped lines around
- TGS_TOPIC //CHOMP Edit swapped lines around
+ TGS_TOPIC
log_topic("\"[T]\", from:[addr], master:[master], key:[key]")
if (T == "ping")
@@ -275,8 +286,8 @@ var/world_topic_spam_protect_time = world.timeofday
return list2params(positions)
else if(T == "revision")
- if(GLOB.revdata.revision)
- return list2params(list(branch = GLOB.revdata.branch, date = GLOB.revdata.date, revision = GLOB.revdata.revision))
+ if(GLOB.revdata.commit)
+ return list2params(list(testmerge = GLOB.revdata.testmerge, date = GLOB.revdata.date, commit = GLOB.revdata.commit, originmastercommit = GLOB.revdata.originmastercommit))
else
return "unknown"
@@ -457,6 +468,25 @@ var/world_topic_spam_protect_time = world.timeofday
else
return "Database connection failed or not set up"
+/// Returns TRUE if the world should do a TGS hard reboot.
+/world/proc/check_hard_reboot()
+ if(!TgsAvailable())
+ return FALSE
+ // byond-tracy can't clean up itself, and thus we should always hard reboot if its enabled, to avoid an infinitely growing trace.
+ //if(Tracy?.enabled)
+ // return TRUE
+ var/ruhr = CONFIG_GET(number/rounds_until_hard_restart)
+ switch(ruhr)
+ if(-1)
+ return FALSE
+ if(0)
+ return TRUE
+ else
+ if(GLOB.restart_counter >= ruhr)
+ return TRUE
+ else
+ text2file("[++GLOB.restart_counter]", RESTART_COUNTER_PATH)
+ return FALSE
/world/Reboot(reason = 0, fast_track = FALSE)
/*spawn(0)
@@ -477,6 +507,14 @@ var/world_topic_spam_protect_time = world.timeofday
if(CONFIG_GET(string/server)) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
C << link("byond://[CONFIG_GET(string/server)]")
+ if(check_hard_reboot())
+ log_world("World hard rebooted at [time_stamp()]")
+ //shutdown_logging() // See comment below.
+ //QDEL_NULL(Tracy)
+ //QDEL_NULL(Debugger)
+ TgsEndProcess()
+ return ..()
+
TgsReboot()
log_world("World rebooted at [time_stamp()]")
..()
@@ -774,3 +812,5 @@ var/global/game_id = null
if (debug_server)
call_ext(debug_server, "auxtools_shutdown")()
. = ..()
+
+#undef RESTART_COUNTER_PATH
diff --git a/code/modules/admin/permissionedit.dm b/code/modules/admin/permissionedit.dm
index ef61823dc7..7b0bad2904 100644
--- a/code/modules/admin/permissionedit.dm
+++ b/code/modules/admin/permissionedit.dm
@@ -455,7 +455,13 @@ ADMIN_VERB(edit_admin_permissions, R_PERMISSIONS, "Permissions Panel", "Edit adm
#undef RANK_DONE
+/// Changes, for this round only, the flags a particular admin gets to use
/datum/admins/proc/change_admin_flags(admin_ckey, admin_key, datum/admins/admin_holder)
+ if(!check_rights(R_PERMISSIONS))
+ return
+ if(IsAdminAdvancedProcCall())
+ to_chat(usr, span_adminprefix("Rank Modification blocked: Advanced ProcCall detected."), confidential = TRUE)
+ return
var/new_flags = input_bitfield(
usr,
"Admin rights This will affect only the current admin [admin_key]",
@@ -465,6 +471,8 @@ ADMIN_VERB(edit_admin_permissions, R_PERMISSIONS, "Permissions Panel", "Edit adm
590,
allowed_edit_field = usr.client.holder.can_edit_rights_flags(),
)
+ if(isnull(new_flags))
+ return
admin_holder.disassociate()
diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm
index 7278c29aff..e1b0998fae 100644
--- a/code/modules/client/client procs.dm
+++ b/code/modules/client/client procs.dm
@@ -151,7 +151,10 @@
log_and_message_admins("[ckey] has registered their Discord ID. Their Discord snowflake ID is: [their_id]", src) //YW EDIT
admin_chat_message(message = "[ckey] has registered their Discord ID. Their Discord is: <@[their_id]>", color = "#4eff22") //YW EDIT
notes_add(ckey, "Discord ID: [their_id]")
- world.VgsAddMemberRole(their_id)
+ var/port = CONFIG_GET(number/register_server_port)
+ if(port)
+ // Designed to be used with `tools/registration`
+ world.Export("http://127.0.0.1:[port]?member=[url_encode(json_encode(their_id))]")
else
to_chat(src, span_warning("There was an error registering your Discord ID in the database. Contact an administrator."))
log_and_message_admins("[ckey] failed to register their Discord ID. Their Discord snowflake ID is: [their_id]. Is the database connected?", src)
@@ -352,6 +355,8 @@
alert = TRUE
if(alert)
for(var/client/X in GLOB.admins)
+ if(!check_rights_for(X, R_HOLDER))
+ continue
if(X.prefs?.read_preference(/datum/preference/toggle/holder/play_adminhelp_ping))
X << 'sound/voice/bcriminal.ogg' //ChompEDIT - back to beepsky
window_flash(X)
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 1a407ef0c0..7037762bc1 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -402,8 +402,10 @@ var/list/preferences_datums = list()
if(tgui_alert(user, "Are you sure you want to override slot [slotnum], [choice]'s savedata?", "Confirm Override", list("No", "Yes")) == "Yes")
overwrite_character(slotnum)
sanitize_preferences()
- save_character()
save_preferences()
+ save_character()
+ load_preferences(TRUE)
+ load_character()
attempt_vr(user.client?.prefs_vr,"load_vore","")
ShowChoices(user)
diff --git a/code/modules/client/preferences_tgui.dm b/code/modules/client/preferences_tgui.dm
index 839a1107a7..d6234392de 100644
--- a/code/modules/client/preferences_tgui.dm
+++ b/code/modules/client/preferences_tgui.dm
@@ -136,8 +136,8 @@
switch(action)
// Basic actions
if("load")
- if(!IsGuestKey(usr.key))
- open_load_dialog(usr)
+ if(!IsGuestKey(ui.user.key))
+ open_load_dialog(ui.user)
. = TRUE
if("save")
save_character()
@@ -146,22 +146,22 @@
VARSET_IN(src, saved_notification, FALSE, 1 SECONDS)
. = TRUE
if("reload")
- load_preferences()
+ load_preferences(TRUE)
load_character()
attempt_vr(client.prefs_vr,"load_vore","") //VOREStation Edit
sanitize_preferences()
. = TRUE
if("resetslot")
- if("Yes" != tgui_alert(usr, "This will reset the current slot. Continue?", "Reset current slot?", list("No", "Yes")))
+ if("Yes" != tgui_alert(ui.user, "This will reset the current slot. Continue?", "Reset current slot?", list("No", "Yes")))
return
- if("Yes" != tgui_alert(usr, "Are you completely sure that you want to reset this character slot?", "Reset current slot?", list("No", "Yes")))
+ if("Yes" != tgui_alert(ui.user, "Are you completely sure that you want to reset this character slot?", "Reset current slot?", list("No", "Yes")))
return
reset_slot()
sanitize_preferences()
. = TRUE
if("copy")
- if(!IsGuestKey(usr.key))
- open_copy_dialog(usr)
+ if(!IsGuestKey(ui.user.key))
+ open_copy_dialog(ui.user)
. = TRUE
// More specific stuff
if("switch_category")
@@ -169,11 +169,11 @@
for(var/datum/category_group/player_setup_category/PS in player_setup.categories)
if(PS.name == new_category)
player_setup.selected_category = PS
- update_tgui_static_data(usr, ui)
+ update_tgui_static_data(ui.user, ui)
break
. = TRUE
if("game_prefs")
- usr.client.game_options()
+ ui.user.client.game_options()
. = TRUE
if("refresh_character_preview")
if(!COOLDOWN_FINISHED(src, ui_refresh_cooldown))
@@ -192,7 +192,7 @@
PMH.screen_loc = LAZYACCESS(preview_screen_locs, "PMH")
/datum/preferences/tgui_close(mob/user)
- save_character()
+ // save_character()
save_preferences()
/datum/preferences/proc/create_character_profiles()
diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm
index b35b726c0b..33545d6cdd 100644
--- a/code/modules/client/verbs/ooc.dm
+++ b/code/modules/client/verbs/ooc.dm
@@ -163,7 +163,7 @@
// Admins with RLOOC displayed who weren't already in
for(var/client/admin in GLOB.admins)
if(!(admin in receivers) && admin.prefs?.read_preference(/datum/preference/toggle/holder/show_rlooc))
- if(check_rights_for(admin, R_ADMIN|R_SERVER)) //Stop rLOOC showing for retired staff //CHOMPEdit, admins should see LOOC
+ if(check_rights_for(admin, (R_SERVER|R_ADMIN))) //Stop rLOOC showing for retired staff
r_receivers |= admin
msg = GLOB.is_valid_url.Replace(msg,span_linkify("$1"))
diff --git a/code/modules/client/verbs/who.dm b/code/modules/client/verbs/who.dm
index 91c6253f8d..c46dd22d4f 100644
--- a/code/modules/client/verbs/who.dm
+++ b/code/modules/client/verbs/who.dm
@@ -1,3 +1,5 @@
+#define NO_ADMINS_ONLINE_MESSAGE "Adminhelps are also sent through TGS to services like Discord. If no admins are available in game, sending an adminhelp might still be noticed and responded to."
+
/client/verb/who()
set name = "Who"
set category = "OOC.Resources"
@@ -58,6 +60,8 @@
set category = "Admin"
set name = "Staffwho"
+ var/header = GLOB.admins.len == 0 ? "No Admins Currently Online" : "Current Admins"
+
var/msg = ""
var/modmsg = ""
var/devmsg = ""
@@ -132,6 +136,8 @@
if(CONFIG_GET(flag/show_mentors))
msg += "\n" + span_bold(" Current Mentors ([num_mentors_online]):") + "\n" + mentormsg
- msg += "\n" + span_info("Adminhelps are also sent to Discord. If no admins are available in game try anyway and an admin on Discord may see it and respond.")
+ msg += "\n" + span_info(NO_ADMINS_ONLINE_MESSAGE)
- to_chat(src,span_filter_notice("[jointext(msg, " ")]"))
+ to_chat(src, fieldset_block(span_bold(header), span_filter_notice("[jointext(msg, " ")]"), "boxed_message"), type = MESSAGE_TYPE_INFO)
+
+#undef NO_ADMINS_ONLINE_MESSAGE
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index f4e7589ec1..4d59f9a03f 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -656,7 +656,7 @@ var/global/list/light_type_cache = list()
playsound(src, W.usesound, 75, 1)
user.visible_message("[user.name] opens [src]'s casing.", \
"You open [src]'s casing.", "You hear a noise.")
- new construct_type(src.loc, fixture = src)
+ new construct_type(src.loc, src)
qdel(src)
return
diff --git a/code/modules/tgs/includes.dm b/code/modules/tgs/includes.dm
index bd77c07ecd..f5118ed55a 100644
--- a/code/modules/tgs/includes.dm
+++ b/code/modules/tgs/includes.dm
@@ -14,12 +14,9 @@
#include "v5\_defines.dm"
#include "v5\api.dm"
-#include "v5\api_vgs.dm" //VOREStation Edit - Vgs
#include "v5\bridge.dm"
#include "v5\chunking.dm"
#include "v5\commands.dm"
-#include "v5\chat_commands.dm" //CHOMPEdit
-#include "v5\chat_commands_zz_ch.dm" //CHOMPEdit
#include "v5\serializers.dm"
#include "v5\topic.dm"
#include "v5\undefs.dm"
diff --git a/code/modules/tgs/v5/_defines.dm b/code/modules/tgs/v5/_defines.dm
index 86355dd812..a47bfd7800 100644
--- a/code/modules/tgs/v5/_defines.dm
+++ b/code/modules/tgs/v5/_defines.dm
@@ -15,7 +15,6 @@
#define DMAPI5_BRIDGE_COMMAND_CHAT_SEND 5
#define DMAPI5_BRIDGE_COMMAND_CHUNK 6
#define DMAPI5_BRIDGE_COMMAND_EVENT 7
-#define DMAPI5_BRIDGE_COMMAND_ADD_MEMBER_ROLE 51 // VOREStation Edit
#define DMAPI5_PARAMETER_ACCESS_IDENTIFIER "accessIdentifier"
#define DMAPI5_PARAMETER_CUSTOM_COMMANDS "customCommands"
@@ -37,7 +36,6 @@
#define DMAPI5_BRIDGE_PARAMETER_CHAT_MESSAGE "chatMessage"
#define DMAPI5_BRIDGE_PARAMETER_MINIMUM_SECURITY_LEVEL "minimumSecurityLevel"
#define DMAPI5_BRIDGE_PARAMETER_EVENT_INVOCATION "eventInvocation"
-#define DMAPI5_BRIDGE_PARAMETER_CHAT_USER_ID "chatUserId" // VOREStation Edit
#define DMAPI5_BRIDGE_RESPONSE_NEW_PORT "newPort"
#define DMAPI5_BRIDGE_RESPONSE_RUNTIME_INFORMATION "runtimeInformation"
@@ -86,7 +84,6 @@
#define DMAPI5_TOPIC_COMMAND_RECEIVE_CHUNK 10
#define DMAPI5_TOPIC_COMMAND_RECEIVE_BROADCAST 11
#define DMAPI5_TOPIC_COMMAND_COMPLETE_EVENT 12
-#define DMAPI5_TOPIC_COMMAND_GET_CHAT_COMMANDS 51 // VOREStation Edit - GetChatCommands command
#define DMAPI5_TOPIC_PARAMETER_COMMAND_TYPE "commandType"
#define DMAPI5_TOPIC_PARAMETER_CHAT_COMMAND "chatCommand"
diff --git a/code/modules/tgs/v5/api_vgs.dm b/code/modules/tgs/v5/api_vgs.dm
deleted file mode 100644
index 1f05bd1d08..0000000000
--- a/code/modules/tgs/v5/api_vgs.dm
+++ /dev/null
@@ -1,90 +0,0 @@
-// We currently isolate ourselves in a different variable so that only the specific APIs we choose will be active.
-// Eventually it would be good to handle all the TGS Apis properly and we can use the same.
-GLOBAL_DATUM(vgs, /datum/tgs_api)
-
-// Supply our own New functionality so we can read from config instead of world params
-/world/proc/VgsNew(datum/tgs_event_handler/event_handler)
- var/current_api = GLOB.vgs
- if(current_api)
- TGS_ERROR_LOG("API datum already set (\ref[current_api] ([current_api]))! Was TgsNew() called more than once?")
- return
-
- // If we don't have a configured access identifier we aren't meant to use VGS
- if(!CONFIG_GET(string/vgs_access_identifier))
- TGS_INFO_LOG("Skipping VGS: No access identifier configured")
- return
-
- var/datum/tgs_api/api_datum = /datum/tgs_api/v5/vgs1
- TGS_INFO_LOG("Activating API for version [api_datum]")
-
- if(event_handler && !istype(event_handler))
- TGS_ERROR_LOG("Invalid parameter for event_handler: [event_handler]")
- event_handler = null
-
- var/datum/tgs_api/new_api = new api_datum(event_handler)
- GLOB.vgs = new_api
-
- var/result = new_api.OnWorldNew()
- if(!result || result == TGS_UNIMPLEMENTED)
- GLOB.vgs = null
- TGS_ERROR_LOG("Failed to activate API!")
-
-/world/proc/VgsTopic(T)
- var/datum/tgs_api/api = GLOB.vgs
- if(api)
- var/result = api.OnTopic(T)
- if(result != TGS_UNIMPLEMENTED)
- return result
-
-/world/TgsReboot()
- var/datum/tgs_api/api = GLOB.vgs
- if(api)
- api.OnReboot()
- else
- return ..()
-
-/world/TgsInitializationComplete()
- var/datum/tgs_api/api = GLOB.vgs
- if(api)
- api.OnInitializationComplete()
- else
- return ..()
-
-/world/proc/VgsAddMemberRole(chat_user_id)
- var/datum/tgs_api/v5/vgs1/api = GLOB.vgs
- if(api)
- api.AddMemberRole(chat_user_id)
-
-/datum/tgs_api/v5/vgs1
- server_port = 8080 // Default port
-
-// Override to prevent error messages from the lack of revision/test_merge information, and to use config isntead of params.
-/datum/tgs_api/v5/vgs1/OnWorldNew()
- if(CONFIG_GET(number/vgs_server_port))
- server_port = CONFIG_GET(number/vgs_server_port)
- access_identifier = CONFIG_GET(string/vgs_access_identifier)
-
- var/list/bridge_response = Bridge(DMAPI5_BRIDGE_COMMAND_STARTUP, list(DMAPI5_PARAMETER_CUSTOM_COMMANDS = ListCustomCommands())) //CHOMPEdit TGS update
- if(!istype(bridge_response))
- TGS_ERROR_LOG("Failed initial bridge request!")
- return FALSE
-
- var/list/runtime_information = bridge_response[DMAPI5_BRIDGE_RESPONSE_RUNTIME_INFORMATION]
- if(!istype(runtime_information))
- TGS_ERROR_LOG("Failed to decode runtime information from bridge response: [json_encode(bridge_response)]!")
- return FALSE
-
- version = new /datum/tgs_version(runtime_information[DMAPI5_RUNTIME_INFORMATION_SERVER_VERSION])
- instance_name = runtime_information[DMAPI5_RUNTIME_INFORMATION_INSTANCE_NAME]
-
- chat_channels = list()
- DecodeChannels(runtime_information)
-
- return TRUE
-
-/datum/tgs_api/v5/vgs1/proc/AddMemberRole(chat_user_id)
- Bridge(DMAPI5_BRIDGE_COMMAND_ADD_MEMBER_ROLE, list(DMAPI5_BRIDGE_PARAMETER_CHAT_USER_ID = chat_user_id))
-
-// /datum/tgs_api/v5/vgs1/RequireInitialBridgeResponse()
-// while(!instance_name)
-// sleep(1)
diff --git a/code/modules/tgs/v5/topic.dm b/code/modules/tgs/v5/topic.dm
index d0e25b3c01..59e5e63e5c 100644
--- a/code/modules/tgs/v5/topic.dm
+++ b/code/modules/tgs/v5/topic.dm
@@ -60,12 +60,6 @@
intercepted_message_queue = null
return result
- // VOREStation Edit Start - GetChatCommands command
- if(DMAPI5_TOPIC_COMMAND_GET_CHAT_COMMANDS)
- var/topic_response = list(DMAPI5_PARAMETER_CUSTOM_COMMANDS = ListCustomCommands())
- return json_encode(topic_response)
- // VOREStation Edit - End
-
if(DMAPI5_TOPIC_COMMAND_EVENT_NOTIFICATION)
var/list/event_notification = topic_parameters[DMAPI5_TOPIC_PARAMETER_EVENT_NOTIFICATION]
if(!istype(event_notification))
diff --git a/code/modules/tgs/v5/undefs.dm b/code/modules/tgs/v5/undefs.dm
index 66c662e768..ca49e46cdf 100644
--- a/code/modules/tgs/v5/undefs.dm
+++ b/code/modules/tgs/v5/undefs.dm
@@ -15,7 +15,6 @@
#undef DMAPI5_BRIDGE_COMMAND_CHAT_SEND
#undef DMAPI5_BRIDGE_COMMAND_CHUNK
#undef DMAPI5_BRIDGE_COMMAND_EVENT
-#undef DMAPI5_BRIDGE_COMMAND_ADD_MEMBER_ROLE // VOREStation Edit
#undef DMAPI5_PARAMETER_ACCESS_IDENTIFIER
#undef DMAPI5_PARAMETER_CUSTOM_COMMANDS
@@ -37,7 +36,6 @@
#undef DMAPI5_BRIDGE_PARAMETER_CHAT_MESSAGE
#undef DMAPI5_BRIDGE_PARAMETER_MINIMUM_SECURITY_LEVEL
#undef DMAPI5_BRIDGE_PARAMETER_EVENT_INVOCATION
-#undef DMAPI5_BRIDGE_PARAMETER_CHAT_USER_ID // VOREStation Edit
#undef DMAPI5_BRIDGE_RESPONSE_NEW_PORT
#undef DMAPI5_BRIDGE_RESPONSE_RUNTIME_INFORMATION
@@ -86,7 +84,6 @@
#undef DMAPI5_TOPIC_COMMAND_RECEIVE_CHUNK
#undef DMAPI5_TOPIC_COMMAND_RECEIVE_BROADCAST
#undef DMAPI5_TOPIC_COMMAND_COMPLETE_EVENT
-#undef DMAPI5_TOPIC_COMMAND_GET_CHAT_COMMANDS // VOREStation Edit - Custom Commands
#undef DMAPI5_TOPIC_PARAMETER_COMMAND_TYPE
#undef DMAPI5_TOPIC_PARAMETER_CHAT_COMMAND
diff --git a/code/modules/tgs/v5/chat_commands_zz_ch.dm b/code/modules/tgs_commands/chompstation.dm
similarity index 91%
rename from code/modules/tgs/v5/chat_commands_zz_ch.dm
rename to code/modules/tgs_commands/chompstation.dm
index 276cbfa786..2b3ec24f34 100644
--- a/code/modules/tgs/v5/chat_commands_zz_ch.dm
+++ b/code/modules/tgs_commands/chompstation.dm
@@ -116,3 +116,15 @@
/datum/tgs_chat_command/vore/Run(datum/tgs_chat_user/sender, params)
return "vore"
+
+// - FAX
+/datum/tgs_chat_command/readfax
+ name = "readfax"
+ help_text = "Reads a fax with specified faxid"
+ admin_only = TRUE
+
+/datum/tgs_chat_command/readfax/Run(sender, params)
+ var/list/all_params = splittext(params, " ")
+ var/faxid = all_params[1]
+ var/faxmsg = return_file_text("[CONFIG_GET(string/fax_export_dir)]/fax_[faxid].html")
+ return "FAX: ```[strip_html_properly(faxmsg)]```"
diff --git a/code/modules/tgs/v5/chat_commands.dm b/code/modules/tgs_commands/vorestation.dm
similarity index 81%
rename from code/modules/tgs/v5/chat_commands.dm
rename to code/modules/tgs_commands/vorestation.dm
index b0769257a4..fedde105a8 100644
--- a/code/modules/tgs/v5/chat_commands.dm
+++ b/code/modules/tgs_commands/vorestation.dm
@@ -8,23 +8,21 @@
var/afks = 0
var/active = 0
var/bellied = 0
-// var/map_name = "n/a" //CHOMP Remove we don't use this and it is causing problems with the dmb compiler.
-// if(using_map && using_map.full_name)
-// map_name = using_map.full_name
+ var/map_name = "n/a"
+ if(using_map && using_map.full_name)
+ map_name = using_map.full_name
- for(var/X in GLOB.clients)
- var/client/C = X
- if(C)
- counts++
- if(!(isnewplayer(C.mob) || istype(C.mob, /mob/observer)))
- if(C.mob && isbelly(C.mob.loc))
- bellied++
- if(C.is_afk())
- afks++
- else
- active++
+ for(var/client/C in GLOB.clients)
+ counts++
+ if(!(isnewplayer(C.mob) || istype(C.mob, /mob/observer)))
+ if(C.mob && isbelly(C.mob.loc))
+ bellied++
+ if(C.is_afk())
+ afks++
+ else
+ active++
- return "Current server status:\n**Web Manifest:** \n**Players:** [counts]\n**Active:** [active]\n**Bar Statues:** [afks]\n**Bellied:** [bellied]\n\n**Round Duration:** [roundduration2text()]" //CHOMPEdit
+ return "Current server status:\n**Web Manifest:** \n**Players:** [counts]\n**Active:** [active]\n**Bar Statues:** [afks]\n**Bellied:** [bellied]\n\n**Round Duration:** [roundduration2text()]\n**Current Map:** [map_name]" // CHOMPEdit
/datum/tgs_chat_command/parsetest
name = "parsetest"
@@ -140,21 +138,3 @@ GLOBAL_LIST_EMPTY(pending_discord_registrations)
GLOB.pending_discord_registrations[GLOB.pending_discord_registrations.len] = list("ckey" = key_to_find, "id" = sender.id, "time" = world.realtime)
return "[sender.friendly_name], I've sent you a message in-game. Please verify your username there to complete your registration within 10 minutes."
-
-/*//YW Commands //CHOMP Commenting this out for now. Should now be using Virgo's version.
-//Status
-/datum/tgs_chat_command/status/Run(datum/tgs_chat_user/sender, params)
- return "Current server status:**Players:** [TGS_CLIENT_COUNT]\n**Round Duration:** [roundduration2text()]"
-*/
-// - FAX
-/datum/tgs_chat_command/readfax
- name = "readfax"
- help_text = "Reads a fax with specified faxid"
- //required_parameters = 1 Is not a thing
- admin_only = TRUE
-
-/datum/tgs_chat_command/readfax/Run(sender, params)
- var/list/all_params = splittext(params, " ")
- var/faxid = all_params[1]
- var/faxmsg = return_file_text("[CONFIG_GET(string/fax_export_dir)]/fax_[faxid].html") // CHOMPEdit
- return "FAX: ```[strip_html_properly(faxmsg)]```"
diff --git a/code/modules/tickets/procs.dm b/code/modules/tickets/procs.dm
index 2cd19a236d..11255afb26 100644
--- a/code/modules/tickets/procs.dm
+++ b/code/modules/tickets/procs.dm
@@ -55,7 +55,7 @@ ADMIN_VERB(cmd_mentor_ticket_panel, (R_ADMIN|R_SERVER|R_MOD|R_MENTOR), "Mentor T
GLOB.tickets.BrowseTickets(browse_to)
/proc/message_mentors(var/msg)
- msg = span_mentor_channel(span_prefix("Mentor:") + span_message("[msg]"))
+ msg = span_mentor_channel(span_prefix("Mentor: ") + span_message("[msg]"))
for(var/client/C in GLOB.admins)
to_chat(C, msg)
diff --git a/code/modules/tickets/tickets.dm b/code/modules/tickets/tickets.dm
index bc19e56111..760aa86450 100644
--- a/code/modules/tickets/tickets.dm
+++ b/code/modules/tickets/tickets.dm
@@ -20,6 +20,7 @@
else
world.TgsTargetedChatBroadcast(message,TRUE)
+//
//TICKET MANAGER
//
@@ -318,9 +319,9 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick/ticket_list)
var/list/activemins = adm["present"]
var activeMins = activemins.len
if(is_bwoink)
- ahelp_discord_message("ADMINHELP: FROM: [key_name_admin(usr)] TO [initiator_ckey]/[initiator_key_name] - MSG: **[msg]** - Heard by [activeMins] NON-AFK staff members.")
+ ahelp_discord_message("[level == 0 ? "MENTORHELP" : "ADMINHELP"]: FROM: [key_name_admin(usr)] TO [initiator_ckey]/[initiator_key_name] - MSG: **[msg]** - Heard by [activeMins] NON-AFK staff members.")
else
- ahelp_discord_message("ADMINHELP: FROM: [initiator_ckey]/[initiator_key_name] - MSG: **[msg]** - Heard by [activeMins] NON-AFK staff members.")
+ ahelp_discord_message("[level == 0 ? "MENTORHELP" : "ADMINHELP"]: FROM: [initiator_ckey]/[initiator_key_name] - MSG: **[msg]** - Heard by [activeMins] NON-AFK staff members.")
// Also send it to discord since that's the hip cool thing now.
SSwebhooks.send(
@@ -357,11 +358,11 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick/ticket_list)
tgui_interact(usr.client.mob)
//private
-/datum/ticket/proc/FullMonty(ref_src, admin = FALSE)
+/datum/ticket/proc/FullMonty(ref_src, admin_commands = FALSE)
if(!ref_src)
ref_src = "\ref[src]"
if(initiator && initiator.mob)
- if(admin)
+ if(admin_commands)
. = ADMIN_FULLMONTY_NONAME(initiator.mob)
else
. = "Initiator disconnected."
@@ -403,22 +404,26 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick/ticket_list)
//won't bug irc
/datum/ticket/proc/MessageNoRecipient(msg)
var/ref_src = "\ref[src]"
- var/chat_msg = span_admin_pm_notice(span_adminhelp("Ticket [TicketHref("#[id]", ref_src)]") + span_bold(": [LinkedReplyName(ref_src)] [FullMonty(ref_src)]:") + msg)
AddInteraction(span_red("[LinkedReplyName(ref_src)]: [msg]"))
//send this msg to all admins
- if(level == 0)
- for (var/client/C in GLOB.admins)
- if (C.prefs?.read_preference(/datum/preference/toggle/play_mentorhelp_ping))
- C << 'sound/effects/mentorhelp.mp3'
- message_mentors(chat_msg)
- else if(level == 1)
- for(var/client/X in GLOB.admins)
- if(X.prefs?.read_preference(/datum/preference/toggle/holder/play_adminhelp_ping))
- X << 'sound/effects/adminhelp.ogg'
- window_flash(X)
- to_chat(X, chat_msg)
+ switch(level)
+ if(0)
+ for (var/client/C in GLOB.admins)
+ var/chat_msg = span_mentor_channel(span_admin_pm_notice(span_adminhelp("Ticket [TicketHref("#[id]", ref_src)]") + span_bold(" (Mentor): [LinkedReplyName(ref_src)] [FullMonty(ref_src, check_rights_for(C, (R_ADMIN|R_SERVER|R_MOD)))]:") + msg))
+ if (C.prefs?.read_preference(/datum/preference/toggle/play_mentorhelp_ping))
+ C << 'sound/effects/mentorhelp.mp3'
+ to_chat(C, chat_msg)
+ if(1)
+ for(var/client/X in GLOB.admins)
+ var/chat_msg = span_admin_pm_notice(span_adminhelp("Ticket [TicketHref("#[id]", ref_src)] (Admin)") + span_bold(": [LinkedReplyName(ref_src)] [FullMonty(ref_src, check_rights_for(X, (R_ADMIN|R_SERVER|R_MOD)))]:") + msg)
+ if(!check_rights_for(X, R_HOLDER))
+ continue
+ if(X.prefs?.read_preference(/datum/preference/toggle/holder/play_adminhelp_ping))
+ X << 'sound/effects/adminhelp.ogg'
+ window_flash(X)
+ to_chat(X, chat_msg)
/*
//Reopen a closed ticket
@@ -649,6 +654,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick/ticket_list)
level = level + 1
+ AddInteraction("[key_name_admin(usr)] escalated Ticket.")
message_mentors("[usr.ckey] escalated Ticket [TicketHref("#[id]")]")
log_admin("[key_name(usr)] escalated ticket [src.name]")
to_chat(src.initiator, span_mentor("[usr.ckey] escalated your ticket to admins."))
diff --git a/code/modules/tickets/tickets_ui.dm b/code/modules/tickets/tickets_ui.dm
index a41dd7398a..3bb42e44ef 100644
--- a/code/modules/tickets/tickets_ui.dm
+++ b/code/modules/tickets/tickets_ui.dm
@@ -45,7 +45,7 @@
"closed_at" = (world.time - T.closed_at),
"opened_at_date" = gameTimestamp(wtime = T.opened_at),
"closed_at_date" = gameTimestamp(wtime = T.closed_at),
- "actions" = check_rights_for(user.client, (R_ADMIN|R_SERVER|R_MOD)) ? T.FullMonty(,TRUE) : T.FullMonty(),
+ "actions" = T.FullMonty(null, check_rights_for(user.client, (R_ADMIN|R_SERVER|R_MOD))),
"log" = T._interactions,
)
@@ -235,7 +235,7 @@
data["opened_at_date"] = gameTimestamp(wtime = opened_at)
data["closed_at_date"] = gameTimestamp(wtime = closed_at)
- data["actions"] = check_rights_for(user.client, (R_ADMIN|R_SERVER|R_MOD)) ? FullMonty(ref_src, TRUE) : FullMonty(ref_src)
+ data["actions"] = FullMonty(ref_src, check_rights_for(user.client, (R_ADMIN|R_SERVER|R_MOD)))
data["log"] = _interactions
@@ -296,7 +296,7 @@
dat += " Closed at: [gameTimestamp(wtime = closed_at)] (Approx [(world.time - closed_at) / 600] minutes ago)"
dat += "
"
if(initiator)
- dat += span_bold("Actions:") + " [check_rights_for(user.client, (R_ADMIN|R_SERVER|R_MOD)) ? FullMonty(ref_src, TRUE) : FullMonty(ref_src)] "
+ dat += span_bold("Actions:") + " [FullMonty(ref_src, check_rights_for(user.client, (R_ADMIN|R_SERVER|R_MOD)))] "
else
dat += span_bold("DISCONNECTED") + "[GLOB.TAB][ClosureLinks(ref_src)] "
dat += " Log: