Move 'remoteServer' to GeyserConnector

This commit is contained in:
RednedEpic 2019-07-10 12:52:29 -05:00
parent 17b99a80fe
commit 96dbe40ba5
2 changed files with 7 additions and 3 deletions

View file

@ -31,6 +31,7 @@ import org.geysermc.connector.configuration.GeyserConfiguration;
import org.geysermc.connector.console.ConsoleCommandReader; import org.geysermc.connector.console.ConsoleCommandReader;
import org.geysermc.connector.console.GeyserLogger; import org.geysermc.connector.console.GeyserLogger;
import org.geysermc.connector.network.ConnectorServerEventHandler; import org.geysermc.connector.network.ConnectorServerEventHandler;
import org.geysermc.connector.network.remote.RemoteJavaServer;
import org.geysermc.connector.plugin.GeyserPluginLoader; import org.geysermc.connector.plugin.GeyserPluginLoader;
import org.geysermc.connector.plugin.GeyserPluginManager; import org.geysermc.connector.plugin.GeyserPluginManager;
@ -51,6 +52,9 @@ public class GeyserConnector implements Connector {
private static GeyserConnector instance; private static GeyserConnector instance;
@Getter
private RemoteJavaServer remoteServer;
@Getter @Getter
private Logger logger; private Logger logger;
@ -109,6 +113,8 @@ public class GeyserConnector implements Connector {
commandMap = new GeyserCommandMap(this); commandMap = new GeyserCommandMap(this);
remoteServer = new RemoteJavaServer(config.getRemote().getAddress(), config.getRemote().getPort());
Geyser.setConnector(this); Geyser.setConnector(this);
pluginManager = new GeyserPluginManager(new GeyserPluginLoader(this)); pluginManager = new GeyserPluginManager(new GeyserPluginLoader(this));

View file

@ -79,9 +79,7 @@ public class UpstreamPacketHandler implements BedrockPacketHandler {
public boolean handle(ResourcePackClientResponsePacket textPacket) { public boolean handle(ResourcePackClientResponsePacket textPacket) {
switch (textPacket.getStatus()) { switch (textPacket.getStatus()) {
case COMPLETED: case COMPLETED:
// Start connecting to remote server session.connect(connector.getRemoteServer());
RemoteJavaServer remoteServer = new RemoteJavaServer(connector.getConfig().getRemote().getAddress(), connector.getConfig().getRemote().getPort());
session.connect(remoteServer);
connector.getLogger().info("Player connected with " + session.getAuthenticationData().getName()); connector.getLogger().info("Player connected with " + session.getAuthenticationData().getName());
break; break;
case HAVE_ALL_PACKS: case HAVE_ALL_PACKS: