Skip to content

Commit c9ad8c8

Browse files
Update TGS DMAPI
1 parent 53f1cca commit c9ad8c8

File tree

10 files changed

+38
-9
lines changed

10 files changed

+38
-9
lines changed

code/__DEFINES/tgs.dm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// tgstation-server DMAPI
22
// The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in IETF RFC 2119.
33

4-
#define TGS_DMAPI_VERSION "7.3.3"
4+
#define TGS_DMAPI_VERSION "7.4.0"
55

66
// All functions and datums outside this document are subject to change with any version and should not be relied on.
77

@@ -584,11 +584,17 @@
584584
/world/proc/TgsTriggerEvent(event_name, list/parameters, wait_for_completion = FALSE)
585585
CAN_BE_REDEFINED(TRUE)
586586
return
587+
588+
589+
/// Trigger a TGS deployment for the current instance. The current state of the repository will not be changed.
590+
/world/proc/TgsTriggerDeployment()
591+
CAN_BE_REDEFINED(TRUE)
592+
return
587593

588594
/*
589595
The MIT License
590596
591-
Copyright (c) 2017-2024 Jordan Brown
597+
Copyright (c) 2017-2026 Jordan Brown
592598
593599
Permission is hereby granted, free of charge,
594600
to any person obtaining a copy of this software and

code/modules/tgs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ This folder should be placed on its own inside a codebase that wishes to use the
55
- [includes.dm](./includes.dm) is the file that should be included by DM code, it handles including the rest.
66
- The [core](./core) folder includes all code not directly part of any API version.
77
- The other versioned folders contain code for the different DMAPI versions.
8-
- [v3210](./v3210) contains the final TGS3 API.
9-
- [v4](./v4) is the legacy DMAPI 4 (Used in TGS 4.0.X versions).
10-
- [v5](./v5) is the current DMAPI version used by TGS >=4.1.
8+
- [v3210](./v3210) contains the final TGS3 API.
9+
- [v4](./v4) is the legacy DMAPI 4 (Used in TGS 4.0.X versions).
10+
- [v5](./v5) is the current DMAPI version used by TGS >=4.1.
1111
- [LICENSE](./LICENSE) is the MIT license for the DMAPI.
1212

1313
APIs communicate with TGS in two ways. All versions implement TGS -> DM communication using /world/Topic. DM -> TGS communication, called the bridge method, is different for each version.

code/modules/tgs/core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This folder contains all DMAPI code not directly involved in an API.
44

5-
- [_definitions.dm](./definitions.dm) contains defines needed across DMAPI internals.
5+
- [\_definitions.dm](./definitions.dm) contains defines needed across DMAPI internals.
66
- [byond_world_export.dm](./byond_world_export.dm) contains the default `/datum/tgs_http_handler` implementation which uses `world.Export()`.
77
- [core.dm](./core.dm) contains the implementations of the `/world/proc/TgsXXX()` procs. Many map directly to the `/datum/tgs_api` functions. It also contains the /datum selection and setup code.
88
- [datum.dm](./datum.dm) contains the `/datum/tgs_api` declarations that all APIs must implement.

code/modules/tgs/core/core.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,8 @@
177177
parameters = list()
178178

179179
return api.TriggerEvent(event_name, parameters, wait_for_completion)
180+
181+
/world/TgsTriggerDeployment()
182+
var/datum/tgs_api/api = TGS_READ_GLOBAL(tgs)
183+
if(api)
184+
return api.TriggerDeployment()

code/modules/tgs/core/datum.dm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,6 @@ TGS_PROTECT_DATUM(/datum/tgs_api)
7272

7373
/datum/tgs_api/proc/TriggerEvent(event_name, list/parameters, wait_for_completion)
7474
return FALSE
75+
76+
/datum/tgs_api/proc/TriggerDeployment()
77+
return TGS_UNIMPLEMENTED

code/modules/tgs/v5/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
This DMAPI implements bridge requests using HTTP GET requests to TGS. It has no security restrictions.
44

5-
- [__interop_version.dm](./__interop_version.dm) contains the version of the API used between the DMAPI and TGS.
6-
- [_defines.dm](./_defines.dm) contains constant definitions.
5+
- [\_\_interop_version.dm](./__interop_version.dm) contains the version of the API used between the DMAPI and TGS.
6+
- [\_defines.dm](./_defines.dm) contains constant definitions.
77
- [api.dm](./api.dm) contains the bulk of the API code.
88
- [bridge.dm](./bridge.dm) contains functions related to making bridge requests.
99
- [chunking.dm](./chunking.dm) contains common function for splitting large raw data sets into chunks BYOND can natively process.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"5.10.1"
1+
"5.11.0"

code/modules/tgs/v5/_defines.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define DMAPI5_BRIDGE_COMMAND_CHAT_SEND 5
1616
#define DMAPI5_BRIDGE_COMMAND_CHUNK 6
1717
#define DMAPI5_BRIDGE_COMMAND_EVENT 7
18+
#define DMAPI5_BRIDGE_COMMAND_DEPLOY 8
1819

1920
#define DMAPI5_PARAMETER_ACCESS_IDENTIFIER "accessIdentifier"
2021
#define DMAPI5_PARAMETER_CUSTOM_COMMANDS "customCommands"

code/modules/tgs/v5/api.dm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,19 @@
294294

295295
return TRUE
296296

297+
/datum/tgs_api/v5/TriggerDeployment(event_name, list/parameters, wait_for_completion)
298+
RequireInitialBridgeResponse()
299+
WaitForReattach(TRUE)
300+
301+
if(interop_version.minor < 11)
302+
TGS_WARNING_LOG("Interop version too low for triggering deployments!")
303+
return FALSE
304+
305+
var response = Bridge(DMAPI5_BRIDGE_COMMAND_DEPLOY)
306+
if(!response)
307+
return FALSE
308+
return TRUE
309+
297310
/datum/tgs_api/v5/proc/DecodeChannels(chat_update_json)
298311
TGS_DEBUG_LOG("DecodeChannels()")
299312
var/list/chat_channels_json = chat_update_json[DMAPI5_CHAT_UPDATE_CHANNELS]

code/modules/tgs/v5/undefs.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#undef DMAPI5_BRIDGE_COMMAND_CHAT_SEND
1616
#undef DMAPI5_BRIDGE_COMMAND_CHUNK
1717
#undef DMAPI5_BRIDGE_COMMAND_EVENT
18+
#undef DMAPI5_BRIDGE_COMMAND_DEPLOY
1819

1920
#undef DMAPI5_PARAMETER_ACCESS_IDENTIFIER
2021
#undef DMAPI5_PARAMETER_CUSTOM_COMMANDS

0 commit comments

Comments
 (0)