mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-28 05:05:21 +01:00
OMG WTF BBQ IT WORKS. LETS IRON OUT BUGS AND GET OUR RELEASE TARGET, ONLY 12 HOURS LEFT.
This commit is contained in:
parent
6e18403cd9
commit
fa5804ec86
@ -1,7 +1,5 @@
|
||||
package net.md_5.bungee.api.connection;
|
||||
|
||||
import net.md_5.bungee.api.Callback;
|
||||
import net.md_5.bungee.api.ServerPing;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ import io.netty.channel.Channel;
|
||||
import java.net.InetSocketAddress;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.Server;
|
||||
import net.md_5.bungee.packet.Packet1Login;
|
||||
@ -20,6 +21,9 @@ public class ServerConnection implements Server
|
||||
private final ServerInfo info;
|
||||
@Getter
|
||||
private final Packet1Login loginPacket;
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean isObsolete;
|
||||
|
||||
@Override
|
||||
public void sendData(String channel, byte[] data)
|
||||
|
@ -91,11 +91,12 @@ public class ServerConnector extends PacketHandler
|
||||
user.ch.write( new Packet9Respawn( login.dimension, login.difficulty, login.gameMode, (short) 256, login.levelType ) );
|
||||
|
||||
// Remove from old servers
|
||||
user.getServer().setObsolete( true );
|
||||
user.getServer().disconnect( "Quitting" );
|
||||
user.getServer().getInfo().removePlayer( user );
|
||||
}
|
||||
|
||||
// Add to new server
|
||||
// TODO: Move this to the connected() method of DownstreamBridge
|
||||
target.addPlayer( user );
|
||||
|
||||
user.setServer( server );
|
||||
|
@ -7,6 +7,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.md_5.bungee.EntityMap;
|
||||
import net.md_5.bungee.ServerConnection;
|
||||
import net.md_5.bungee.UserConnection;
|
||||
import net.md_5.bungee.Util;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
@ -28,7 +29,7 @@ public class DownstreamBridge extends PacketHandler
|
||||
|
||||
private final ProxyServer bungee;
|
||||
private final UserConnection con;
|
||||
private final Server server;
|
||||
private final ServerConnection server;
|
||||
|
||||
@Override
|
||||
public void exception(Throwable t) throws Exception
|
||||
@ -43,8 +44,10 @@ public class DownstreamBridge extends PacketHandler
|
||||
server.getInfo().removePlayer( con );
|
||||
bungee.getReconnectHandler().setServer( con );
|
||||
|
||||
if (!server.isObsolete()){
|
||||
con.disconnect( "[Proxy] Lost connection to server D:" );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(ByteBuf buf) throws Exception
|
||||
|
@ -41,7 +41,6 @@ public class UpstreamBridge extends PacketHandler
|
||||
{
|
||||
con.getServer().disconnect( "Quitting" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user