mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-23 06:01:38 -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._developerMap = {};
|
||||||
ModAPI.meta._iconMap = {};
|
ModAPI.meta._iconMap = {};
|
||||||
ModAPI.meta._versionMap = {};
|
ModAPI.meta._versionMap = {};
|
||||||
|
ModAPI.isServer = false;
|
||||||
const credits = {};
|
const credits = {};
|
||||||
ModAPI.addCredit = function (category, name, contents) {
|
ModAPI.addCredit = function (category, name, contents) {
|
||||||
if (!credits[category]) {
|
if (!credits[category]) {
|
||||||
@ -980,7 +981,7 @@ const modapi_postinit = "(" + (() => {
|
|||||||
inlineIntegratedServerStartup = ModAPI.hooks._rippedMethodKeys.filter(key => { return key.startsWith(inlineIntegratedServerStartup); })[0];
|
inlineIntegratedServerStartup = ModAPI.hooks._rippedMethodKeys.filter(key => { return key.startsWith(inlineIntegratedServerStartup); })[0];
|
||||||
const inlineIntegratedServerStartupMethod = ModAPI.hooks.methods[inlineIntegratedServerStartup];
|
const inlineIntegratedServerStartupMethod = ModAPI.hooks.methods[inlineIntegratedServerStartup];
|
||||||
ModAPI.hooks.methods[inlineIntegratedServerStartup] = function (worker, bootstrap) {
|
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._data = [];
|
||||||
ModAPI.dedicatedServer._wasUsed = true;
|
ModAPI.dedicatedServer._wasUsed = true;
|
||||||
console.log("[ModAPI] Hooked into inline integrated server.");
|
console.log("[ModAPI] Hooked into inline integrated server.");
|
||||||
|
@ -83,6 +83,8 @@ The global object has the following properties:
|
|||||||
- The version of ModAPI.
|
- The version of ModAPI.
|
||||||
- `ModAPI.is_1_12: Boolean`
|
- `ModAPI.is_1_12: Boolean`
|
||||||
- Property defining wether or not ModAPI thinks the current version is 1.12-based.
|
- 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`
|
- `ModAPI.flavour: String`
|
||||||
- The flavour of ModAPI. Hardcoded to be `"injector"`.
|
- The flavour of ModAPI. Hardcoded to be `"injector"`.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user