Stab at fixing forge and wecui support when combined. F**** I hate mods.

This commit is contained in:
md_5 2013-06-08 12:35:50 +10:00
parent 4d51d16512
commit b5aecd5dcc
3 changed files with 16 additions and 3 deletions

View File

@ -77,7 +77,7 @@ public class ServerConnector extends PacketHandler
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF( "Login" );
out.writeUTF( user.getAddress().getAddress().getHostAddress() );
out.writeUTF( user.getAddress().getHostString() );
out.writeInt( user.getAddress().getPort() );
channel.write( new PacketFAPluginMessage( "BungeeCord", out.toByteArray() ) );
@ -115,6 +115,10 @@ public class ServerConnector extends PacketHandler
}
}
for ( PacketFAPluginMessage message : user.getPendingConnection().getRegisterMessages() )
{
ch.write( message );
}
if ( !sentMessages )
{
for ( PacketFAPluginMessage message : user.getPendingConnection().getLoginMessages() )

View File

@ -63,6 +63,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection
private PacketFDEncryptionRequest request;
@Getter
private List<PacketFAPluginMessage> loginMessages = new ArrayList<>();
@Getter
private List<PacketFAPluginMessage> registerMessages = new ArrayList<>();
private State thisState = State.HANDSHAKE;
private SecretKey sharedKey;
private final Unsafe unsafe = new Unsafe()
@ -95,7 +97,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@Override
public void handle(PacketFAPluginMessage pluginMessage) throws Exception
{
loginMessages.add( pluginMessage );
// TODO: Unregister?
if ( pluginMessage.getTag().equals( "REGISTER" ) )
{
registerMessages.add( pluginMessage );
} else
{
loginMessages.add( pluginMessage );
}
}
@Override

View File

@ -125,7 +125,7 @@ public class UpstreamBridge extends PacketHandler
// TODO: Unregister as well?
if ( pluginMessage.getTag().equals( "REGISTER" ) )
{
con.getPendingConnection().getLoginMessages().add( pluginMessage );
con.getPendingConnection().getRegisterMessages().add( pluginMessage );
}
}