Replies: 13 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
-
java.io.FileNotFoundException: Cannot find dimension registry file the plugin jar is untouched Client version: 2.20.2 (viaversion on the proxy) How to reproduce, I don't know ( happens all the time) My code, package org.nexuscraft.corevelocity.misc;
import com.velocitypowered.api.proxy.ProxyServer;
import org.nexuscraft.corevelocity.Core;
import org.slf4j.Logger;
import ua.nanit.limbo.configuration.LimboConfig;
import ua.nanit.limbo.server.Command;
import ua.nanit.limbo.server.CommandHandler;
import ua.nanit.limbo.server.LimboServer;
import ua.nanit.limbo.server.data.BossBar;
import ua.nanit.limbo.server.data.InfoForwarding;
import ua.nanit.limbo.server.data.PingData;
import ua.nanit.limbo.server.data.Title;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
public class LimboManager {
private final ProxyServer proxyServer;
private final Core plugin;
private final Logger logger;
private final HashMap<LimboServer, Integer> limboServers; // Limbo Instance, port number
private final Random random;
public LimboManager(ProxyServer proxyServer, Core plugin, Logger logger) {
this.proxyServer = proxyServer;
this.plugin = plugin;
this.logger = logger;
this.limboServers = new HashMap<>();
this.random = new Random();
logger.info("Started LimboManager");
}
public HashMap<LimboServer, Integer> getLimboServers() {
return limboServers;
}
public boolean createLimboServer() {
int port = 0;
while (port == 0) {
port = random.nextInt(65535) + 1024;
if (!limboServers.containsValue(port) && port != 25565 && port != 19132) {
break;
}
}
LimboServer limboServer = new LimboServer(new Config("local-limbo-" + port, port), new CommandHandler_(), getClass().getClassLoader());
limboServers.put(limboServer, port);
try {
limboServer.start();
} catch (Exception e) {
logger.error("Failed to start Limbo Server", e);
return false;
}
logger.info("Created Limbo Server: {}, on port {}", limboServer.getConfig().getBrandName(), port);
return true;
}
public void destroyLimboServer(LimboServer limboServer) {
int port = limboServers.get(limboServer);
limboServer.stop();
limboServers.remove(limboServer);
logger.info("Destroyed Limbo Server: {}, on port {}", limboServer.getConfig().getBrandName(), port);
}
private static class Config implements LimboConfig {
private final String name;
private final int port;
private final InfoForwarding infoForwarding;
public Config(String name, int port) {
this.name = name;
this.port = port;
this.infoForwarding = new InfoForwarding();
}
@Override
public SocketAddress getAddress() {
return new InetSocketAddress("0.0.0.0", port);
}
@Override
public int getMaxPlayers() {
return -1;
}
@Override
public PingData getPingData() {
return new PingData();
}
@Override
public String getDimensionType() {
return "THE_END";
}
@Override
public int getGameMode() {
return 3;
}
@Override
public InfoForwarding getInfoForwarding() {
return infoForwarding;
}
@Override
public long getReadTimeout() {
return 30000;
}
@Override
public int getDebugLevel() {
return 0;
}
@Override
public boolean isUseBrandName() {
return true;
}
@Override
public boolean isUseJoinMessage() {
return false;
}
@Override
public boolean isUseBossBar() {
return false;
}
@Override
public boolean isUseTitle() {
return false;
}
@Override
public boolean isUsePlayerList() {
return false;
}
@Override
public boolean isUseHeaderAndFooter() {
return false;
}
@Override
public String getBrandName() {
return name;
}
@Override
public String getJoinMessage() {
return "";
}
@Override
public BossBar getBossBar() {
return null;
}
@Override
public Title getTitle() {
return null;
}
@Override
public String getPlayerListUsername() {
return "";
}
@Override
public String getPlayerListHeader() {
return "";
}
@Override
public String getPlayerListFooter() {
return "";
}
@Override
public boolean isUseEpoll() {
return true;
}
@Override
public int getBossGroupSize() {
return 1;
}
@Override
public int getWorkerGroupSize() {
return 4;
}
}
private static class CommandHandler_ implements CommandHandler<Command> {
@Override
public Collection<Command> getCommands() {
return List.of();
}
@Override
public void register(Command command) {
}
@Override
public boolean executeCommand(String s) {
return false;
}
}
} |
Beta Was this translation helpful? Give feedback.
-
How does jar content looks like |
Beta Was this translation helpful? Give feedback.
-
Unrelated to the NanoLimboPlugin, use discussion for support |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Any info? |
Beta Was this translation helpful? Give feedback.
-
I am not home for couple of days, I will tell when I am home. |
Beta Was this translation helpful? Give feedback.
-
yes |
Beta Was this translation helpful? Give feedback.
-
What you mean by "all files", elaborate. |
Beta Was this translation helpful? Give feedback.
-
NanoLimbo has been used by the |
Beta Was this translation helpful? Give feedback.
-
You should use plugin classloader. |
Beta Was this translation helpful? Give feedback.
-
How do I do that? xd |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions