Move some bootstrapping to the connected method, #267
This commit is contained in:
parent
6bf9df31f5
commit
f44cf6c8e9
@ -86,8 +86,6 @@ public class ServerConnector extends PacketHandler
|
|||||||
{
|
{
|
||||||
if ( user.getServer() == null )
|
if ( user.getServer() == null )
|
||||||
{
|
{
|
||||||
BungeeCord.getInstance().connections.put( user.getName(), user );
|
|
||||||
bungee.getTabListHandler().onConnect( user );
|
|
||||||
// Once again, first connection
|
// Once again, first connection
|
||||||
user.clientEntityId = login.entityId;
|
user.clientEntityId = login.entityId;
|
||||||
user.serverEntityId = login.entityId;
|
user.serverEntityId = login.entityId;
|
||||||
@ -101,13 +99,6 @@ public class ServerConnector extends PacketHandler
|
|||||||
login.unused,
|
login.unused,
|
||||||
(byte) user.getPendingConnection().getListener().getTabListSize() );
|
(byte) user.getPendingConnection().getListener().getTabListSize() );
|
||||||
user.ch.write( modLogin );
|
user.ch.write( modLogin );
|
||||||
ch.write( BungeeCord.getInstance().registerChannels() );
|
|
||||||
|
|
||||||
TexturePackInfo texture = user.getPendingConnection().getListener().getTexturePack();
|
|
||||||
if ( texture != null )
|
|
||||||
{
|
|
||||||
ch.write( new PacketFAPluginMessage( "MC|TPack", ( texture.getUrl() + "\00" + texture.getSize() ).getBytes() ) );
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
bungee.getTabListHandler().onServerChange( user );
|
bungee.getTabListHandler().onServerChange( user );
|
||||||
|
@ -7,6 +7,7 @@ import net.md_5.bungee.EntityMap;
|
|||||||
import net.md_5.bungee.UserConnection;
|
import net.md_5.bungee.UserConnection;
|
||||||
import net.md_5.bungee.Util;
|
import net.md_5.bungee.Util;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
import net.md_5.bungee.api.config.TexturePackInfo;
|
||||||
import net.md_5.bungee.api.event.ChatEvent;
|
import net.md_5.bungee.api.event.ChatEvent;
|
||||||
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
||||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||||
@ -29,6 +30,20 @@ public class UpstreamBridge extends PacketHandler
|
|||||||
con.disconnect( Util.exception( t ) );
|
con.disconnect( Util.exception( t ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void connected(Channel channel) throws Exception
|
||||||
|
{
|
||||||
|
BungeeCord.getInstance().connections.put( con.getName(), con );
|
||||||
|
bungee.getTabListHandler().onConnect( con );
|
||||||
|
con.ch.write( BungeeCord.getInstance().registerChannels() );
|
||||||
|
|
||||||
|
TexturePackInfo texture = con.getPendingConnection().getListener().getTexturePack();
|
||||||
|
if ( texture != null )
|
||||||
|
{
|
||||||
|
con.ch.write( new PacketFAPluginMessage( "MC|TPack", ( texture.getUrl() + "\00" + texture.getSize() ).getBytes() ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disconnected(Channel channel) throws Exception
|
public void disconnected(Channel channel) throws Exception
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user