Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Fire ServerConnectedEvent and delay setting the server.
For ViaVersion
Dieser Commit ist enthalten in:
Ursprung
fcef623847
Commit
174cd4659b
@ -27,7 +27,6 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void activated() {
|
public void activated() {
|
||||||
server.getEventManager().fireAndForget(new ServerConnectedEvent(serverConn.getPlayer(), serverConn.getServer()));
|
|
||||||
serverConn.getServer().addPlayer(serverConn.getPlayer());
|
serverConn.getServer().addPlayer(serverConn.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.velocitypowered.proxy.connection.backend;
|
package com.velocitypowered.proxy.connection.backend;
|
||||||
|
|
||||||
|
import com.velocitypowered.api.event.player.ServerConnectedEvent;
|
||||||
import com.velocitypowered.api.proxy.ConnectionRequestBuilder;
|
import com.velocitypowered.api.proxy.ConnectionRequestBuilder;
|
||||||
import com.velocitypowered.api.util.GameProfile;
|
import com.velocitypowered.api.util.GameProfile;
|
||||||
import com.velocitypowered.proxy.VelocityServer;
|
import com.velocitypowered.proxy.VelocityServer;
|
||||||
@ -103,9 +104,12 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
|
|||||||
existingConnection.disconnect();
|
existingConnection.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
resultFuture.complete(ConnectionRequestResults.SUCCESSFUL);
|
server.getEventManager().fire(new ServerConnectedEvent(serverConn.getPlayer(), serverConn.getServer()))
|
||||||
serverConn.getConnection().setSessionHandler(new BackendPlaySessionHandler(server, serverConn));
|
.whenCompleteAsync((x, error) -> {
|
||||||
serverConn.getPlayer().setConnectedServer(serverConn);
|
resultFuture.complete(ConnectionRequestResults.SUCCESSFUL);
|
||||||
|
serverConn.getConnection().setSessionHandler(new BackendPlaySessionHandler(server, serverConn));
|
||||||
|
serverConn.getPlayer().setConnectedServer(serverConn);
|
||||||
|
}, serverConn.getConnection().eventLoop());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren