multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.42k stars 438 forks source link

vehicle_contact_sync_radius does nothing #3407

Closed Xenius97 closed 6 months ago

Xenius97 commented 6 months ago

Describe the bug

The new feature introduced in #3391 currently doesn't do anything. In theory, it was supposed to prevent players from teleporting vehicles to themselves. However, it doesn't do anything, and you can still teleport anything to yourself just the same.

Steps to reproduce

https://streamable.com/w2pkkt

Version

MTA:SA Server v1.6-release-22470

Additional context

No response

Relevant log output

No response

Security Policy

Xenius97 commented 6 months ago

my bad, you cannot enter so works fine

theSarrum commented 6 months ago

It's also worth noting that the vehicle teleports just for you (others don't see it).

MegadreamsBE commented 6 months ago

I know it's closed and resolved, but I still would like to give some explanation of what exactly this setting does: The server assigns syncers to vehicles in multiple different ways, the most well known one being based on the distance you are away from the vehicle.

However, there is another instance in which a player is assigned to be the syncer. The first is by pushing the vehicle which sends a vehicle push packet which causes the server to make you the syncer of the vehicle. This was unrestricted before but now has a radius check on the server (vehicle_contact_sync_radius). So, before you could move the vehicle close to yourself client-side, push it (becoming its syncer) and cause the vehicle to also be moved to that location on the server. Now that's not longer possible even if the vehicle visually looks to be near you on the client (but in reality it isn't on the server) as you won't be assigned to be its syncer.

Additionally standing on top of a vehicle has similar result but works different on a technical level. It is controlled by the same setting though.