mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-22 13:41:17 -09:00
ModAPI.isServer
This commit is contained in:
parent
658107fe14
commit
734db357cf
@ -27,6 +27,7 @@ const modapi_postinit = "(" + (() => {
|
||||
ModAPI.meta._developerMap = {};
|
||||
ModAPI.meta._iconMap = {};
|
||||
ModAPI.meta._versionMap = {};
|
||||
ModAPI.isServer = false;
|
||||
const credits = {};
|
||||
ModAPI.addCredit = function (category, name, contents) {
|
||||
if (!credits[category]) {
|
||||
@ -980,7 +981,7 @@ const modapi_postinit = "(" + (() => {
|
||||
inlineIntegratedServerStartup = ModAPI.hooks._rippedMethodKeys.filter(key => { return key.startsWith(inlineIntegratedServerStartup); })[0];
|
||||
const inlineIntegratedServerStartupMethod = ModAPI.hooks.methods[inlineIntegratedServerStartup];
|
||||
ModAPI.hooks.methods[inlineIntegratedServerStartup] = function (worker, bootstrap) {
|
||||
var x = inlineIntegratedServerStartupMethod.apply(this, [worker, bootstrap + ";" + globalThis.modapi_postinit + ";" + ModAPI.dedicatedServer._data.join(";")]);
|
||||
var x = inlineIntegratedServerStartupMethod.apply(this, [worker, bootstrap + ";" + globalThis.modapi_postinit + ";ModAPI.isServer=true;" + ModAPI.dedicatedServer._data.join(";")]);
|
||||
ModAPI.dedicatedServer._data = [];
|
||||
ModAPI.dedicatedServer._wasUsed = true;
|
||||
console.log("[ModAPI] Hooked into inline integrated server.");
|
||||
|
@ -83,6 +83,8 @@ The global object has the following properties:
|
||||
- The version of ModAPI.
|
||||
- `ModAPI.is_1_12: Boolean`
|
||||
- Property defining wether or not ModAPI thinks the current version is 1.12-based.
|
||||
- `ModAPI.isServer: Boolean`
|
||||
- Property defining wether or not ModAPI thinks it is running on the dedicated server.
|
||||
- `ModAPI.flavour: String`
|
||||
- The flavour of ModAPI. Hardcoded to be `"injector"`.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user