Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 00:00:41 +01:00
Move 'remoteServer' to GeyserConnector
Dieser Commit ist enthalten in:
Ursprung
17b99a80fe
Commit
96dbe40ba5
@ -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));
|
||||||
|
@ -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:
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren