Skip to content

Conversation

iceiix
Copy link
Owner

@iceiix iceiix commented Apr 26, 2019

@iceiix
Copy link
Owner Author

iceiix commented Apr 26, 2019

Current status: crashes soon after login, thread 'main' panicked at 'Err: IOError(Custom { kind: UnexpectedEof, error: StringError("failed to fill whole buffer") })', src/server/mod.rs:441:33

@iceiix iceiix changed the title 1.14 protocol 1.14 protocol support Apr 26, 2019
@iceiix
Copy link
Owner Author

iceiix commented Apr 27, 2019

thread '' panicked at 'unrecognized recipe type: minecraft:acacia_fence_gate', src/protocol/packet.rs:2504:18

@iceiix
Copy link
Owner Author

iceiix commented Apr 30, 2019

thread '' panicked at 'unrecognized recipe type: minecraft:sandstone_stairs', src/protocol/packet.rs:2504:18

https://wiki.vg/Pre-release_protocol#Declare_Recipes adds minecraft: prefix to recipe types, but doesn't mention minecraft:acacia_fence_gate or minecraft:sandstone_stairs recipe types. Packet structure changed, identifier is now after type instead of before.

@iceiix
Copy link
Owner Author

iceiix commented Apr 30, 2019

Fixed, now a new type: thread '' panicked at 'unrecognized recipe type: stonecutting', src/protocol/packet.rs:2531:18

minecraft:stonecutting;minecraft:nether_brick_slab_from_nether_bricks_stonecutting^@^A^Aâ^A^A^@^A<81>^A^B^@^Yminecraft:crafting_shaped^Tminecraft:bone_block...

'\x00\x01\x01\xe2\x01\x01\x00\x01\x81\x01\x02\x00\x19'
000101e2010100018101020019

@iceiix
Copy link
Owner Author

iceiix commented Apr 30, 2019

Smelting, blasting, smoking, and campfire_cooking all have same group/ingredient/result/experience/cooking time data, but does stonecutting? Appears not:

about to parse id=5a, dir=Clientbound state=Play
thread 'main' panicked at 'Err: IOError(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") })', src/server/mod.rs:442:33

data/minecraft/recipes has some insight, diorite_stairs.json:

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "#  ",
    "## ",
    "###"
  ],
  "key": {
    "#": {
      "item": "minecraft:diorite"
    }
  },
  "result": {
    "item": "minecraft:diorite_stairs",
    "count": 4
  }
}

vs diorite_stairs_from_diorite_stonecutting.json:

{
  "type": "minecraft:stonecutting",
  "ingredient": {
    "item": "minecraft:diorite"
  },
  "result": "minecraft:diorite_stairs",
  "count": 1
} 

and https://minecraft.gamepedia.com/Recipe#minecraft:stonecutting explains - count is required (and shows experience and cookingtime are omitted)

@iceiix
Copy link
Owner Author

iceiix commented Apr 30, 2019

Same crash, need to track down invalid UTF-8 string:

recipe id="minecraft:sandstone_stairs", ty="crafting_shaped", namespace="minecraft:"
recipe id="minecraft:nether_brick_slab_from_nether_bricks_stonecutting", ty="stonecutting", namespace="minecraft:"
thread 'main' panicked at 'Err: IOError(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") })', src/server/mod.rs:442:33

@iceiix iceiix changed the title 1.14 protocol support 1.14 protocol support (477) May 1, 2019
@iceiix
Copy link
Owner Author

iceiix commented May 1, 2019

thread '' panicked at 'called Result::unwrap() on an Err value: FromUtf8Error { bytes: [105, 110, 101, 99, 114, 97, 102, 116, 58, 99, 114, 97, 102, 116, 105, 110, 103, 95, 115, 104, 97, 112, 101, 100, 20, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 98, 111, 110, 101, 95, 98, 108, 111, 99, 107, 3, 3, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 249, 2, 1, 0, 25, 109], error: Utf8Error { valid_up_to: 50, error_len: Some(1) } }', src/libcore/result.rs:1009:5

