Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions code/datums/helper_datums/getrev.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var/global/datum/getrev/revdata = new()
to_world_log(branch)
to_world_log(date)
to_world_log(revision)

/* // HEARTH EDIT
/client/verb/showrevinfo()
set category = "OOC"
set name = "Show Server Revision"
Expand All @@ -43,4 +43,5 @@ var/global/datum/getrev/revdata = new()
else
to_chat(src, "<b>Server Revision:</b> Revision Unknown")
to_chat(src, "Game ID: <b>[game_id]</b>")
to_chat(src, "Current map: [global.using_map.full_name]")
to_chat(src, "Current map: [global.using_map.full_name]")
*/ //END HEARTH EDIT
2 changes: 1 addition & 1 deletion mods/utility/tgsv4_integration/___tgs.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#include "hooks.dm"
#include "webhook_defines.dm"
#include "chat_commands.dm"
#include "getrev.dm"
#include "tgs2webhook_manifest.dm"
//#include "decls.dm"
#endif
2 changes: 1 addition & 1 deletion mods/utility/tgsv4_integration/__tgs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define TGS_PROTECT_DATUM(Path)

/// Display an announcement `message` from the server to all players.
#define TGS_WORLD_ANNOUNCE(message) to_chat(world, "<span class='boldannounce'>[html_encode(##message)]</span>")
#define TGS_WORLD_ANNOUNCE(message) to_world("<span class='boldannounce'>[html_encode(##message)]</span>")

/// Notify current in-game administrators of a string `event`.
#define TGS_NOTIFY_ADMINS(event) log_and_message_admins(message)
Expand Down
2 changes: 1 addition & 1 deletion mods/utility/tgsv4_integration/chat_commands.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/datum/tgs_chat_command/tgscheck/Run(datum/tgs_chat_user/sender, params)
var/server = config.server
return "[game_id ? "Round #[game_id]: " : ""][global.clients.len] players on [global.using_map.full_name], Mode: [SSticker.mode ? SSticker.mode.name : "Not started"]; Round [Master.current_runlevel >= RUNLEVEL_GAME ? (Master.current_runlevel == RUNLEVEL_GAME ? "Active" : "Finishing") : "Starting"] -- [server ? server : "[world.internet_address]:[world.port]"]"
return "[game_id ? "Round #[game_id]: " : ""][global.clients.len] players on [global.using_map.full_name], Mode: [SSticker.mode ? PUBLIC_GAME_MODE : "Not started"]; Round [GAME_STATE >= RUNLEVEL_GAME ? (GAME_STATE == RUNLEVEL_GAME ? "Active" : "Finishing") : "Starting"] -- [server ? server : "[world.internet_address]:[world.port]"]"

/datum/tgs_chat_command/tgs_manifest_webhook
name = "manifest"
Expand Down
13 changes: 0 additions & 13 deletions mods/utility/tgsv4_integration/decls.dm

This file was deleted.

67 changes: 67 additions & 0 deletions mods/utility/tgsv4_integration/getrev.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/datum/getrev
var/origincommit // git rev-parse origin/dev
var/list/testmerge = list()

/datum/getrev/proc/load_tgs_info()
testmerge = world.TgsTestMerges()
var/datum/tgs_revision_information/revinfo = world.TgsRevision()
if(revinfo)
revision = revinfo.commit
origincommit = revinfo.origin_commit
date = revinfo.timestamp

// goes to DD log and config_error.txt
log_world(get_log_message())

/datum/getrev/proc/get_log_message()
var/list/msg = list()
msg += "Running Hearth of Hestia revision: [date]"
if(origincommit)
msg += "Origin commit: [origincommit]"

for(var/datum/tgs_revision_information/test_merge/tm as anything in testmerge)
msg += "Test merge active of PR #[tm.number] commit [tm.head_commit]"

if(revision && revision != origincommit)
msg += "HEAD: [revision]"
else if(!origincommit)
msg += "No commit information"

return msg.Join("\n")

/datum/getrev/proc/GetTestMergeInfo(header = TRUE)
if(!testmerge.len)
return ""
. = header ? "The following pull requests are currently test merged:<br>" : ""
for(var/datum/tgs_revision_information/test_merge/tm as anything in testmerge)
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
. += "<a href=\"[config.githuburl]/pull/[tm.number]\">#[tm.number][details]</a><br>"

/client/verb/showrevinfo()
set category = "OOC"
set name = "Show Server Revision"
set desc = "Check the current server code revision"

to_chat(src, "<b>Game ID:</b> [game_id]>")
to_chat(src, "<b>Client BYOND Version:</b> [byond_version].[byond_build]")
to_chat(src, "<b>Server BYOND Version:</b> [world.byond_version].[world.byond_build]")
if(DM_VERSION != world.byond_version || DM_BUILD != world.byond_build)
to_chat(src, "<b>Compiled with BYOND Version:</b> [DM_VERSION].[DM_BUILD]")
to_chat(src, "<b>Current map:</b> [global.using_map.full_name]")
if(global.revdata.branch)
to_chat(src, "<b>Origin branch:</b> [global.revdata.branch]")
var/parent_commit = global.revdata.origincommit
if(parent_commit)
to_chat(src, "<b>Origin commit:</b> <a href=\"[config.githuburl]/commit/[parent_commit]\">[parent_commit]</a>")
if(global.revdata.testmerge.len)
to_chat(src, global.revdata.GetTestMergeInfo())
if(global.revdata.revision && global.revdata.revision != parent_commit)
to_chat(src, "<b>Local commit:</b> [global.revdata.revision]")
if(world.TgsAvailable())
var/datum/tgs_version/version = world.TgsVersion()
to_chat(src, "<b>TGS version:</b> [version.raw_parameter]")
var/datum/tgs_version/api_version = world.TgsApiVersion()
to_chat(src, "<b>DMAPI version:</b> [api_version.raw_parameter]")
1 change: 1 addition & 0 deletions mods/utility/tgsv4_integration/hooks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

/hook/global_init/proc/tgs_on_init()
world.TgsInitializationComplete()
global.revdata.load_tgs_info()
return TRUE

/hook/shutdown/proc/tgs_on_shutdown()
Expand Down
2 changes: 1 addition & 1 deletion mods/utility/tgsv4_integration/tgs/decls.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/decl/topic_command/tgs
base_type = /decl/topic_command/tgs
#ifdef TGS_V3_AI
#ifdef TGS_V3_API
/decl/topic_command/tgs/three
name = SERVICE_CMD_PARAM_COMMAND
#endif
Expand Down