From e0676a5700743f244a3dc774695437dc85b3c4c1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 09:59:13 -0600 Subject: [PATCH 1/3] Automatic TGS DMAPI Update (#2644) This pull request updates the TGS DMAPI to the latest version. Please note any breaking or unimplemented changes before merging. Co-authored-by: github-actions --- code/__DEFINES/tgs.dm | 5 +++- code/modules/tgs/v5/api.dm | 54 ++++++++++++++++++++++---------------- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/code/__DEFINES/tgs.dm b/code/__DEFINES/tgs.dm index c561a64ebf58..fdfec5e8ca08 100644 --- a/code/__DEFINES/tgs.dm +++ b/code/__DEFINES/tgs.dm @@ -1,6 +1,6 @@ // tgstation-server DMAPI -#define TGS_DMAPI_VERSION "7.0.1" +#define TGS_DMAPI_VERSION "7.0.2" // All functions and datums outside this document are subject to change with any version and should not be relied on. @@ -426,6 +426,7 @@ /** * Send a message to connected chats. This function may sleep! + * If TGS is offline when called, the message may be placed in a queue to be sent and this function will return immediately. Your message will be sent when TGS reconnects to the game. * * message - The [/datum/tgs_message_content] to send. * admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies. @@ -435,6 +436,7 @@ /** * Send a private message to a specific user. This function may sleep! + * If TGS is offline when called, the message may be placed in a queue to be sent and this function will return immediately. Your message will be sent when TGS reconnects to the game. * * message - The [/datum/tgs_message_content] to send. * user: The [/datum/tgs_chat_user] to PM. @@ -444,6 +446,7 @@ /** * Send a message to connected chats that are flagged as game-related in TGS. This function may sleep! + * If TGS is offline when called, the message may be placed in a queue to be sent and this function will return immediately. Your message will be sent when TGS reconnects to the game. * * message - The [/datum/tgs_message_content] to send. * channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to. diff --git a/code/modules/tgs/v5/api.dm b/code/modules/tgs/v5/api.dm index 25d49b3e3bdb..a5c064a8eaf1 100644 --- a/code/modules/tgs/v5/api.dm +++ b/code/modules/tgs/v5/api.dm @@ -8,8 +8,12 @@ var/reboot_mode = TGS_REBOOT_MODE_NORMAL + /// List of chat messages list()s that attempted to be sent during a topic call. To be bundled in the result of the call var/list/intercepted_message_queue + /// List of chat messages list()s that attempted to be sent during a topic call. To be bundled in the result of the call + var/list/offline_message_queue + var/list/custom_commands var/list/test_merges @@ -194,17 +198,7 @@ var/datum/tgs_chat_channel/channel = I ids += channel.id - message2 = UpgradeDeprecatedChatMessage(message2) - - if (!length(channels)) - return - - var/list/data = message2._interop_serialize() - data[DMAPI5_CHAT_MESSAGE_CHANNEL_IDS] = ids - if(intercepted_message_queue) - intercepted_message_queue += list(data) - else - Bridge(DMAPI5_BRIDGE_COMMAND_CHAT_SEND, list(DMAPI5_BRIDGE_PARAMETER_CHAT_MESSAGE = data)) + SendChatMessageRaw(message2, ids) /datum/tgs_api/v5/ChatTargetedBroadcast(datum/tgs_message_content/message2, admin_only) var/list/channels = list() @@ -213,26 +207,42 @@ if (!channel.is_private_channel && ((channel.is_admin_channel && admin_only) || (!channel.is_admin_channel && !admin_only))) channels += channel.id + SendChatMessageRaw(message2, channels) + +/datum/tgs_api/v5/ChatPrivateMessage(datum/tgs_message_content/message2, datum/tgs_chat_user/user) + SendChatMessageRaw(message2, list(user.channel.id)) + +/datum/tgs_api/v5/proc/SendChatMessageRaw(datum/tgs_message_content/message2, list/channel_ids) message2 = UpgradeDeprecatedChatMessage(message2) - if (!length(channels)) + if (!length(channel_ids)) return var/list/data = message2._interop_serialize() - data[DMAPI5_CHAT_MESSAGE_CHANNEL_IDS] = channels + data[DMAPI5_CHAT_MESSAGE_CHANNEL_IDS] = channel_ids if(intercepted_message_queue) intercepted_message_queue += list(data) - else - Bridge(DMAPI5_BRIDGE_COMMAND_CHAT_SEND, list(DMAPI5_BRIDGE_PARAMETER_CHAT_MESSAGE = data)) + return -/datum/tgs_api/v5/ChatPrivateMessage(datum/tgs_message_content/message2, datum/tgs_chat_user/user) - message2 = UpgradeDeprecatedChatMessage(message2) - var/list/data = message2._interop_serialize() - data[DMAPI5_CHAT_MESSAGE_CHANNEL_IDS] = list(user.channel.id) - if(intercepted_message_queue) - intercepted_message_queue += list(data) + if(offline_message_queue) + offline_message_queue += list(data) + return + + if(detached) + offline_message_queue = list(data) + + WaitForReattach(FALSE) + + data = offline_message_queue + offline_message_queue = null + + for(var/queued_message in data) + SendChatDataRaw(queued_message) else - Bridge(DMAPI5_BRIDGE_COMMAND_CHAT_SEND, list(DMAPI5_BRIDGE_PARAMETER_CHAT_MESSAGE = data)) + SendChatDataRaw(data) + +/datum/tgs_api/v5/proc/SendChatDataRaw(list/data) + Bridge(DMAPI5_BRIDGE_COMMAND_CHAT_SEND, list(DMAPI5_BRIDGE_PARAMETER_CHAT_MESSAGE = data)) /datum/tgs_api/v5/ChatChannelInfo() RequireInitialBridgeResponse() From 97ac42636a9d77be448382d26336aeb2c896ef74 Mon Sep 17 00:00:00 2001 From: Theos Date: Thu, 18 Jan 2024 11:00:54 -0500 Subject: [PATCH 2/3] Tend wounds surgery variants no longer attempt to heal the wrong type of damage (#2646) ## About The Pull Request ![image](https://github.com/shiptest-ss13/Shiptest/assets/24857008/2e267cd6-7b43-4900-8a20-09e3b8879d30) ![image](https://github.com/shiptest-ss13/Shiptest/assets/24857008/75dad61e-84ac-4bd3-b285-a37e43a49d41) ## Why It's Good For The Game Prevents a tend wounds heal cycle from targeting a limb that won't benefit from its flat healing bonus. ## Changelog :cl: tweak: tend brute/burns can no longer attempt to (very ineffectively) heal the other damage type /:cl: Signed-off-by: Theos --- code/modules/surgery/healing.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/surgery/healing.dm b/code/modules/surgery/healing.dm index 956768c09aa4..8d3eecb3ead3 100644 --- a/code/modules/surgery/healing.dm +++ b/code/modules/surgery/healing.dm @@ -65,11 +65,11 @@ var/urhealedamt_burn = burnhealing if(missinghpbonus) if(target.stat != DEAD) - urhealedamt_brute += round((target.getBruteLoss()/ missinghpbonus),0.1) - urhealedamt_burn += round((target.getFireLoss()/ missinghpbonus),0.1) + urhealedamt_brute += brutehealing ? round((target.getBruteLoss()/ missinghpbonus),0.1) : 0 + urhealedamt_burn += burnhealing ? round((target.getFireLoss()/ missinghpbonus),0.1) : 0 else //less healing bonus for the dead since they're expected to have lots of damage to begin with (to make TW into defib not TOO simple) - urhealedamt_brute += round((target.getBruteLoss()/ (missinghpbonus*5)),0.1) - urhealedamt_burn += round((target.getFireLoss()/ (missinghpbonus*5)),0.1) + urhealedamt_brute += brutehealing ? round((target.getBruteLoss()/ (missinghpbonus*5)),0.1) : 0 + urhealedamt_burn += burnhealing ? round((target.getFireLoss()/ (missinghpbonus*5)),0.1) : 0 if(!get_location_accessible(target, target_zone)) urhealedamt_brute *= 0.55 urhealedamt_burn *= 0.55 From 2918caf0ceedcfcf9bf3d05943d0b1a6aea3736f Mon Sep 17 00:00:00 2001 From: Changelogs Date: Thu, 18 Jan 2024 10:15:29 -0600 Subject: [PATCH 3/3] Automatic changelog generation for PR #2646 [ci skip] --- html/changelogs/AutoChangeLog-pr-2646.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-2646.yml diff --git a/html/changelogs/AutoChangeLog-pr-2646.yml b/html/changelogs/AutoChangeLog-pr-2646.yml new file mode 100644 index 000000000000..82e356149677 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-2646.yml @@ -0,0 +1,5 @@ +author: SomeguyManperson +changes: + - {tweak: tend brute/burns can no longer attempt to (very ineffectively) heal the + other damage type} +delete-after: true