From 923642771362eb4ff3440fd0a8075dfcb0717ee3 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 25 Sep 2018 15:08:55 -0400 Subject: [PATCH] Lock the V3 DMAPI behind a define to fix #717 --- src/DMAPI/tgs.dm | 4 ++++ src/DMAPI/tgs/core/core.dm | 8 ++++++++ src/DMAPI/tgs/includes.dm | 2 ++ 3 files changed, 14 insertions(+) diff --git a/src/DMAPI/tgs.dm b/src/DMAPI/tgs.dm index 6645ce51ff..2f4c8a4040 100644 --- a/src/DMAPI/tgs.dm +++ b/src/DMAPI/tgs.dm @@ -7,6 +7,10 @@ //create this define if you want to do configuration outside of this file #ifndef TGS_EXTERNAL_CONFIGURATION +//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 + //Comment this out once you've filled in the below #error TGS API unconfigured diff --git a/src/DMAPI/tgs/core/core.dm b/src/DMAPI/tgs/core/core.dm index e0495aba4e..34b1329950 100644 --- a/src/DMAPI/tgs/core/core.dm +++ b/src/DMAPI/tgs/core/core.dm @@ -4,6 +4,10 @@ TGS_ERROR_LOG("TgsNew(): TGS API datum already set ([current_api])!") return +#ifdef TGS_V3_API + minimum_required_security_level = TGS_SECURITY_TRUSTED +#endif + var/tgs_version = world.params[TGS_VERSION_PARAMETER] if(!tgs_version) return @@ -36,9 +40,13 @@ switch(super) if(3) +#ifndef TGS_V3_API + TGS_ERROR_LOG("Detected V3 API but TGS_V3_API isn't defined!") +#else switch(major) if(2) return /datum/tgs_api/v3210 +#endif if(4) switch(major) if(0) diff --git a/src/DMAPI/tgs/includes.dm b/src/DMAPI/tgs/includes.dm index 2fdd5ed1e0..e145394015 100644 --- a/src/DMAPI/tgs/includes.dm +++ b/src/DMAPI/tgs/includes.dm @@ -2,7 +2,9 @@ #include "core\core.dm" #include "core\datum.dm" #include "core\default_event_handler.dm" +#ifdef TGS_V3_API #include "v3210\api.dm" #include "v3210\commands.dm" +#endif #include "v4\api.dm" #include "v4\commands.dm"