From 1de74d32c6ac5f3c34c6b1ea013313a57938b144 Mon Sep 17 00:00:00 2001 From: tgstation-server Date: Sat, 2 Mar 2024 01:08:39 +0000 Subject: [PATCH] Update TGS DMAPI --- code/__DEFINES/tgs.dm | 4 ++-- code/modules/tgs/v5/api.dm | 4 ++++ code/modules/tgs/v5/topic.dm | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/tgs.dm b/code/__DEFINES/tgs.dm index dc49d2c6f0..a4fb6d40be 100644 --- a/code/__DEFINES/tgs.dm +++ b/code/__DEFINES/tgs.dm @@ -1,6 +1,6 @@ // tgstation-server DMAPI -#define TGS_DMAPI_VERSION "7.1.0" +#define TGS_DMAPI_VERSION "7.1.1" // All functions and datums outside this document are subject to change with any version and should not be relied on. @@ -496,7 +496,7 @@ /// Returns a list of connected [/datum/tgs_chat_channel]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping! /world/proc/TgsChatChannelInfo() return - + /** * Trigger an event in TGS. Requires TGS version >= 6.3.0. Returns [TRUE] if the event was triggered successfully, [FALSE] otherwise. This function may sleep! * diff --git a/code/modules/tgs/v5/api.dm b/code/modules/tgs/v5/api.dm index 9b64931f8f..95b8edd3ee 100644 --- a/code/modules/tgs/v5/api.dm +++ b/code/modules/tgs/v5/api.dm @@ -48,6 +48,10 @@ var/datum/tgs_version/api_version = ApiVersion() version = null // we want this to be the TGS version, not the interop version + + // sleep once to prevent an issue where world.Export on the first tick can hang indefinitely + sleep(world.tick_lag) + var/list/bridge_response = Bridge(DMAPI5_BRIDGE_COMMAND_STARTUP, list(DMAPI5_BRIDGE_PARAMETER_MINIMUM_SECURITY_LEVEL = minimum_required_security_level, DMAPI5_BRIDGE_PARAMETER_VERSION = api_version.raw_parameter, DMAPI5_PARAMETER_CUSTOM_COMMANDS = ListCustomCommands(), DMAPI5_PARAMETER_TOPIC_PORT = GetTopicPort())) if(!istype(bridge_response)) TGS_ERROR_LOG("Failed initial bridge request!") diff --git a/code/modules/tgs/v5/topic.dm b/code/modules/tgs/v5/topic.dm index e66edc2720..e1f2cb6385 100644 --- a/code/modules/tgs/v5/topic.dm +++ b/code/modules/tgs/v5/topic.dm @@ -177,7 +177,8 @@ reattach_response[DMAPI5_PARAMETER_CUSTOM_COMMANDS] = ListCustomCommands() reattach_response[DMAPI5_PARAMETER_TOPIC_PORT] = GetTopicPort() - pending_events.Cut() + for(var/eventId in pending_events) + pending_events[eventId] = TRUE return reattach_response