mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 07:27:18 +01:00
More DM fixes
This commit is contained in:
@@ -11,3 +11,5 @@
|
||||
|
||||
packages/*
|
||||
*.user
|
||||
*.dmb
|
||||
*.int
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#define SERVER_TOOLS_EXTERNAL_CONFIGURATION
|
||||
#define SERVER_TOOLS_DEFINE_AND_SET_GLOBAL(Name, Value) var/##Name = ##Value
|
||||
#define SERVER_TOOLS_READ_GLOBAL(Name) global.##Name
|
||||
#define SERVER_TOOLS_WRITE_GLOBAL(Name, Value) global.##Name = ##Value
|
||||
#define SERVER_TOOLS_WORLD_ANNOUNCE(message) world << ##message
|
||||
#define SERVER_TOOLS_LOG(message) world.log << ##message
|
||||
#define SERVER_TOOLS_NOTIFY_ADMINS(event) message_admins(event)
|
||||
@@ -38,7 +38,7 @@
|
||||
#define SERVER_TOOLS_API_VERSION ServiceAPIVersion()
|
||||
//Returns TRUE if the world was launched under the server tools and the API matches, FALSE otherwise
|
||||
//No function below this succeed if this is FALSE
|
||||
#define SERVER_TOOLS_PRESENT (RunningService() != null)
|
||||
#define SERVER_TOOLS_PRESENT RunningService()
|
||||
//Gets the current version of the service running the server
|
||||
#define SERVER_TOOLS_VERSION ServiceVersion()
|
||||
//Forces a hard reboot of BYOND by ending the process
|
||||
|
||||
@@ -11,11 +11,11 @@ SERVER_TOOLS_DEFINE_AND_SET_GLOBAL(server_tools_api_compatible, FALSE)
|
||||
/world/proc/ServiceInit()
|
||||
if(!RunningService(TRUE))
|
||||
return
|
||||
ListCustomCommands()
|
||||
ExportService("[SERVICE_REQUEST_API_VERSION] [SERVICE_API_VERSION]", TRUE)
|
||||
ListServiceCustomCommands(TRUE)
|
||||
ExportService("[SERVICE_REQUEST_API_VERSION] [SERVER_TOOLS_API_VERSION]", TRUE)
|
||||
|
||||
/proc/RunningService(skip_compat_check = FALSE)
|
||||
return (skip_compat_check || SERVER_TOOLS_READ_GLOBAL(server_tools_api_compatible)) && world.params[SERVICE_WORLD_PARAM]
|
||||
return (skip_compat_check || SERVER_TOOLS_READ_GLOBAL(server_tools_api_compatible)) && world.params[SERVICE_WORLD_PARAM] != null
|
||||
|
||||
/proc/ServiceVersion()
|
||||
if(RunningService(TRUE))
|
||||
|
||||
@@ -13,8 +13,9 @@
|
||||
// END_PREFERENCES
|
||||
|
||||
// BEGIN_INCLUDE
|
||||
#include "DMAPITravisTester.dm"
|
||||
#include "Config.dm"
|
||||
#include "DMAPI\server_tools.dm"
|
||||
#include "DMAPI\st_commands.dm"
|
||||
#include "DMAPI\st_interface.dm"
|
||||
#include "Test.dm"
|
||||
// END_INCLUDE
|
||||
|
||||
@@ -16,8 +16,14 @@ EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2D8FC6AA-1D33-44B6-81C2-35ED7A87EDBC}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.gitignore = .gitignore
|
||||
.travis.yml = .travis.yml
|
||||
appveyor.yml = appveyor.yml
|
||||
build_byond.sh = build_byond.sh
|
||||
Config.dm = Config.dm
|
||||
DMAPITravisTester.dme = DMAPITravisTester.dme
|
||||
install_byond.sh = install_byond.sh
|
||||
README.md = README.md
|
||||
Test.dm = Test.dm
|
||||
tgs.ico = tgs.ico
|
||||
TGS3Release.ps1 = TGS3Release.ps1
|
||||
Version.cs = Version.cs
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#define SERVER_TOOLS_EXTERNAL_CONFIGURATION
|
||||
#define SERVER_TOOLS_DEFINE_AND_SET_GLOBAL(Name, Value) var/##Name = ##Value
|
||||
#define SERVER_TOOLS_READ_GLOBAL(Name) global.##Name
|
||||
#define SERVER_TOOLS_WRITE_GLOBAL(Name, Value) global.##Name = ##Value
|
||||
#define SERVER_TOOLS_WORLD_ANNOUNCE(message) world << ##message
|
||||
#define SERVER_TOOLS_LOG(message) world.log << ##message
|
||||
#define SERVER_TOOLS_NOTIFY_ADMINS(event) message_admins(event)
|
||||
#ifndef SERVER_TOOLS_ON_NEW
|
||||
#error DreamMaker rearranges the intentionally weird file layout of this project. Compile using dm.exe instead
|
||||
#endif
|
||||
|
||||
/world/New()
|
||||
SERVER_TOOLS_ON_NEW
|
||||
@@ -27,6 +23,7 @@
|
||||
sleep(50)
|
||||
if(!SERVER_TOOLS_PRESENT)
|
||||
world.log << "No running service detected"
|
||||
del(world)
|
||||
return
|
||||
world.log << "Running service version: [SERVER_TOOLS_VERSION]"
|
||||
var/list/prs = SERVER_TOOLS_PR_LIST
|
||||
Reference in New Issue
Block a user