From e89e0044a9ea27380e8a9b2f16729f29862ed79d Mon Sep 17 00:00:00 2001 From: Leah Anderson <144633084+OtterCodes101@users.noreply.github.com> Date: Wed, 16 Oct 2024 17:30:44 +0000 Subject: [PATCH 1/2] Update servermod.js to have a more professional name --- examplemods/servermod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examplemods/servermod.js b/examplemods/servermod.js index f257a70..b3dd201 100644 --- a/examplemods/servermod.js +++ b/examplemods/servermod.js @@ -1,5 +1,5 @@ (function servermod() { - ModAPI.meta.title("Server Manager Mod Thingy"); + ModAPI.meta.title("Server Manager"); ModAPI.meta.version("a0"); ModAPI.meta.description("_"); ModAPI.meta.credits("ZXMushroom63 & radmanplays"); From ea2db9d6678bc822ffce41f525c442f52edc67e7 Mon Sep 17 00:00:00 2001 From: radmanplays <95340057+radmanplays@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:36:53 +0330 Subject: [PATCH 2/2] Update servermod.js --- examplemods/servermod.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/examplemods/servermod.js b/examplemods/servermod.js index b3dd201..086aecb 100644 --- a/examplemods/servermod.js +++ b/examplemods/servermod.js @@ -44,6 +44,7 @@ function worldUpdate() { if (ModAPI.mc && ModAPI.mc.theWorld) { showgui(); + openSharedWorld() } else { hidegui(); } @@ -67,6 +68,22 @@ } + function openSharedWorld(){ + if(ModAPI.mc.theWorld && !ModAPI.hooks.methods.nlevsl_LANServerController_isLANOpen()){ + ModAPI.hooks.methods.nlevi_PlatformWebRTC_startRTCLANServer(); + var worldName = ModAPI.mc.thePlayer.getName() + "'s World"; + var ls = ModAPI.mc.loadingScreen; + var code = ModAPI.hooks.methods.nlevsl_LANServerController_shareToLAN(ls.resetProgressAndMessage, worldName, false) + if (code != null) { + ModAPI.hooks.methods.nlevs_SingleplayerServerController_configureLAN(ModAPI.mc.playerController.getCurrentGameType(), false); + alert("code: " + code +" relay: " + ModAPI.hooks.methods.nlevsl_LANServerController_getCurrentURI()) + } + } else { + return; + } + } + + /* NETWORKING OPCODES chat - bidirectional, send chat to server/client