many SP and LAN bug fixes, multi-dim TP command

This commit is contained in:
LAX1DUDE 2022-08-22 22:49:25 -07:00
parent 757ac80bbe
commit 0e11249c8e
23 changed files with 31344 additions and 31261 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -742,7 +742,7 @@ window.initializeLANServer = (() => {
if(peerId.length == 0) { if(peerId.length == 0) {
for(const thePeer of this.peerList.values()) { for(const thePeer of this.peerList.values()) {
if((typeof thePeer !== "undefined") && thePeer !== null) { if((typeof thePeer !== "undefined") && thePeer !== null) {
this.peerList.delete(thePeer); this.peerList.delete(peerId);
try { try {
thePeer.disconnect(); thePeer.disconnect();
}catch(e) {} }catch(e) {}
@ -754,7 +754,7 @@ window.initializeLANServer = (() => {
} }
var thePeer = this.peerList.get(peerId); var thePeer = this.peerList.get(peerId);
if((typeof thePeer !== "undefined") && thePeer !== null) { if((typeof thePeer !== "undefined") && thePeer !== null) {
this.peerList.delete(thePeer); this.peerList.delete(peerId);
try { try {
thePeer.disconnect(); thePeer.disconnect();
}catch(e) {} }catch(e) {}
@ -762,6 +762,10 @@ window.initializeLANServer = (() => {
} }
} }
countPeers() {
return this.peerList.size;
}
}; };
window.constructLANServer = () => new EaglercraftLANServer(); window.constructLANServer = () => new EaglercraftLANServer();

View File

@ -476,6 +476,7 @@ options.framebufferAntialias.msaa4=MSAA4
options.framebufferAntialias.msaa8=MSAA8 options.framebufferAntialias.msaa8=MSAA8
options.patchAnisotropic=Fix ANGLE bug #4994 options.patchAnisotropic=Fix ANGLE bug #4994
options.chunkUpdates=Chunk Update per FPS options.chunkUpdates=Chunk Update per FPS
options.adderall=Adderall
performance.max=Max FPS performance.max=Max FPS
performance.balanced=Balanced performance.balanced=Balanced

View File

@ -334,7 +334,11 @@ public class EaglerSPRelay extends WebSocketServer {
arg0.close(); arg0.close();
}else if(ipkt.connectionType == 0x04) { }else if(ipkt.connectionType == 0x04) {
logger.debug("[{}]: Polling the server for other worlds", (String) arg0.getAttachment()); logger.debug("[{}]: Polling the server for other worlds", (String) arg0.getAttachment());
if(config.isEnableShowLocals()) {
arg0.send(IPacket.writePacket(new IPacket07LocalWorlds(getLocalWorlds(waiting.address)))); arg0.send(IPacket.writePacket(new IPacket07LocalWorlds(getLocalWorlds(waiting.address))));
}else {
arg0.send(IPacket.writePacket(new IPacket07LocalWorlds(null)));
}
arg0.close(); arg0.close();
}else { }else {
logger.debug("[{}]: Unknown connection type: {}", (String) arg0.getAttachment(), ipkt.connectionType); logger.debug("[{}]: Unknown connection type: {}", (String) arg0.getAttachment(), ipkt.connectionType);

View File

@ -36,6 +36,7 @@ public class EaglerSPRelayConfig {
private String originWhitelist = ""; private String originWhitelist = "";
private String[] originWhitelistArray = new String[0]; private String[] originWhitelistArray = new String[0];
private boolean enableRealIpHeader = false; private boolean enableRealIpHeader = false;
private boolean enableShowLocals = true;
private String serverComment = "Eags. Public LAN Relay"; private String serverComment = "Eags. Public LAN Relay";
public void load(File conf) { public void load(File conf) {
@ -54,7 +55,7 @@ public class EaglerSPRelayConfig {
gotPingRateLimitLimit = false, gotPingRateLimitLockoutLimit = false, gotPingRateLimitLimit = false, gotPingRateLimitLockoutLimit = false,
gotPingRateLimitLockoutDuration = false; gotPingRateLimitLockoutDuration = false;
boolean gotOriginWhitelist = false, gotEnableRealIpHeader = false, boolean gotOriginWhitelist = false, gotEnableRealIpHeader = false,
gotAddress = false, gotComment = false; gotAddress = false, gotComment = false, gotShowLocals = false;
Throwable t2 = null; Throwable t2 = null;
try(BufferedReader reader = new BufferedReader(new FileReader(conf))) { try(BufferedReader reader = new BufferedReader(new FileReader(conf))) {
@ -237,6 +238,16 @@ public class EaglerSPRelayConfig {
t2 = t; t2 = t;
break; break;
} }
}else if(ss[0].equalsIgnoreCase("show-local-worlds")) {
try {
enableShowLocals = getBooleanValue(ss[1]);
gotShowLocals = true;
}catch(Throwable t) {
EaglerSPRelay.logger.warn("Invalid show-local-worlds {} in conf {}", ss[1], conf.getAbsoluteFile());
EaglerSPRelay.logger.warn(t);
t2 = t;
break;
}
}else if(ss[0].equalsIgnoreCase("server-comment")) { }else if(ss[0].equalsIgnoreCase("server-comment")) {
serverComment = ss[1]; serverComment = ss[1];
gotComment = true; gotComment = true;
@ -259,7 +270,7 @@ public class EaglerSPRelayConfig {
!gotPingRateLimitPeriod || !gotPingRateLimitLimit || !gotPingRateLimitPeriod || !gotPingRateLimitLimit ||
!gotPingRateLimitLockoutLimit || !gotPingRateLimitLockoutDuration || !gotPingRateLimitLockoutLimit || !gotPingRateLimitLockoutDuration ||
!gotOriginWhitelist || !gotEnableRealIpHeader || !gotAddress || !gotOriginWhitelist || !gotEnableRealIpHeader || !gotAddress ||
!gotComment) { !gotComment || !gotShowLocals) {
EaglerSPRelay.logger.warn("Updating config file: {}", conf.getAbsoluteFile()); EaglerSPRelay.logger.warn("Updating config file: {}", conf.getAbsoluteFile());
save(conf); save(conf);
} }
@ -300,6 +311,7 @@ public class EaglerSPRelayConfig {
w.println("world-ratelimit-lockout-duration: " + openRateLimitLockoutDuration); w.println("world-ratelimit-lockout-duration: " + openRateLimitLockoutDuration);
w.println("origin-whitelist: " + originWhitelist); w.println("origin-whitelist: " + originWhitelist);
w.println("enable-real-ip-header: " + enableRealIpHeader); w.println("enable-real-ip-header: " + enableRealIpHeader);
w.println("show-local-worlds: " + isEnableShowLocals());
w.print("server-comment: " + serverComment); w.print("server-comment: " + serverComment);
}catch(IOException t) { }catch(IOException t) {
EaglerSPRelay.logger.error("Failed to write config file: {}", conf.getAbsoluteFile()); EaglerSPRelay.logger.error("Failed to write config file: {}", conf.getAbsoluteFile());
@ -434,4 +446,8 @@ public class EaglerSPRelayConfig {
return new String(ret); return new String(ret);
} }
public boolean isEnableShowLocals() {
return enableShowLocals;
}
} }

View File

@ -25,6 +25,9 @@ public class IPacket07LocalWorlds extends IPacket {
} }
public void write(DataOutputStream output) throws IOException { public void write(DataOutputStream output) throws IOException {
if(worldsList == null) {
output.write(0);
}else {
int i = worldsList.size(); int i = worldsList.size();
if(i > 255) { if(i > 255) {
i = 255; i = 255;
@ -36,5 +39,6 @@ public class IPacket07LocalWorlds extends IPacket {
writeASCII8(output, w.worldCode); writeASCII8(output, w.worldCode);
} }
} }
}
} }

View File

@ -44,12 +44,12 @@ public class CommandServerTp extends CommandBase {
throw new PlayerNotFoundException(); throw new PlayerNotFoundException();
} }
var3.mountEntity((Entity) null);
if (var11.worldObj != var3.worldObj) { if (var11.worldObj != var3.worldObj) {
notifyAdmins(par1ICommandSender, "commands.tp.notSameDimension", new Object[0]); var3.travelToTheEnd(var11.dimension);
return;
} }
var3.mountEntity((Entity) null);
var3.playerNetServerHandler.setPlayerLocation(var11.posX, var11.posY, var11.posZ, var11.rotationYaw, var3.playerNetServerHandler.setPlayerLocation(var11.posX, var11.posY, var11.posZ, var11.rotationYaw,
var11.rotationPitch); var11.rotationPitch);
notifyAdmins(par1ICommandSender, "commands.tp.success", notifyAdmins(par1ICommandSender, "commands.tp.success",

View File

@ -664,8 +664,7 @@ public class NetServerHandler extends NetHandler {
public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand) { public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand) {
if (par1Packet205ClientCommand.forceRespawn == 1) { if (par1Packet205ClientCommand.forceRespawn == 1) {
if (this.playerEntity.playerConqueredTheEnd) { if (this.playerEntity.playerConqueredTheEnd) {
this.playerEntity = this.mcServer.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, this.playerEntity = this.mcServer.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, true, true);
true);
} else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) { } else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) {
if (this.mcServer.isSinglePlayer() if (this.mcServer.isSinglePlayer()
&& this.playerEntity.username.equals(this.mcServer.getServerOwner())) { && this.playerEntity.username.equals(this.mcServer.getServerOwner())) {
@ -678,8 +677,7 @@ public class NetServerHandler extends NetHandler {
return; return;
} }
this.playerEntity = this.mcServer.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, this.playerEntity = this.mcServer.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, false, true);
false);
} }
} }
} }

View File

@ -20,6 +20,8 @@ public class GuiScreenLANConnecting extends GuiScreen {
private NetClientHandler netHandler = null; private NetClientHandler netHandler = null;
private int renderCount = 0;
public GuiScreenLANConnecting(GuiScreen parent, String code) { public GuiScreenLANConnecting(GuiScreen parent, String code) {
this.parent = parent; this.parent = parent;
this.code = code; this.code = code;
@ -54,6 +56,7 @@ public class GuiScreenLANConnecting extends GuiScreen {
String message = st.translateKey("lanServer.pleaseWait"); String message = st.translateKey("lanServer.pleaseWait");
this.drawString(fontRenderer, message, (this.width - this.fontRenderer.getStringWidth(message)) / 2, this.height / 3 + 10, 0xFFFFFF); this.drawString(fontRenderer, message, (this.width - this.fontRenderer.getStringWidth(message)) / 2, this.height / 3 + 10, 0xFFFFFF);
if(++renderCount > 1) {
RelayServerSocket sock; RelayServerSocket sock;
if(relay == null) { if(relay == null) {
sock = IntegratedServer.relayManager.getWorkingRelay((str) -> ls.resetProgresAndWorkingMessage("Connecting: " + str), 0x02, code); sock = IntegratedServer.relayManager.getWorkingRelay((str) -> ls.resetProgresAndWorkingMessage("Connecting: " + str), 0x02, code);
@ -88,5 +91,6 @@ public class GuiScreenLANConnecting extends GuiScreen {
} }
} }
} }
}
} }

View File

@ -259,7 +259,7 @@ public class IntegratedServer {
public static void processICP() { public static void processICP() {
if(!EaglerAdapter.isIntegratedServerAlive()) { if(!EaglerAdapter.isIntegratedServerAlive()) {
if(IntegratedServerLAN.isHostingLAN()) { if(IntegratedServerLAN.isLANOpen()) {
IntegratedServerLAN.closeLAN(); IntegratedServerLAN.closeLAN();
} }
return; return;

View File

@ -96,6 +96,10 @@ public class IntegratedServerLAN {
} }
public static boolean isHostingLAN() { public static boolean isHostingLAN() {
return lanRelaySocket != null || EaglerAdapter.countPeers() > 0;
}
public static boolean isLANOpen() {
return lanRelaySocket != null; return lanRelaySocket != null;
} }

View File

@ -1147,7 +1147,7 @@ public class Minecraft implements Runnable {
wasPaused = isGamePaused; wasPaused = isGamePaused;
} }
if(lanState && !IntegratedServerLAN.isHostingLAN()) { if(lanState && !IntegratedServerLAN.isLANOpen()) {
lanState = false; lanState = false;
if(thePlayer != null) { if(thePlayer != null) {
thePlayer.sendChatToPlayer(EnumChatFormatting.RED + StatCollector.translateToLocal("lanServer.relayDisconnected")); thePlayer.sendChatToPlayer(EnumChatFormatting.RED + StatCollector.translateToLocal("lanServer.relayDisconnected"));

View File

@ -8,7 +8,7 @@ public enum EnumOptions {
CHAT_VISIBILITY("options.chat.visibility", false, false), CHAT_COLOR("options.chat.color", false, true), CHAT_LINKS("options.chat.links", false, true), CHAT_OPACITY("options.chat.opacity", true, false), CHAT_VISIBILITY("options.chat.visibility", false, false), CHAT_COLOR("options.chat.color", false, true), CHAT_LINKS("options.chat.links", false, true), CHAT_OPACITY("options.chat.opacity", true, false),
CHAT_LINKS_PROMPT("options.chat.links.prompt", false, true), USE_SERVER_TEXTURES("options.serverTextures", false, true), SNOOPER_ENABLED("options.snooper", false, true), USE_FULLSCREEN("options.fullscreen", false, true), CHAT_LINKS_PROMPT("options.chat.links.prompt", false, true), USE_SERVER_TEXTURES("options.serverTextures", false, true), SNOOPER_ENABLED("options.snooper", false, true), USE_FULLSCREEN("options.fullscreen", false, true),
ENABLE_FOG("options.fog", false, true), SHOW_CAPE("options.showCape", false, true), ANTIALIASING("options.framebufferAntialias", false, false), CHAT_SCALE("options.chat.scale", true, false), CHAT_WIDTH("options.chat.width", true, false), ENABLE_FOG("options.fog", false, true), SHOW_CAPE("options.showCape", false, true), ANTIALIASING("options.framebufferAntialias", false, false), CHAT_SCALE("options.chat.scale", true, false), CHAT_WIDTH("options.chat.width", true, false),
CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false), CHAT_HEIGHT_UNFOCUSED("options.chat.height.unfocused", true, false), CHUNK_UPDATES("options.chunkUpdates", false, false); CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false), CHAT_HEIGHT_UNFOCUSED("options.chat.height.unfocused", true, false), CHUNK_UPDATES("options.chunkUpdates", false, false), ADDERALL("options.adderall", false, true);
private final boolean enumFloat; private final boolean enumFloat;
private final boolean enumBoolean; private final boolean enumBoolean;

View File

@ -87,5 +87,11 @@ class EnumOptionsHelper {
} catch (NoSuchFieldError var10) { } catch (NoSuchFieldError var10) {
; ;
} }
try {
enumOptionsMappingHelperArray[EnumOptions.ADDERALL.ordinal()] = 17;
} catch (NoSuchFieldError var10) {
;
}
} }
} }

View File

@ -145,6 +145,8 @@ public class GameSettings {
public boolean hideJoinCode = false; public boolean hideJoinCode = false;
public int relayTimeout = 4; public int relayTimeout = 4;
public boolean adderall = false;
public GameSettings(Minecraft par1Minecraft) { public GameSettings(Minecraft par1Minecraft) {
this.keyBindings = new KeyBinding[] { this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindings = new KeyBinding[] { this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory,
this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindSprint, this.keyBindZoom, this.keyBindFunction }; this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindSprint, this.keyBindZoom, this.keyBindFunction };
@ -360,6 +362,10 @@ public class GameSettings {
} }
} }
if (par1EnumOptions == EnumOptions.ADDERALL) {
this.adderall = !this.adderall;
}
this.saveOptions(); this.saveOptions();
} }
@ -419,6 +425,9 @@ public class GameSettings {
case 15: case 15:
return this.enableFog; return this.enableFog;
case 17:
return this.adderall;
default: default:
return false; return false;
} }
@ -534,6 +543,7 @@ public class GameSettings {
if(yee.hasKey("difficulty")) difficulty = yee.getByte("difficulty"); if(yee.hasKey("difficulty")) difficulty = yee.getByte("difficulty");
if(yee.hasKey("hideJoinCode")) hideJoinCode = yee.getBoolean("hideJoinCode"); if(yee.hasKey("hideJoinCode")) hideJoinCode = yee.getBoolean("hideJoinCode");
if(yee.hasKey("relayTimeout")) relayTimeout = yee.getByte("relayTimeout"); if(yee.hasKey("relayTimeout")) relayTimeout = yee.getByte("relayTimeout");
if(yee.hasKey("adderall")) adderall = yee.getBoolean("adderall");
if(voiceListenRadius < 5) voiceListenRadius = 5; if(voiceListenRadius < 5) voiceListenRadius = 5;
else if(voiceListenRadius > 22) voiceListenRadius = 22; else if(voiceListenRadius > 22) voiceListenRadius = 22;
@ -612,6 +622,7 @@ public class GameSettings {
yee.setByte("difficulty", (byte)difficulty); yee.setByte("difficulty", (byte)difficulty);
yee.setBoolean("hideJoinCode", hideJoinCode); yee.setBoolean("hideJoinCode", hideJoinCode);
yee.setByte("relayTimeout", (byte)relayTimeout); yee.setByte("relayTimeout", (byte)relayTimeout);
yee.setBoolean("adderall", adderall);
for (int var4 = 0; var4 < this.keyBindings.length; ++var4) { for (int var4 = 0; var4 < this.keyBindings.length; ++var4) {
yee.setInteger(keyBindings[var4].keyDescription, keyBindings[var4].keyCode); yee.setInteger(keyBindings[var4].keyDescription, keyBindings[var4].keyCode);

View File

@ -34,7 +34,7 @@ public class GuiIngameMenu extends GuiScreen {
this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + var1, StatCollector.translateToLocal("menu.returnToGame"))); this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + var1, StatCollector.translateToLocal("menu.returnToGame")));
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + var1, 98, 20, StatCollector.translateToLocal("menu.options"))); this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + var1, 98, 20, StatCollector.translateToLocal("menu.options")));
this.buttonList.add(lanButton = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, StatCollector.translateToLocal(IntegratedServerLAN.isHostingLAN() ? "menu.closeLan" : "menu.shareToLan"))); this.buttonList.add(lanButton = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, StatCollector.translateToLocal(IntegratedServerLAN.isLANOpen() ? "menu.closeLan" : "menu.shareToLan")));
lanButton.enabled = mc.isSingleplayer(); lanButton.enabled = mc.isSingleplayer();
this.buttonList.add(new GuiButton(8, 3, 3, 120, 20, StatCollector.translateToLocal("menu.skinCapeSettings"))); this.buttonList.add(new GuiButton(8, 3, 3, 120, 20, StatCollector.translateToLocal("menu.skinCapeSettings")));
} }
@ -67,7 +67,7 @@ public class GuiIngameMenu extends GuiScreen {
break; break;
case 7: case 7:
if (IntegratedServerLAN.isHostingLAN()) { if (IntegratedServerLAN.isLANOpen()) {
this.mc.lanState = false; this.mc.lanState = false;
IntegratedServerLAN.closeLAN(); IntegratedServerLAN.closeLAN();
IntegratedServer.configureLAN(this.mc.theWorld.getWorldInfo().getGameType(), false); IntegratedServer.configureLAN(this.mc.theWorld.getWorldInfo().getGameType(), false);
@ -118,7 +118,7 @@ public class GuiIngameMenu extends GuiScreen {
drawString(fontRenderer, "Eaglercraft: " + ConfigConstants.version, 6, 27, 0x999999); drawString(fontRenderer, "Eaglercraft: " + ConfigConstants.version, 6, 27, 0x999999);
if(IntegratedServerLAN.isHostingLAN()) { if(IntegratedServerLAN.isLANOpen()) {
String str = var1.translateKey("lanServer.pauseMenu0"); String str = var1.translateKey("lanServer.pauseMenu0");
drawString(fontRenderer, str, 6, 52, 0xFFFF55); drawString(fontRenderer, str, 6, 52, 0xFFFF55);

View File

@ -6,8 +6,10 @@ import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import net.lax1dude.eaglercraft.EaglerAdapter;
import net.lax1dude.eaglercraft.GuiScreenBackupWorld; import net.lax1dude.eaglercraft.GuiScreenBackupWorld;
import net.lax1dude.eaglercraft.GuiScreenCreateWorldSelection; import net.lax1dude.eaglercraft.GuiScreenCreateWorldSelection;
import net.lax1dude.eaglercraft.GuiScreenLANConnect;
import net.lax1dude.eaglercraft.GuiScreenSingleplayerLoading; import net.lax1dude.eaglercraft.GuiScreenSingleplayerLoading;
import net.lax1dude.eaglercraft.IntegratedServer; import net.lax1dude.eaglercraft.IntegratedServer;
@ -239,9 +241,31 @@ public class GuiSelectWorld extends GuiScreen {
public void drawScreen(int par1, int par2, float par3) { public void drawScreen(int par1, int par2, float par3) {
this.worldSlotContainer.drawScreen(par1, par2, par3); this.worldSlotContainer.drawScreen(par1, par2, par3);
this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215); this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);
EaglerAdapter.glPushMatrix();
EaglerAdapter.glScalef(0.75f, 0.75f, 0.75f);
String text = StringTranslate.getInstance().translateKey("directConnect.lanWorld");
int w = mc.fontRenderer.getStringWidth(text);
boolean hover = par1 > 1 && par2 > 1 && par1 < (w * 3 / 4) + 7 && par2 < 12;
drawString(mc.fontRenderer, EnumChatFormatting.UNDERLINE + text, 5, 5, hover ? 0xFFEEEE22 : 0xFFCCCCCC);
EaglerAdapter.glPopMatrix();
super.drawScreen(par1, par2, par3); super.drawScreen(par1, par2, par3);
} }
public void mouseClicked(int xx, int yy, int btn) {
String text = StringTranslate.getInstance().translateKey("directConnect.lanWorld");
int w = mc.fontRenderer.getStringWidth(text);
if(xx > 2 && yy > 2 && xx < (w * 3 / 4) + 5 && yy < 12) {
mc.displayGuiScreen(new GuiScreenLANConnect(this));
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
}
super.mouseClicked(xx, yy, btn);
}
/** /**
* Gets a GuiYesNo screen with the warning, buttons, etc. * Gets a GuiYesNo screen with the warning, buttons, etc.
*/ */

View File

@ -3926,4 +3926,8 @@ public class EaglerAdapterImpl2 {
rtcLANServer.signalRemoteDisconnect(peer); rtcLANServer.signalRemoteDisconnect(peer);
} }
public static final int countPeers() {
return rtcLANServer.countPeers();
}
} }

View File

@ -48,6 +48,8 @@ public interface EaglercraftLANServer extends JSObject {
void signalRemoteDisconnect(String peerId); void signalRemoteDisconnect(String peerId);
int countPeers();
@JSFunctor @JSFunctor
public static interface ICECandidateHandler extends JSObject { public static interface ICECandidateHandler extends JSObject {
void call(String peerId, String candidate); void call(String peerId, String candidate);