SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
84 stars 18 forks source link

Placing claim flags (and other barricades/structures) inside of other objects #1520

Closed ghost closed 2 years ago

ghost commented 4 years ago

Currently, the client does calculations to see if it's able to place something, and so you cannot place down a claim flag and then a wall, but if you place down both at the same time those checks are bypassed, and the server itself doesn't seem to check, so you can place down claim flags inside of walls and objects. 3236d26a69a4 It looks like you could fix this by making the server do the same check as the clients for space, or possibly by making the client do the space check at the end of the placement animation as well if the server check would be hard to implement.

SDGNelson commented 4 years ago

Interesting point. The server does a check for objects of the same type being placed together at the same time, but this needs a physics check. IIRC the client does also check at the end of the animation, but may not have been notified of the claim flag yet. Not sure how we will deal with this yet but will think about it...

ghost commented 4 years ago

Interesting point. The server does a check for objects of the same type being placed together at the same time, but this needs a physics check. IIRC the client does also check at the end of the animation, but may not have been notified of the claim flag yet. Not sure how we will deal with this yet but will think about it...

I could be entirely wrong, but I don't think the client checks twice, checkSpace() in usuablebarricade is only called by check() which is only called in tick() for highlightertool and startPrimary().

If you want just the client to do the work, you could add onto the BuildingRequestManager to have it wait for a few ticks and ask the clients to re-verify space via an RPC if they're placing too close. You could do that just for "high risk" barricades such as claim flags or sentries. A less iffy solution could be to have the client have its own upgraded BuildingRequestManager to know the locations of other placements and have checkSpace simulate the placements, both at the end and start of the animation.

ghost commented 4 years ago

Just a minor update, per #1527, it would be nice if you expanded the collision for them a bit in order to prevent placing inside of objects. You don't even need two people or anything fancy for this, you can just straight up place claim flags inside of some barricades. Hopefully, that is at least easier to fix than two people placing, and from what I've seen, it is the main source for abuse as you can efficiently lay down a ton of claim flags and easily put down pillars on top of them. Unturned_GQ3nrGyV21

Unturned_kkiefRa0GG Unturned_dyL0nywYh9

SDGNelson commented 4 years ago

This was not addressed yet, but also adding that players have reported putting ceilings inside floors for reinforcement. https://www.youtube.com/watch?v=PvA21PJf8KY

SDGNelson commented 2 years ago

This should finally be fixed in tomorrow's update! 🥳