Duh, of course connect isn't called, because we are already connected!

This commit is contained in:
md_5 2013-04-27 22:52:02 +10:00
parent 349949d154
commit cbb08ec58b

View File

@ -18,22 +18,17 @@ import net.md_5.bungee.packet.PacketCCSettings;
import net.md_5.bungee.packet.PacketFAPluginMessage; import net.md_5.bungee.packet.PacketFAPluginMessage;
import net.md_5.bungee.packet.PacketHandler; import net.md_5.bungee.packet.PacketHandler;
@RequiredArgsConstructor
public class UpstreamBridge extends PacketHandler public class UpstreamBridge extends PacketHandler
{ {
private final ProxyServer bungee; private final ProxyServer bungee;
private final UserConnection con; private final UserConnection con;
@Override public UpstreamBridge(ProxyServer bungee, UserConnection con)
public void exception(Throwable t) throws Exception
{ {
con.disconnect( Util.exception( t ) ); this.bungee = bungee;
} this.con = con;
@Override
public void connected(ChannelWrapper channel) throws Exception
{
BungeeCord.getInstance().connections.put( con.getName(), con ); BungeeCord.getInstance().connections.put( con.getName(), con );
bungee.getTabListHandler().onConnect( con ); bungee.getTabListHandler().onConnect( con );
con.ch.write( BungeeCord.getInstance().registerChannels() ); con.ch.write( BungeeCord.getInstance().registerChannels() );
@ -45,6 +40,12 @@ public class UpstreamBridge extends PacketHandler
} }
} }
@Override
public void exception(Throwable t) throws Exception
{
con.disconnect( Util.exception( t ) );
}
@Override @Override
public void disconnected(ChannelWrapper channel) throws Exception public void disconnected(ChannelWrapper channel) throws Exception
{ {