ENTITIES/mcl_boats: Fix server crash when boat passenger sneaks #91
No reviewers
Labels
No Label
blocker
bug
code quality
confirmed
critical
discussion
high priority
incompatibility
incomplete feature
invalid
low priority
missing feauture
needs testing
packet spam
performance
project
regression
translations
unconfirmed
in review
ready for review
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Mineclonia/Mineclonia#91
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix-boat-passenger-sneaking-crash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
TRACKING ISSUE: #89
This patch fixes a crash that occurs when a player who is not a driver of a boat sneaks.
Solution
Instead of “detach_player” (a function that does not exist), “detach_object” (a function that does exist) is called when the player sneaks inside a boat. This makes the player exit the boat.
Details
This seems to be a simple typo/brainfart in the original code.
Most likely, code paths involving two players in a boat were never tested exhaustively.
Testing Steps
Verify the crash happens (skip if you did it once)
6c311d5528
, create a new world called “boatcrash” in the Minetest GUI. Then exit minetest.minetest --server --worldname boatcrash
.Verify that the patch actually fixes the crash
764ff5512a
, create a new world called “boatcrash2” in the Minetest GUI. Then exit minetest.minetest --server --worldname boatcrash2
.To do
fd9467c0b0
to764ff5512a
WIP: ENTITIES/mcl_boats: Fix server crash when boat passenger sneaksto ENTITIES/mcl_boats: Fix server crash when boat passenger sneaksI did:
Verify the crash happens (skip if you did it once)
1. With Mineclonia commit
6c311d5528
, create a new world called “boatcrash” in the Minetest GUI. Then exit minetest.2. Start a Minetest dedicated server without a GUI with the command
minetest --server --worldname boatcrash
.3. Start a second instance of Minetest. Connect to the server at 127.0.0.1 using a username and password of “a”.
4. As user “a”, place a boat and enter it by right clicking it.
5. Start a third instance of Minetest. Connect to the server at 127.0.0.1 using a username and password of “b”.
6. As user “b”, enter the boat with user “a” in it.
7. As user “b”, press the sneak key.
8. Observe the game crashing.
Verify that the patch actually fixes the crash
1. With Mineclonia commit
764ff5512a
, create a new world called “boatcrash2” in the Minetest GUI. Then exit minetest.2. Start a Minetest dedicated server without a GUI with the command
minetest --server --worldname boatcrash2
.3. Start a second instance of Minetest. Connect to the server at 127.0.0.1 using a username and password of “a”.
4. As user “a”, place a boat and enter it by right clicking it.
5. Start a third instance of Minetest. Connect to the server at 127.0.0.1 using a username and password of “b”.
6. As user “b”, enter the boat with user “a” in it.
7. As user “b”, press the sneak key.
8. User “b” should exit the boat, i.e. be unattached from it and be able to move freely.
9. As user “a”, move the boat around a bit, then also press the sneak key.
10. User “a” should exit the boat, i.e. be unattached from it and be able to move freely.