mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 17:14:47 +01:00
Automatic TGS DMAPI Update (#79177)
This pull request updates the TGS DMAPI to the latest version. Please note any changes that may be breaking or unimplemented in your codebase by checking what changes are in the definitions file: code/__DEFINES/tgs.dm before merging. Co-authored-by: tgstation-server <tgstation-server@users.noreply.github.com> Co-authored-by: Jordan Dominion <Cyberboss@users.noreply.github.com>
This commit is contained in:
+12
-1
@@ -1,6 +1,6 @@
|
||||
// tgstation-server DMAPI
|
||||
|
||||
#define TGS_DMAPI_VERSION "6.5.3"
|
||||
#define TGS_DMAPI_VERSION "6.6.2"
|
||||
|
||||
// All functions and datums outside this document are subject to change with any version and should not be relied on.
|
||||
|
||||
@@ -129,6 +129,13 @@
|
||||
/// DreamDaemon Ultrasafe security level.
|
||||
#define TGS_SECURITY_ULTRASAFE 2
|
||||
|
||||
/// DreamDaemon public visibility level.
|
||||
#define TGS_VISIBILITY_PUBLIC 0
|
||||
/// DreamDaemon private visibility level.
|
||||
#define TGS_VISIBILITY_PRIVATE 1
|
||||
/// DreamDaemon invisible visibility level.
|
||||
#define TGS_VISIBILITY_INVISIBLE 2
|
||||
|
||||
//REQUIRED HOOKS
|
||||
|
||||
/**
|
||||
@@ -458,6 +465,10 @@
|
||||
/world/proc/TgsSecurityLevel()
|
||||
return
|
||||
|
||||
/// Returns the current BYOND visibility level as a TGS_VISIBILITY_ define if TGS is present, null otherwise. Requires TGS to be using interop API version 5 or higher otherwise the string "___unimplemented" wil be returned. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
|
||||
/world/proc/TgsVisibility()
|
||||
return
|
||||
|
||||
/// Returns a list of active [/datum/tgs_revision_information/test_merge]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
|
||||
/world/proc/TgsTestMerges()
|
||||
return
|
||||
|
||||
@@ -153,4 +153,9 @@
|
||||
/world/TgsSecurityLevel()
|
||||
var/datum/tgs_api/api = TGS_READ_GLOBAL(tgs)
|
||||
if(api)
|
||||
api.SecurityLevel()
|
||||
return api.SecurityLevel()
|
||||
|
||||
/world/TgsVisibility()
|
||||
var/datum/tgs_api/api = TGS_READ_GLOBAL(tgs)
|
||||
if(api)
|
||||
return api.Visibility()
|
||||
|
||||
@@ -11,6 +11,15 @@ TGS_DEFINE_AND_SET_GLOBAL(tgs, null)
|
||||
src.event_handler = event_handler
|
||||
src.version = version
|
||||
|
||||
/datum/tgs_api/proc/TerminateWorld()
|
||||
while(TRUE)
|
||||
TGS_DEBUG_LOG("About to terminate world. Tick: [world.time], sleep_offline: [world.sleep_offline]")
|
||||
world.sleep_offline = FALSE // https://www.byond.com/forum/post/2894866
|
||||
del(world)
|
||||
world.sleep_offline = FALSE // just in case, this is BYOND after all...
|
||||
sleep(1)
|
||||
TGS_DEBUG_LOG("BYOND DIDN'T TERMINATE THE WORLD!!! TICK IS: [world.time], sleep_offline: [world.sleep_offline]")
|
||||
|
||||
/datum/tgs_api/latest
|
||||
parent_type = /datum/tgs_api/v5
|
||||
|
||||
@@ -57,3 +66,6 @@ TGS_PROTECT_DATUM(/datum/tgs_api)
|
||||
|
||||
/datum/tgs_api/proc/SecurityLevel()
|
||||
return TGS_UNIMPLEMENTED
|
||||
|
||||
/datum/tgs_api/proc/Visibility()
|
||||
return TGS_UNIMPLEMENTED
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
if(cached_json["apiValidateOnly"])
|
||||
TGS_INFO_LOG("Validating API and exiting...")
|
||||
Export(TGS4_COMM_VALIDATE, list(TGS4_PARAMETER_DATA = "[minimum_required_security_level]"))
|
||||
del(world)
|
||||
TerminateWorld()
|
||||
|
||||
security_level = cached_json["securityLevel"]
|
||||
chat_channels_json_path = cached_json["chatChannelsJson"]
|
||||
@@ -188,7 +188,7 @@
|
||||
requesting_new_port = TRUE
|
||||
if(!world.OpenPort(0)) //open any port
|
||||
TGS_ERROR_LOG("Unable to open random port to retrieve new port![TGS4_PORT_CRITFAIL_MESSAGE]")
|
||||
del(world)
|
||||
TerminateWorld()
|
||||
|
||||
//request a new port
|
||||
export_lock = FALSE
|
||||
@@ -196,16 +196,16 @@
|
||||
|
||||
if(!new_port_json)
|
||||
TGS_ERROR_LOG("No new port response from server![TGS4_PORT_CRITFAIL_MESSAGE]")
|
||||
del(world)
|
||||
TerminateWorld()
|
||||
|
||||
var/new_port = new_port_json[TGS4_PARAMETER_DATA]
|
||||
if(!isnum(new_port) || new_port <= 0)
|
||||
TGS_ERROR_LOG("Malformed new port json ([json_encode(new_port_json)])![TGS4_PORT_CRITFAIL_MESSAGE]")
|
||||
del(world)
|
||||
TerminateWorld()
|
||||
|
||||
if(new_port != world.port && !world.OpenPort(new_port))
|
||||
TGS_ERROR_LOG("Unable to open port [new_port]![TGS4_PORT_CRITFAIL_MESSAGE]")
|
||||
del(world)
|
||||
TerminateWorld()
|
||||
requesting_new_port = FALSE
|
||||
|
||||
while(export_lock)
|
||||
|
||||
@@ -1 +1 @@
|
||||
"5.6.1"
|
||||
"5.6.2"
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#define DMAPI5_RUNTIME_INFORMATION_REVISION "revision"
|
||||
#define DMAPI5_RUNTIME_INFORMATION_TEST_MERGES "testMerges"
|
||||
#define DMAPI5_RUNTIME_INFORMATION_SECURITY_LEVEL "securityLevel"
|
||||
#define DMAPI5_RUNTIME_INFORMATION_VISIBILITY "visibility"
|
||||
|
||||
#define DMAPI5_CHAT_UPDATE_CHANNELS "channels"
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
var/instance_name
|
||||
var/security_level
|
||||
var/visibility
|
||||
|
||||
var/reboot_mode = TGS_REBOOT_MODE_NORMAL
|
||||
|
||||
@@ -50,10 +51,11 @@
|
||||
|
||||
if(runtime_information[DMAPI5_RUNTIME_INFORMATION_API_VALIDATE_ONLY])
|
||||
TGS_INFO_LOG("DMAPI validation, exiting...")
|
||||
del(world)
|
||||
TerminateWorld()
|
||||
|
||||
version = new /datum/tgs_version(runtime_information[DMAPI5_RUNTIME_INFORMATION_SERVER_VERSION])
|
||||
security_level = runtime_information[DMAPI5_RUNTIME_INFORMATION_SECURITY_LEVEL]
|
||||
visibility = runtime_information[DMAPI5_RUNTIME_INFORMATION_VISIBILITY]
|
||||
instance_name = runtime_information[DMAPI5_RUNTIME_INFORMATION_INSTANCE_NAME]
|
||||
|
||||
var/list/revisionData = runtime_information[DMAPI5_RUNTIME_INFORMATION_REVISION]
|
||||
@@ -252,3 +254,7 @@
|
||||
/datum/tgs_api/v5/SecurityLevel()
|
||||
RequireInitialBridgeResponse()
|
||||
return security_level
|
||||
|
||||
/datum/tgs_api/v5/Visibility()
|
||||
RequireInitialBridgeResponse()
|
||||
return visibility
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#undef DMAPI5_RUNTIME_INFORMATION_REVISION
|
||||
#undef DMAPI5_RUNTIME_INFORMATION_TEST_MERGES
|
||||
#undef DMAPI5_RUNTIME_INFORMATION_SECURITY_LEVEL
|
||||
#undef DMAPI5_RUNTIME_INFORMATION_VISIBILITY
|
||||
|
||||
#undef DMAPI5_CHAT_UPDATE_CHANNELS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user