Skip to content

Commit c87fb7b

Browse files
Update TGS DMAPI (#1162)
Co-authored-by: tgstation-server <[email protected]>
1 parent 2e613fa commit c87fb7b

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

code/__DEFINES/tgs.dm

+28-1
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.0"
4+
#define TGS_DMAPI_VERSION "7.3.1"
55

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

@@ -58,6 +58,11 @@
5858
#define TGS_FILE2TEXT_NATIVE file2text
5959
#endif
6060

61+
// SpacemanDMM compatibility
62+
#ifndef CAN_BE_REDEFINED
63+
#define CAN_BE_REDEFINED(X)
64+
#endif
65+
6166
// EVENT CODES
6267

6368
/// Before a reboot mode change, extras parameters are the current and new reboot mode enums.
@@ -160,6 +165,7 @@
160165
* * http_handler - Optional user defined [/datum/tgs_http_handler].
161166
*/
162167
/world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_ULTRASAFE, datum/tgs_http_handler/http_handler)
168+
CAN_BE_REDEFINED(TRUE)
163169
return
164170

165171
/**
@@ -170,13 +176,15 @@
170176
* This function should not be called before ..() in [/world/proc/New].
171177
*/
172178
/world/proc/TgsInitializationComplete()
179+
CAN_BE_REDEFINED(TRUE)
173180
return
174181

175182
/// Consumers MUST run this macro at the start of [/world/proc/Topic].
176183
#define TGS_TOPIC var/tgs_topic_return = TgsTopic(args[1]); if(tgs_topic_return) return tgs_topic_return
177184

178185
/// Consumers MUST call this as late as possible in [world/proc/Reboot] (BEFORE ..()).
179186
/world/proc/TgsReboot()
187+
CAN_BE_REDEFINED(TRUE)
180188
return
181189

182190
// DATUM DEFINITIONS
@@ -214,6 +222,7 @@
214222
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] contains wildcards.
215223
*/
216224
/datum/tgs_version/proc/Wildcard()
225+
CAN_BE_REDEFINED(TRUE)
217226
return
218227

219228
/**
@@ -222,6 +231,7 @@
222231
* other_version - The [/datum/tgs_version] to compare against.
223232
*/
224233
/datum/tgs_version/proc/Equals(datum/tgs_version/other_version)
234+
CAN_BE_REDEFINED(TRUE)
225235
return
226236

227237
/// Represents a merge of a GitHub pull request.
@@ -459,16 +469,19 @@
459469

460470
/// Returns the maximum supported [/datum/tgs_version] of the DMAPI.
461471
/world/proc/TgsMaximumApiVersion()
472+
CAN_BE_REDEFINED(TRUE)
462473
return
463474

464475
/// Returns the minimum supported [/datum/tgs_version] of the DMAPI.
465476
/world/proc/TgsMinimumApiVersion()
477+
CAN_BE_REDEFINED(TRUE)
466478
return
467479

468480
/**
469481
* Returns [TRUE] if DreamDaemon was launched under TGS, the API matches, and was properly initialized. [FALSE] will be returned otherwise.
470482
*/
471483
/world/proc/TgsAvailable()
484+
CAN_BE_REDEFINED(TRUE)
472485
return
473486

474487
// No function below this succeeds if it TgsAvailable() returns FALSE or if TgsNew() has yet to be called.
@@ -480,6 +493,7 @@
480493
* If TGS has not requested a [TGS_REBOOT_MODE_SHUTDOWN] DreamDaemon will be launched again.
481494
*/
482495
/world/proc/TgsEndProcess()
496+
CAN_BE_REDEFINED(TRUE)
483497
return
484498

485499
/**
@@ -490,6 +504,7 @@
490504
* admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies.
491505
*/
492506
/world/proc/TgsTargetedChatBroadcast(datum/tgs_message_content/message, admin_only = FALSE)
507+
CAN_BE_REDEFINED(TRUE)
493508
return
494509

495510
/**
@@ -500,6 +515,7 @@
500515
* user: The [/datum/tgs_chat_user] to PM.
501516
*/
502517
/world/proc/TgsChatPrivateMessage(datum/tgs_message_content/message, datum/tgs_chat_user/user)
518+
CAN_BE_REDEFINED(TRUE)
503519
return
504520

505521
/**
@@ -510,42 +526,52 @@
510526
* channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to.
511527
*/
512528
/world/proc/TgsChatBroadcast(datum/tgs_message_content/message, list/channels = null)
529+
CAN_BE_REDEFINED(TRUE)
513530
return
514531

515532
/// Returns the current [/datum/tgs_version] of TGS if it is running the server, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
516533
/world/proc/TgsVersion()
534+
CAN_BE_REDEFINED(TRUE)
517535
return
518536

519537
/// Returns the running engine type
520538
/world/proc/TgsEngine()
539+
CAN_BE_REDEFINED(TRUE)
521540
return
522541

523542
/// Returns the current [/datum/tgs_version] of the DMAPI being used if it was activated, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
524543
/world/proc/TgsApiVersion()
544+
CAN_BE_REDEFINED(TRUE)
525545
return
526546

527547
/// Returns the name of the TGS instance running the game if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
528548
/world/proc/TgsInstanceName()
549+
CAN_BE_REDEFINED(TRUE)
529550
return
530551

531552
/// Return the current [/datum/tgs_revision_information] of the running server if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
532553
/world/proc/TgsRevision()
554+
CAN_BE_REDEFINED(TRUE)
533555
return
534556

535557
/// Returns the current BYOND security level as a TGS_SECURITY_ define if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
536558
/world/proc/TgsSecurityLevel()
559+
CAN_BE_REDEFINED(TRUE)
537560
return
538561

539562
/// Returns the current BYOND visibility level as a TGS_VISIBILITY_ define if TGS is present, null otherwise. Requires TGS to be using interop API version 5 or higher otherwise the string "___unimplemented" wil be returned. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
540563
/world/proc/TgsVisibility()
564+
CAN_BE_REDEFINED(TRUE)
541565
return
542566

543567
/// Returns a list of active [/datum/tgs_revision_information/test_merge]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
544568
/world/proc/TgsTestMerges()
569+
CAN_BE_REDEFINED(TRUE)
545570
return
546571

547572
/// 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!
548573
/world/proc/TgsChatChannelInfo()
574+
CAN_BE_REDEFINED(TRUE)
549575
return
550576

551577
/**
@@ -556,6 +582,7 @@
556582
* wait_for_completion - If set, this function will not return until the event has run to completion.
557583
*/
558584
/world/proc/TgsTriggerEvent(event_name, list/parameters, wait_for_completion = FALSE)
585+
CAN_BE_REDEFINED(TRUE)
559586
return
560587

561588
/*

code/modules/tgs/v5/undefs.dm

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#undef DMAPI5_PARAMETER_ACCESS_IDENTIFIER
2020
#undef DMAPI5_PARAMETER_CUSTOM_COMMANDS
21+
#undef DMAPI5_PARAMETER_TOPIC_PORT
2122

2223
#undef DMAPI5_CHUNK
2324
#undef DMAPI5_CHUNK_PAYLOAD

0 commit comments

Comments
 (0)