Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-2549

Respawn packet has incorrect encoding

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None
    • OS: Linux, MS Client: Wurst 4.0, Vanilla 1.10.2, Server: 64.34.190.101:28965

      When receiving Respawn (0x33, client-bound) packets from a Spigot 1.10 server, these are encoded incorrectly. The packet format should be as follows:
      4 bytes Int: dimension (-1:nether, 0:overworld, 1:end)
      1 byte Char: difficulty (0:peaceful, 1:easy, 2:normal, 3:hard, bit 3 (+8): hardcore)
      1 byte Char: gamemode (0:survival, 1:creative, 2:adventure, 3:spectator)

      Examples for a Respawn packet received from various servers:

      • from a Spigot 1.10 server (64.34.190.101:28965):
        00 00 00 0b 00 01 07 64 65 66 61 75 6c 74 .......default
        dimension=11 (???), difficulty=peaceful, gamemode=creative
      • from a Vanilla 1.10 server (locally installed):
        ff ff ff ff 01 01 04 66 6c 61 74 .......flat
        dimension=-1 (nether), difficulty=1 (easy), gamemode=1 (creative)

      00 00 00 00 01 01 04 66 6c 61 74 .......flat
      dimension=0 (overworld), difficulty=1 (easy), gamemode=1 (creative)

      • from a Waterfall 1.8/1.9/1.10 server (2b2t.org):
        00 00 00 01 00 00 07 64 65 66 61 75 6c 74 .......default
        dimension=1 (end), difficulty=0 (peaceful), gamemode=0 (survival)

      ff ff ff ff 00 00 07 64 65 66 61 75 6c 74 .......default
      dimension=-1 (nether), difficulty=0 (peaceful), gamemode=0 (survival)

      ff ff ff ff 03 00 07 64 65 66 61 75 6c 74 .......default
      dimension=-1 (nether), difficulty=3 (hard), gamemode=0 (survival)

      My guess is that Spigot 1.10 sends the values of dimension,difficulty,gamemode as shorts, which would interpret the output from the first example as dimension=0 (overworld), difficulty=11 (hard+hardcore), gamemode=0 (survival), while it should encode them as int,byte,byte (in both cases followed by a string)

            Unassigned Unassigned
            Dorquemada Dorquemada
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: