Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Don't fire a FML reset packet on first login, set it as required for the second join after the first.
Fixes #69
Dieser Commit ist enthalten in:
Ursprung
ab2c887e2c
Commit
f10e9ac8e4
@ -82,12 +82,6 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
|
|||||||
if (existingConnection == null) {
|
if (existingConnection == null) {
|
||||||
// Strap on the play session handler
|
// Strap on the play session handler
|
||||||
connection.getPlayer().getConnection().setSessionHandler(new ClientPlaySessionHandler(server, connection.getPlayer()));
|
connection.getPlayer().getConnection().setSessionHandler(new ClientPlaySessionHandler(server, connection.getPlayer()));
|
||||||
|
|
||||||
// This is for legacy Forge servers - during first connection the FML handshake will transition to complete regardless
|
|
||||||
// Thus, we need to ensure that a reset packet is ALWAYS sent on first switch.
|
|
||||||
//
|
|
||||||
// The call will handle if the player is not a Forge player appropriately.
|
|
||||||
connection.getPlayer().getConnection().setCanSendLegacyFMLResetPacket(true);
|
|
||||||
} else {
|
} else {
|
||||||
// The previous server connection should become obsolete.
|
// The previous server connection should become obsolete.
|
||||||
// Before we remove it, if the server we are departing is modded, we must always reset the client state.
|
// Before we remove it, if the server we are departing is modded, we must always reset the client state.
|
||||||
|
@ -164,9 +164,19 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
public void handleBackendJoinGame(JoinGame joinGame) {
|
public void handleBackendJoinGame(JoinGame joinGame) {
|
||||||
resetPingData(); // reset ping data;
|
resetPingData(); // reset ping data;
|
||||||
if (!spawned) {
|
if (!spawned) {
|
||||||
// nothing special to do here
|
// Nothing special to do with regards to spawning the player
|
||||||
spawned = true;
|
spawned = true;
|
||||||
player.getConnection().delayedWrite(joinGame);
|
player.getConnection().delayedWrite(joinGame);
|
||||||
|
|
||||||
|
// We have something special to do for legacy Forge servers - during first connection the FML handshake
|
||||||
|
// will transition to complete regardless. Thus, we need to ensure that a reset packet is ALWAYS sent on
|
||||||
|
// first switch.
|
||||||
|
//
|
||||||
|
// As we know that calling this branch only happens on first join, we set that if we are a Forge
|
||||||
|
// client that we must reset on the next switch.
|
||||||
|
//
|
||||||
|
// The call will handle if the player is not a Forge player appropriately.
|
||||||
|
player.getConnection().setCanSendLegacyFMLResetPacket(true);
|
||||||
} else {
|
} else {
|
||||||
// Ah, this is the meat and potatoes of the whole venture!
|
// Ah, this is the meat and potatoes of the whole venture!
|
||||||
//
|
//
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren