Update TGS DMAPI

This commit is contained in:
DMAPI Update
2020-10-28 00:39:56 +00:00
parent f086341668
commit 162d0cc750
5 changed files with 56 additions and 9 deletions
+3
View File
@@ -0,0 +1,3 @@
*.dm text eol=lf
*.md text eol=lf
*LICENSE text eol=lf
+49 -5
View File
@@ -1,13 +1,55 @@
// AA Note
// yes I know this file has procs in it, but TGS is very picky with how the fuck its files are laid out
// dont @ me
// tgstation-server DMAPI
#define TGS_DMAPI_VERSION "5.2.5"
#define TGS_DMAPI_VERSION "5.2.7"
// All functions and datums outside this document are subject to change with any version and should not be relied on.
// CONFIGURATION
/// Create this define if you want to do TGS configuration outside of this file.
#ifndef TGS_EXTERNAL_CONFIGURATION
// Comment this out once you've filled in the below.
#error TGS API unconfigured
// Uncomment this if you wish to allow the game to interact with TGS 3.
// This will raise the minimum required security level of your game to TGS_SECURITY_TRUSTED due to it utilizing call()()
//#define TGS_V3_API
// Required interfaces (fill in with your codebase equivalent):
/// Create a global variable named `Name` and set it to `Value`.
#define TGS_DEFINE_AND_SET_GLOBAL(Name, Value)
/// Read the value in the global variable `Name`.
#define TGS_READ_GLOBAL(Name)
/// Set the value in the global variable `Name` to `Value`.
#define TGS_WRITE_GLOBAL(Name, Value)
/// Disallow ANYONE from reflecting a given `path`, security measure to prevent in-game use of DD -> TGS capabilities.
#define TGS_PROTECT_DATUM(Path)
/// Display an announcement `message` from the server to all players.
#define TGS_WORLD_ANNOUNCE(message)
/// Notify current in-game administrators of a string `event`.
#define TGS_NOTIFY_ADMINS(event)
/// Write an info `message` to a server log.
#define TGS_INFO_LOG(message)
/// Write an warning `message` to a server log.
#define TGS_WARNING_LOG(message)
/// Write an error `message` to a server log.
#define TGS_ERROR_LOG(message)
/// Get the number of connected /clients.
#define TGS_CLIENT_COUNT
#endif
// EVENT CODES
/// Before a reboot mode change, extras parameters are the current and new reboot mode enums
@@ -53,6 +95,8 @@
#define TGS_EVENT_WATCHDOG_SHUTDOWN 15
/// Before the watchdog detaches for a TGS update/restart. No parameters.
#define TGS_EVENT_WATCHDOG_DETACH 16
// We don't actually implement this value as the DMAPI can never receive it
// #define TGS_EVENT_WATCHDOG_LAUNCH 17
// OTHER ENUMS
+1 -1
View File
@@ -39,7 +39,7 @@
var/warned_custom_commands = FALSE
/datum/tgs_api/v3210/ApiVersion()
return new /datum/tgs_version("3.2.1.1")
return new /datum/tgs_version("3.2.1.3")
/datum/tgs_api/v3210/proc/trim_left(text)
for (var/i = 1 to length(text))
+2 -2
View File
@@ -44,8 +44,8 @@
user.friendly_name = sender
// Discord hack, fix the mention if it's only numbers (fuck you IRC trolls)
var/regex/discord_id_regex = regex(@"[0-9]+")
if(discord_id_regex.Find(sender))
var/regex/discord_id_regex = regex(@"^[0-9]+$")
if(findtext(sender, discord_id_regex))
sender = "<@[sender]>"
user.mention = sender
+1 -1
View File
@@ -18,7 +18,7 @@
var/initialized = FALSE
/datum/tgs_api/v5/ApiVersion()
return new /datum/tgs_version("5.2.5")
return new /datum/tgs_version(TGS_DMAPI_VERSION)
/datum/tgs_api/v5/OnWorldNew(minimum_required_security_level)
server_port = world.params[DMAPI5_PARAM_SERVER_PORT]