This decodes to 'inecraft:crafting_shaped\x14minecraft:bone_block\x03\x03\x00\x01\x01\x86\x05\x01\x00\x01\x01\x86\x05\x01\x00\x01\x01\x86\x05\x01\x00\x01\x01\x86\x05\x01\x00\x01\x01\x86\x05\x01\x00\x01\x01\x86\x05\x01\x00\x01\x01\x86\x05\x01\x00\x01\x01\x86\x05\x01\x00\x01\x01\x86\x05\x01\x00\x01\xf9\x02\x01\x00\x19m'

trailing end of: minecraft:stonecutting;minecraft:nether_brick_slab_from_nether_bricks_stonecutting^@^A^Aâ^A^A^@^A<81>^A^B^@^Yminecraft:crafting_shaped^Tminecraft:bone_block

'm' = 109, not a length

@iceiix
Copy link
Owner Author

iceiix commented May 1, 2019

thread '' panicked at 'bad packet id 0x40 in Clientbound Play', src/protocol/versions/v1_14.rs:1:1

@iceiix
Copy link
Owner Author

iceiix commented May 1, 2019

about to parse id=3, dir=Clientbound state=Play
thread 'main' panicked at 'Err: Err("unknown metadata type")', src/server/mod.rs:442:33

https://wiki.vg/Pre-release_protocol#Entity_Metadata_Format

src/types/metadata.rs read_from113
16 Villager Data (already added from snapshot)
17 OptVarInt
18 Pose

@iceiix
Copy link
Owner Author

iceiix commented May 1, 2019

Finally see the world:

Screen Shot 2019-04-30 at 7 06 16 PM

but crashes soon after:

packet = Some(EntityLookAndMove_i16(EntityLookAndMove_i16 { entity_id: 2635, delta_x: -136, delta_y: 287, delta_z: -553, yaw: 118, pitch: 0, on_ground: false }))
about to parse id=3b, dir=Clientbound state=Play
packet = Some(EntityHeadLook(EntityHeadLook { entity_id: 2635, head_yaw: -85 }))
about to parse id=1b, dir=Clientbound state=Play
packet = Some(EntityAction(EntityAction { entity_id: 2388, action_id: 37 }))
about to parse id=51, dir=Clientbound state=Play
packet = Some(EntitySoundEffect(EntitySoundEffect { sound_id: 788, sound_category: 5, entity_id: 0, volume: 0.0000000000000000000000000000000000000002999, pitch: 0.00000000000000000000000000000000000000021237 }))
thread 'main' panicked at 'Err: Err("Failed to read all of packet 0x51, had 11 bytes left")', src/server/mod.rs:442:33

0x51 Sound Effect didn't change according to https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14723, why is it crashing here?

iceiix added a commit that referenced this pull request May 1, 2019
std::io::Read read_to_string() [1] reports this uninformative error:

thread 'main' panicked at 'Err: IOError(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") })', src/server/mod.rs:442:33

Instead of read_to_string(), use read_to_end() to read into a buffer,
then convert using String::from_utf8() and unwrap it. This gives a
better error message when UTF-8 fails to decode:

thread '' panicked at 'called Result::unwrap() on an Err value: FromUtf8Error { bytes: [105, 110, 101, 99, 114, 97, 102, 116, 58, 99, 114, 97, 102, 116, 105, 110, 103, 95, 115, 104, 97, 112, 101, 100, 20, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 98, 111, 110, 101, 95, 98, 108, 111, 99, 107, 3, 3, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 249, 2, 1, 0, 25, 109], error: Utf8Error { valid_up_to: 50, error_len: Some(1) } }', src/libcore/result.rs:1009:5

which is helpful for tracking down protocol errors, such as updating to
a new protocol (developed for GH-132 / GH-72).

[1] https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string
[2] https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8
@iceiix
Copy link
Owner Author

iceiix commented May 1, 2019

Updated readme so it is not missed, but still probably a ways to go. Need to track down what is going on with failing to read the EntitySoundEffect packet (what are the 11 bytes left?), maybe the error is elsewhere?

@iceiix
Copy link
Owner Author

iceiix commented May 1, 2019

