mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Automatic TGS DMAPI Update (#75634)
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>
This commit is contained in:
co-authored by
tgstation-server
parent
7b0b3c5fcc
commit
9d37e24f07
@@ -1,6 +1,6 @@
|
||||
// tgstation-server DMAPI
|
||||
|
||||
#define TGS_DMAPI_VERSION "6.4.3"
|
||||
#define TGS_DMAPI_VERSION "6.4.4"
|
||||
|
||||
// All functions and datums outside this document are subject to change with any version and should not be relied on.
|
||||
|
||||
|
||||
@@ -263,7 +263,12 @@
|
||||
for(var/I in channels)
|
||||
var/datum/tgs_chat_channel/channel = I
|
||||
ids += channel.id
|
||||
|
||||
message = UpgradeDeprecatedChatMessage(message)
|
||||
|
||||
if (!length(channels))
|
||||
return
|
||||
|
||||
message = list("message" = message.text, "channelIds" = ids)
|
||||
if(intercepted_message_queue)
|
||||
intercepted_message_queue += list(message)
|
||||
@@ -276,7 +281,12 @@
|
||||
var/datum/tgs_chat_channel/channel = I
|
||||
if (!channel.is_private_channel && ((channel.is_admin_channel && admin_only) || (!channel.is_admin_channel && !admin_only)))
|
||||
channels += channel.id
|
||||
|
||||
message = UpgradeDeprecatedChatMessage(message)
|
||||
|
||||
if (!length(channels))
|
||||
return
|
||||
|
||||
message = list("message" = message.text, "channelIds" = channels)
|
||||
if(intercepted_message_queue)
|
||||
intercepted_message_queue += list(message)
|
||||
|
||||
@@ -166,6 +166,10 @@
|
||||
ids += channel.id
|
||||
|
||||
message = UpgradeDeprecatedChatMessage(message)
|
||||
|
||||
if (!length(channels))
|
||||
return
|
||||
|
||||
message = message._interop_serialize()
|
||||
message[DMAPI5_CHAT_MESSAGE_CHANNEL_IDS] = ids
|
||||
if(intercepted_message_queue)
|
||||
@@ -181,6 +185,10 @@
|
||||
channels += channel.id
|
||||
|
||||
message = UpgradeDeprecatedChatMessage(message)
|
||||
|
||||
if (!length(channels))
|
||||
return
|
||||
|
||||
message = message._interop_serialize()
|
||||
message[DMAPI5_CHAT_MESSAGE_CHANNEL_IDS] = channels
|
||||
if(intercepted_message_queue)
|
||||
@@ -199,6 +207,7 @@
|
||||
|
||||
/datum/tgs_api/v5/ChatChannelInfo()
|
||||
RequireInitialBridgeResponse()
|
||||
WaitForReattach(TRUE)
|
||||
return chat_channels.Copy()
|
||||
|
||||
/datum/tgs_api/v5/proc/DecodeChannels(chat_update_json)
|
||||
|
||||
@@ -59,18 +59,22 @@
|
||||
var/json = json_encode(data)
|
||||
return json
|
||||
|
||||
/datum/tgs_api/v5/proc/PerformBridgeRequest(bridge_request)
|
||||
/datum/tgs_api/v5/proc/WaitForReattach(require_channels = FALSE)
|
||||
if(detached)
|
||||
// Wait up to one minute
|
||||
for(var/i in 1 to 600)
|
||||
sleep(1)
|
||||
if(!detached)
|
||||
if(!detached && (!require_channels || length(chat_channels)))
|
||||
break
|
||||
|
||||
// dad went out for milk cigarettes 20 years ago...
|
||||
// dad went out for milk and cigarettes 20 years ago...
|
||||
// yes, this affects all other waiters, intentional
|
||||
if(i == 600)
|
||||
detached = FALSE
|
||||
|
||||
/datum/tgs_api/v5/proc/PerformBridgeRequest(bridge_request)
|
||||
WaitForReattach(FALSE)
|
||||
|
||||
// This is an infinite sleep until we get a response
|
||||
var/export_response = world.Export(bridge_request)
|
||||
if(!export_response)
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
var/list/event_call = list(event_type)
|
||||
if (event_type == TGS_EVENT_WATCHDOG_DETACH)
|
||||
detached = TRUE
|
||||
chat_channels.Cut() // https://github.com/tgstation/tgstation-server/issues/1490
|
||||
|
||||
if(event_parameters)
|
||||
event_call += event_parameters
|
||||
|
||||
Reference in New Issue
Block a user