mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Move 'remoteServer' to GeyserConnector
This commit is contained in:
parent
17b99a80fe
commit
96dbe40ba5
2 changed files with 7 additions and 3 deletions
|
@ -31,6 +31,7 @@ import org.geysermc.connector.configuration.GeyserConfiguration;
|
|||
import org.geysermc.connector.console.ConsoleCommandReader;
|
||||
import org.geysermc.connector.console.GeyserLogger;
|
||||
import org.geysermc.connector.network.ConnectorServerEventHandler;
|
||||
import org.geysermc.connector.network.remote.RemoteJavaServer;
|
||||
import org.geysermc.connector.plugin.GeyserPluginLoader;
|
||||
import org.geysermc.connector.plugin.GeyserPluginManager;
|
||||
|
||||
|
@ -51,6 +52,9 @@ public class GeyserConnector implements Connector {
|
|||
|
||||
private static GeyserConnector instance;
|
||||
|
||||
@Getter
|
||||
private RemoteJavaServer remoteServer;
|
||||
|
||||
@Getter
|
||||
private Logger logger;
|
||||
|
||||
|
@ -109,6 +113,8 @@ public class GeyserConnector implements Connector {
|
|||
|
||||
commandMap = new GeyserCommandMap(this);
|
||||
|
||||
remoteServer = new RemoteJavaServer(config.getRemote().getAddress(), config.getRemote().getPort());
|
||||
|
||||
Geyser.setConnector(this);
|
||||
|
||||
pluginManager = new GeyserPluginManager(new GeyserPluginLoader(this));
|
||||
|
|
|
@ -79,9 +79,7 @@ public class UpstreamPacketHandler implements BedrockPacketHandler {
|
|||
public boolean handle(ResourcePackClientResponsePacket textPacket) {
|
||||
switch (textPacket.getStatus()) {
|
||||
case COMPLETED:
|
||||
// Start connecting to remote server
|
||||
RemoteJavaServer remoteServer = new RemoteJavaServer(connector.getConfig().getRemote().getAddress(), connector.getConfig().getRemote().getPort());
|
||||
session.connect(remoteServer);
|
||||
session.connect(connector.getRemoteServer());
|
||||
connector.getLogger().info("Player connected with " + session.getAuthenticationData().getName());
|
||||
break;
|
||||
case HAVE_ALL_PACKS:
|
||||
|
|
Loading…
Reference in a new issue