Fix srv resolving

This commit is contained in:
rtm516 2021-06-06 10:42:46 +01:00
parent da0b96ed0f
commit 82984dd096
No known key found for this signature in database
GPG key ID: 331715B8B007C67A
3 changed files with 44 additions and 3 deletions

View file

@ -185,7 +185,7 @@ public class MasterServer {
// Create the Geyser instance
createGeyserProxy();
logger.info("Server started on " + geyserConnectConfig.getAddress() + ":" + port);
}

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/GeyserConnect
*/
package org.geysermc.connect.proxy;
import com.nukkitx.protocol.bedrock.BedrockServerSession;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.network.session.GeyserSession;
public class GeyserProxySession extends GeyserSession {
public GeyserProxySession(GeyserConnector connector, BedrockServerSession bedrockServerSession) {
super(connector, bedrockServerSession);
}
@Override
protected void disableSrvResolving() {
// Do nothing
}
}

View file

@ -40,12 +40,12 @@ import lombok.Getter;
import lombok.Setter;
import org.geysermc.common.window.FormWindow;
import org.geysermc.connect.MasterServer;
import org.geysermc.connect.proxy.GeyserProxySession;
import org.geysermc.connect.ui.FormID;
import org.geysermc.connect.ui.UIHandler;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.common.AuthType;
import org.geysermc.connector.network.UpstreamPacketHandler;
import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.session.auth.AuthData;
import org.geysermc.connector.network.session.auth.BedrockClientData;
import org.geysermc.connector.network.translators.world.block.BlockTranslator1_16_100;
@ -220,7 +220,7 @@ public class Player {
transferPacket.setPort(currentServer.getPort());
session.sendPacket(transferPacket);
} else {
GeyserSession geyserSession = new GeyserSession(GeyserConnector.getInstance(), session);
GeyserProxySession geyserSession = new GeyserProxySession(GeyserConnector.getInstance(), session);
session.setPacketHandler(new UpstreamPacketHandler(GeyserConnector.getInstance(), geyserSession));
geyserSession.getUpstream().getSession().setPacketCodec(session.getPacketCodec());