forked from BLOCKFANTASY/LOOHP-Limbo
Fire ConnectionEstablishedEvent before reading handshake
This commit is contained in:
parent
a43aa18a22
commit
01dd765bd2
|
|
@ -24,7 +24,7 @@ import com.loohp.limbo.network.ClientConnection;
|
|||
|
||||
public class ConnectionEstablishedEvent extends Event {
|
||||
|
||||
private ClientConnection connection;
|
||||
private final ClientConnection connection;
|
||||
|
||||
public ConnectionEstablishedEvent(ClientConnection connection) {
|
||||
this.connection = connection;
|
||||
|
|
|
|||
|
|
@ -320,6 +320,9 @@ public class ClientConnection extends Thread {
|
|||
try {
|
||||
clientSocket.setKeepAlive(true);
|
||||
setChannel(new DataInputStream(clientSocket.getInputStream()), new DataOutputStream(clientSocket.getOutputStream()));
|
||||
|
||||
Limbo.getInstance().getEventsManager().callEvent(new ConnectionEstablishedEvent(this));
|
||||
|
||||
int handShakeSize = DataTypeIO.readVarInt(channel.input);
|
||||
|
||||
//legacy ping
|
||||
|
|
@ -342,8 +345,6 @@ public class ClientConnection extends Thread {
|
|||
state = ClientState.DISCONNECTED;
|
||||
}
|
||||
|
||||
Limbo.getInstance().getEventsManager().callEvent(new ConnectionEstablishedEvent(this));
|
||||
|
||||
PacketHandshakingIn handshake = (PacketHandshakingIn) channel.readPacket(handShakeSize);
|
||||
|
||||
boolean isBungeecord = Limbo.getInstance().getServerProperties().isBungeecord();
|
||||
|
|
|
|||
Loading…
Reference in New Issue