3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

Don't add player to world if join event did it already.

On join we unconditionally add the player to the world they logged out in.
If a plugin teleports a player during PlayerJoinEvent in a way that adds
them to a world (cross-world teleport) we end up with one player in two
places. To avoid this we check to see if the player has changed worlds or
is already added to the world we have we skip adding them again.
Dieser Commit ist enthalten in:
Travis Watkins 2012-11-18 20:18:30 -06:00 committet von EvilSeph
Ursprung cc78e17312
Commit 8f4cde24bd

Datei anzeigen

@ -160,8 +160,12 @@ public abstract class ServerConfigurationManagerAbstract {
this.cserver.onPlayerJoin(playerJoinEvent.getPlayer());
// CraftBukkit end
worldserver.addEntity(entityplayer);
this.a(entityplayer, (WorldServer) null);
// CraftBukkit start - only add if the player wasn't moved in the event
if (entityplayer.world == worldserver && !worldserver.players.contains(entityplayer)) {
worldserver.addEntity(entityplayer);
this.a(entityplayer, (WorldServer) null);
}
// CraftBukkit end
// CraftBukkit start - sendAll above replaced with this loop
Packet201PlayerInfo packet = new Packet201PlayerInfo(entityplayer.listName, true, 1000);