0x51 should be SoundEffect: https://wiki.vg/Protocol#Sound_Effect, not EntitySoundEffect. 0x50 is EntitySoundEffect, documentation for 1.14: https://wiki.vg/Pre-release_protocol#Entity_Sound_Effect

@iceiix
Copy link
Owner Author

iceiix commented May 1, 2019

No new assets yet since 1.13+ is a big change from 1.12.x: #71 1.13/1.14 assets

@iceiix iceiix merged commit 5d2146c into master May 1, 2019
@iceiix iceiix deleted the 1.14 branch May 1, 2019 23:33
iceiix added a commit that referenced this pull request May 4, 2019
Adds 1.14 (477) protocol support, based on:

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14723

* New packets: SetDifficulty, LockDifficulty, UpdateJigsawBlock, UpdateViewPosition, UpdateViewDistance

* New metadata: Optional VarInt (17) and Pose (18)

* Add new join game variant with view distance, without difficulty

* Add new server difficulty variant, with locked boolean

* Implement recipe parsing changes, add stonecutting recipe type
iceiix added a commit that referenced this pull request May 4, 2019
Adds 1.14 (477) protocol support, based on:

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14723

* New packets: SetDifficulty, LockDifficulty, UpdateJigsawBlock, UpdateViewPosition, UpdateViewDistance

* New metadata: Optional VarInt (17) and Pose (18)

* Add new join game variant with view distance, without difficulty

* Add new server difficulty variant, with locked boolean

* Implement recipe parsing changes, add stonecutting recipe type
iceiix added a commit that referenced this pull request Feb 1, 2020
std::io::Read read_to_string() [1] reports this uninformative error:

thread 'main' panicked at 'Err: IOError(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") })', src/server/mod.rs:442:33

Instead of read_to_string(), use read_to_end() to read into a buffer,
then convert using String::from_utf8() and unwrap it. This gives a
better error message when UTF-8 fails to decode:

thread '' panicked at 'called Result::unwrap() on an Err value: FromUtf8Error { bytes: [105, 110, 101, 99, 114, 97, 102, 116, 58, 99, 114, 97, 102, 116, 105, 110, 103, 95, 115, 104, 97, 112, 101, 100, 20, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 98, 111, 110, 101, 95, 98, 108, 111, 99, 107, 3, 3, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 249, 2, 1, 0, 25, 109], error: Utf8Error { valid_up_to: 50, error_len: Some(1) } }', src/libcore/result.rs:1009:5

which is helpful for tracking down protocol errors, such as updating to
a new protocol (developed for GH-132 / GH-72).

[1] https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string
[2] https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8
iceiix added a commit that referenced this pull request Feb 1, 2020
Adds 1.14 (477) protocol support, based on:

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14723

* New packets: SetDifficulty, LockDifficulty, UpdateJigsawBlock, UpdateViewPosition, UpdateViewDistance

* New metadata: Optional VarInt (17) and Pose (18)

* Add new join game variant with view distance, without difficulty

* Add new server difficulty variant, with locked boolean

* Implement recipe parsing changes, add stonecutting recipe type
iceiix added a commit that referenced this pull request Feb 1, 2020
std::io::Read read_to_string() [1] reports this uninformative error:

thread 'main' panicked at 'Err: IOError(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") })', src/server/mod.rs:442:33

Instead of read_to_string(), use read_to_end() to read into a buffer,
then convert using String::from_utf8() and unwrap it. This gives a
better error message when UTF-8 fails to decode:

thread '' panicked at 'called Result::unwrap() on an Err value: FromUtf8Error { bytes: [105, 110, 101, 99, 114, 97, 102, 116, 58, 99, 114, 97, 102, 116, 105, 110, 103, 95, 115, 104, 97, 112, 101, 100, 20, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 98, 111, 110, 101, 95, 98, 108, 111, 99, 107, 3, 3, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 249, 2, 1, 0, 25, 109], error: Utf8Error { valid_up_to: 50, error_len: Some(1) } }', src/libcore/result.rs:1009:5

which is helpful for tracking down protocol errors, such as updating to
a new protocol (developed for GH-132 / GH-72).

[1] https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string
[2] https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8
iceiix added a commit that referenced this pull request Feb 1, 2020
Adds 1.14 (477) protocol support, based on:

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14723

