Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Suspect this is the fix to #203, but I'm unsure
Dieser Commit ist enthalten in:
Ursprung
c26dc75c44
Commit
74afcee9ba
@ -19,6 +19,7 @@ import com.velocitypowered.proxy.protocol.packet.Disconnect;
|
|||||||
import com.velocitypowered.proxy.protocol.packet.JoinGame;
|
import com.velocitypowered.proxy.protocol.packet.JoinGame;
|
||||||
import com.velocitypowered.proxy.protocol.packet.KeepAlive;
|
import com.velocitypowered.proxy.protocol.packet.KeepAlive;
|
||||||
import com.velocitypowered.proxy.protocol.packet.PluginMessage;
|
import com.velocitypowered.proxy.protocol.packet.PluginMessage;
|
||||||
|
import com.velocitypowered.proxy.protocol.util.PluginMessageUtil;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@ -134,6 +135,14 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We need to specially handle REGISTER and UNREGISTER packets. Later on, we'll write them to
|
||||||
|
// the client.
|
||||||
|
if (PluginMessageUtil.isRegister(packet)) {
|
||||||
|
serverConn.getPlayer().getKnownChannels().addAll(PluginMessageUtil.getChannels(packet));
|
||||||
|
} else if (PluginMessageUtil.isUnregister(packet)) {
|
||||||
|
serverConn.getPlayer().getKnownChannels().removeAll(PluginMessageUtil.getChannels(packet));
|
||||||
|
}
|
||||||
|
|
||||||
// We always need to handle plugin messages, for Forge compatibility.
|
// We always need to handle plugin messages, for Forge compatibility.
|
||||||
if (serverConn.getPhase().handle(serverConn, serverConn.getPlayer(), packet)) {
|
if (serverConn.getPhase().handle(serverConn, serverConn.getPlayer(), packet)) {
|
||||||
// Handled, but check the server connection phase.
|
// Handled, but check the server connection phase.
|
||||||
|
@ -44,6 +44,9 @@ class CappedCollectionTest {
|
|||||||
assertTrue(coll.addAll(doesFill2), "did not add items");
|
assertTrue(coll.addAll(doesFill2), "did not add items");
|
||||||
assertThrows(IllegalStateException.class, () -> coll.addAll(overfill),
|
assertThrows(IllegalStateException.class, () -> coll.addAll(overfill),
|
||||||
"items added to collection although it is too full");
|
"items added to collection although it is too full");
|
||||||
|
|
||||||
|
assertFalse(coll.addAll(doesFill1), "added items?!?");
|
||||||
|
|
||||||
assertEquals(3, coll.size(), "collection grew in size unexpectedly");
|
assertEquals(3, coll.size(), "collection grew in size unexpectedly");
|
||||||
}
|
}
|
||||||
}
|
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren