mojira.dev
MC-52817

"Add player" packets and "Remove player" packets being sent out of order

Jimmy and Jenny are playing on their realms server, Jimmys connection is a little bit slow but he decides to have a bit of fun by teleporting himself far away and back again very quickly.

Jenny gets disconnected because Jimmys spawn named entity packet gets sent before his despawn entity packet due to him being despawned and spawned in the same tick, as far as the server is concerned.

Relevant client code causing the issue;

public void a(gb paramgb)
  {
    double d1 = paramgb.f() / 32.0D;
    double d2 = paramgb.g() / 32.0D;
    double d3 = paramgb.h() / 32.0D;
    float f1 = paramgb.i() * 360 / 256.0F;
    float f2 = paramgb.j() * 360 / 256.0F;
    GameProfile localGameProfile = paramgb.e();

    if (this.g.a(localGameProfile.getId()) != null) {
      this.e.a(new fr("disconnect.genericReason", new Object[] { "Server sent invalid player data." }));
    }

    if ((this.e.h()) && (this.f.E() != null) && (!this.f.E().d())) {
      try {
        this.f.ac().getTextures(localGameProfile, true);
      } catch (InsecureTextureException localInsecureTextureException) {
        if (!(localInsecureTextureException instanceof InsecureTextureException.OutdatedTextureException)) {
          this.e.a(new fr("disconnect.genericReason", new Object[] { "Outdated server! Pretending to be 1.7.8" }));
        }
      }
    }

    bnx localbnx = new bnx(this.f.f, paramgb.e());
    localbnx.p = (localbnx.S = localbnx.bZ = paramgb.f());
    localbnx.q = (localbnx.T = localbnx.ca = paramgb.g());
    localbnx.r = (localbnx.U = localbnx.cb = paramgb.h());

    int m = paramgb.k();
    if (m == 0)
      localbnx.bm.a[localbnx.bm.c] = null;
    else {
      localbnx.bm.a[localbnx.bm.c] = new adc(ada.d(m), 1, 0);
    }
    localbnx.a(d1, d2, d3, f1, f2);
    this.g.a(paramgb.d(), localbnx);

    List localList = paramgb.c();
    if (localList != null)
      localbnx.y().a(localList);
  }

Linked issues

Comments 11

/tp commandercarrot ~1000 ~ ~ followed by /tp commandercarrot ~-1000 ~ ~

"Outdated server! Pretending to be 1.7.8" --> There is no need for this message, as far as I see it, it is an incorrect error message that can mislead users and was intended by Mojang as a "cocky" response to servers not fully supporting the new features but allowing newer clients to connect.

The error here is that player packets are being sent out of order for removing-then-adding a player.

Also, this would trigger "Server sent invalid player data." not "Outdated server! Pretending to be 1.7.8" so please keep comments about that error out of this discussion as it's irrelevant. That error can ONLY trigger for servers that did not fully implement the 1.7.8 protocol, whilst this error in question makes no mention of that.

This error /DID/ happen on vanilla, just putting that out there. "/tp commandercarrot ~1000 ~ ~ followed by /tp commandercarrot ~-1000 ~ ~"

Just to be clear, I'm talking about the "Server sent invalid player data." message here.

1 more comments

Here's proof that it happens and can happen in vanilla, https://www.youtube.com/watch?v=3aVzoQp1UTg for reference here.

No one said that error can't happen in vanilla, that's why the ticket is still open. Dinnerbone was saying the "pretending to 1.7.8" error can't happen in vanilla.

He was just adding helpful information to the bug report, no need to jump on him

Having trouble reproducing this. Are you 100% sure it was on a vanilla server? Was that video on a dedicated or lan server?

Scratch that, reproduced.

Awesome, glad this will be fixed.

Ben Smith

Nathan Adams

Unconfirmed

Minecraft 1.7.8

Minecraft 1.7.9

Retrieved