* New packets: SetDifficulty, LockDifficulty, UpdateJigsawBlock, UpdateViewPosition, UpdateViewDistance

* New metadata: Optional VarInt (17) and Pose (18)

* Add new join game variant with view distance, without difficulty

* Add new server difficulty variant, with locked boolean

* Implement recipe parsing changes, add stonecutting recipe type
iceiix added a commit that referenced this pull request Feb 1, 2020
std::io::Read read_to_string() [1] reports this uninformative error:

thread 'main' panicked at 'Err: IOError(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") })', src/server/mod.rs:442:33

Instead of read_to_string(), use read_to_end() to read into a buffer,
then convert using String::from_utf8() and unwrap it. This gives a
better error message when UTF-8 fails to decode:

thread '' panicked at 'called Result::unwrap() on an Err value: FromUtf8Error { bytes: [105, 110, 101, 99, 114, 97, 102, 116, 58, 99, 114, 97, 102, 116, 105, 110, 103, 95, 115, 104, 97, 112, 101, 100, 20, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 98, 111, 110, 101, 95, 98, 108, 111, 99, 107, 3, 3, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 249, 2, 1, 0, 25, 109], error: Utf8Error { valid_up_to: 50, error_len: Some(1) } }', src/libcore/result.rs:1009:5

which is helpful for tracking down protocol errors, such as updating to
a new protocol (developed for GH-132 / GH-72).

[1] https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string
[2] https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8
iceiix added a commit that referenced this pull request Feb 1, 2020
Adds 1.14 (477) protocol support, based on:

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14723

* New packets: SetDifficulty, LockDifficulty, UpdateJigsawBlock, UpdateViewPosition, UpdateViewDistance

* New metadata: Optional VarInt (17) and Pose (18)

* Add new join game variant with view distance, without difficulty

* Add new server difficulty variant, with locked boolean

* Implement recipe parsing changes, add stonecutting recipe type
iceiix added a commit that referenced this pull request Feb 2, 2020
std::io::Read read_to_string() [1] reports this uninformative error:

thread 'main' panicked at 'Err: IOError(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") })', src/server/mod.rs:442:33

Instead of read_to_string(), use read_to_end() to read into a buffer,
then convert using String::from_utf8() and unwrap it. This gives a
better error message when UTF-8 fails to decode:

thread '' panicked at 'called Result::unwrap() on an Err value: FromUtf8Error { bytes: [105, 110, 101, 99, 114, 97, 102, 116, 58, 99, 114, 97, 102, 116, 105, 110, 103, 95, 115, 104, 97, 112, 101, 100, 20, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 98, 111, 110, 101, 95, 98, 108, 111, 99, 107, 3, 3, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 1, 134, 5, 1, 0, 1, 249, 2, 1, 0, 25, 109], error: Utf8Error { valid_up_to: 50, error_len: Some(1) } }', src/libcore/result.rs:1009:5

which is helpful for tracking down protocol errors, such as updating to
a new protocol (developed for GH-132 / GH-72).

[1] https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_string
[2] https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8
iceiix added a commit that referenced this pull request Feb 2, 2020
Adds 1.14 (477) protocol support, based on:

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14723

* New packets: SetDifficulty, LockDifficulty, UpdateJigsawBlock, UpdateViewPosition, UpdateViewDistance

* New metadata: Optional VarInt (17) and Pose (18)

* Add new join game variant with view distance, without difficulty

* Add new server difficulty variant, with locked boolean

* Implement recipe parsing changes, add stonecutting recipe type
iceiix added a commit that referenced this pull request Feb 2, 2020
Adds 1.14 (477) protocol support, based on:

https://wiki.vg/index.php?title=Pre-release_protocol&oldid=14723

* New packets: SetDifficulty, LockDifficulty, UpdateJigsawBlock, UpdateViewPosition, UpdateViewDistance

* New metadata: Optional VarInt (17) and Pose (18)

* Add new join game variant with view distance, without difficulty

* Add new server difficulty variant, with locked boolean

* Implement recipe parsing changes, add stonecutting recipe type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant