mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 07:27:18 +01:00
add revision info
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
var/instance_name
|
||||
var/originmastercommit
|
||||
var/commit
|
||||
var/revision_date
|
||||
var/list/cached_custom_tgs_chat_commands
|
||||
var/warned_revison = FALSE
|
||||
var/warned_custom_commands = FALSE
|
||||
@@ -76,6 +77,13 @@
|
||||
logs = splittext(logs[logs.len], " ")
|
||||
if (logs.len >= 2)
|
||||
originmastercommit = logs[2]
|
||||
if(logs.len >= 5)
|
||||
revision_date_epoch = text2num(logs[5])
|
||||
if(isnum(revision_date_epoch))
|
||||
revision_date = unix_epoch_to_iso_timestamp(revision_date_epoch)
|
||||
else
|
||||
revision_date = ""
|
||||
TGS_ERROR_LOG("Error parsing origin commmit logs")
|
||||
else
|
||||
TGS_ERROR_LOG("Error parsing origin commmit logs")
|
||||
|
||||
@@ -184,6 +192,7 @@
|
||||
var/datum/tgs_revision_information/ri = new
|
||||
ri.commit = commit
|
||||
ri.origin_commit = originmastercommit
|
||||
ri.timestamp = revision_date
|
||||
return ri
|
||||
|
||||
/datum/tgs_api/v3210/EndProcess()
|
||||
@@ -211,6 +220,13 @@
|
||||
/datum/tgs_api/v3210/SecurityLevel()
|
||||
return TGS_SECURITY_TRUSTED
|
||||
|
||||
/datum/tgs_api/v3210/proc/unix_epoch_to_iso_timestamp(epoch)
|
||||
epoch += world.timezone * 3600 // adjust for timezone
|
||||
epoch -= 946684800 // adjust for unix to byond epoch lapse (30 years)
|
||||
epoch *= 10 // adjust for time2text expecting decisonds
|
||||
// third paramter is timezone, which only works for versions 514+. but we can put a 0 here and itll be the same for old versions
|
||||
return time2text(epoch, "YYYY-MM-DDThh:mm:ss", 0)
|
||||
|
||||
#undef REBOOT_MODE_NORMAL
|
||||
#undef REBOOT_MODE_HARD
|
||||
#undef REBOOT_MODE_SHUTDOWN
|
||||
|
||||
Reference in New Issue
Block a user