feat(server/state): add NETWORK_SET_FIRST_ENTITY_OWNER for server created entites#4007
Open
AvarianKnight wants to merge 1 commit into
Open
feat(server/state): add NETWORK_SET_FIRST_ENTITY_OWNER for server created entites#4007AvarianKnight wants to merge 1 commit into
NETWORK_SET_FIRST_ENTITY_OWNER for server created entites#4007AvarianKnight wants to merge 1 commit into
Conversation
AvarianKnight
force-pushed
the
feat/set-first-owner-tests
branch
from
May 28, 2026 20:50
37ce96c to
6ad6c97
Compare
|
😍 beautiful |
|
merge! |
Contributor
|
This is hot 🔥🔥 |
…reated entitys This allows the server to set the `firstOwner` of the entity when it is spawned, forcing that client (and that client only) to be in charge of the server created entity. This is mainly useful for vehicles, where you can typically expect a certain client to be close to the vehicle that it is spawning, but we need it to be server spawned for persistance and to ensure vehicles aren't created by modders. This is only meant for testing, this needs a proper way to tell if a vehicle, ped or object *can be* relevant to a client. Since it's currently possible that you set the entity owner and then the client never actually syncs the vehicle. This mainly relies on `hasSynced` relevancy checks to stop this from ever migrating the vehicle until we've properly synchronized the vehicle, since before this could just bounce between multiple different clients.
AvarianKnight
force-pushed
the
feat/set-first-owner-tests
branch
from
June 1, 2026 15:18
6ad6c97 to
deff689
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal of this PR
Possibly fix ownership bouncing between different clients
How is this PR achieving the goal
This allows the server to set the first owner of the entity when it is spawned (along with forcing the entity to be owned by them), forcing that client (and that client only) to be in charge of the server created entity.
This is mainly useful for vehicles, where you can typically expect a certain client to be close to the vehicle that it is spawning, but we need it to be server spawned for persistence and to ensure vehicles aren't created by modders.
This is only meant for testing, this needs a proper way to tell if a vehicle, ped or object can be relevant to a client. Since it's currently possible that you set the entity owner and then the client never actually syncs the vehicle.
This mainly relies on
hasSyncedrelevancy checks to stop this from ever migrating the vehicle until we've properly synchronized the vehicle, since before this could just bounce between multiple different clients.This PR applies to the following area(s)
FiveM
Successfully tested on
Checklist
Fixes issues