diff --git a/build/Version.props b/build/Version.props index 2722d7155e..8802116119 100644 --- a/build/Version.props +++ b/build/Version.props @@ -8,8 +8,8 @@ 9.9.0 10.3.0 11.3.0 - 6.2.1 - 5.4.0 + 6.3.0 + 5.5.0 1.2.1 1.2.1 1.0.1 diff --git a/src/DMAPI/tgs.dm b/src/DMAPI/tgs.dm index a4f35f9331..e35ccb69d1 100644 --- a/src/DMAPI/tgs.dm +++ b/src/DMAPI/tgs.dm @@ -1,6 +1,6 @@ // tgstation-server DMAPI -#define TGS_DMAPI_VERSION "6.2.1" +#define TGS_DMAPI_VERSION "6.3.0" // All functions and datums outside this document are subject to change with any version and should not be relied on. diff --git a/src/DMAPI/tgs/v5/__interop_version.dm b/src/DMAPI/tgs/v5/__interop_version.dm index 4add7374ad..d0ac7e92ea 100644 --- a/src/DMAPI/tgs/v5/__interop_version.dm +++ b/src/DMAPI/tgs/v5/__interop_version.dm @@ -1 +1 @@ -"5.4.0" +"5.5.0" diff --git a/src/DMAPI/tgs/v5/api.dm b/src/DMAPI/tgs/v5/api.dm index 725e53102d..664875a70d 100644 --- a/src/DMAPI/tgs/v5/api.dm +++ b/src/DMAPI/tgs/v5/api.dm @@ -129,9 +129,12 @@ switch(command) if(DMAPI5_TOPIC_COMMAND_CHAT_COMMAND) + intercepted_message_queue = list() var/result = HandleCustomCommand(topic_parameters[DMAPI5_TOPIC_PARAMETER_CHAT_COMMAND]) if(!result) result = TopicResponse("Error running chat command!") + result[DMAPI5_TOPIC_RESPONSE_CHAT_RESPONSES] = intercepted_message_queue + intercepted_message_queue = null return result if(DMAPI5_TOPIC_COMMAND_EVENT_NOTIFICATION) intercepted_message_queue = list() diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs index d45d2a39de..d6377963eb 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs @@ -307,6 +307,8 @@ namespace Tgstation.Server.Host.Components.Watchdog commandResponse.Text = "TGS: Command processed but no DMAPI response returned!"; } + HandleChatResponses(commandResult); + return commandResponse; } } @@ -465,20 +467,7 @@ namespace Tgstation.Server.Host.Components.Watchdog cancellationToken) ; - if (result?.InteropResponse?.ChatResponses != null) - foreach (var response in result.InteropResponse.ChatResponses) - Chat.QueueMessage( - response, - response.ChannelIds - .Select(channelIdString => - { - if (UInt64.TryParse(channelIdString, out var channelId)) - return (ulong?)channelId; - - return null; - }) - .Where(nullableChannelId => nullableChannelId.HasValue) - .Select(nullableChannelId => nullableChannelId.Value)); + HandleChatResponses(result); } /// @@ -1100,5 +1089,29 @@ namespace Tgstation.Server.Host.Components.Watchdog return MonitorAction.Continue; } + + /// + /// Handle any in a given topic . + /// + /// The . + void HandleChatResponses(CombinedTopicResponse result) + { + if (result?.InteropResponse?.ChatResponses != null) + foreach (var response in result.InteropResponse.ChatResponses) + Chat.QueueMessage( + response, + response.ChannelIds + .Select(channelIdString => + { + if (UInt64.TryParse(channelIdString, out var channelId)) + return (ulong?)channelId; + else + Logger.LogWarning("Could not parse chat response channel ID: {channelID}", channelIdString); + + return null; + }) + .Where(nullableChannelId => nullableChannelId.HasValue) + .Select(nullableChannelId => nullableChannelId.Value)); + } } }