Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fivem/state): add ConVar & Native to disallow server created entities being deleted by the client #2429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AvarianKnight
Copy link
Contributor

Goal of this PR

Disallow server-created entities from being deleted by clients when sv_disallowClientDelete is set to true.

How is this PR achieving the goal

Adds a new check to ProcessCloneRemove to block the deletion of the server spawned created and recreate the entity for the calling client.

The way this is done isn't perfect (the entity will flicker for the person requesting the delete) but this shouldn't have any possible regressions (hopefully)

This PR applies to the following area(s)

Server

Successfully tested on

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Mar 18, 2024
@william-des
Copy link
Contributor

It's a great idea to provide a way to prevent the deletion of server-created entities. However, I think it would be beneficial to add native functions to allow or disallow the deletion of entities regardless of the convar value (similar to SetEntityIgnoreRequestControlFilter) A convar is not very flexible; for some servers, it could involve modifying a considerable number of scripts, which can be particularly complicated with the increasing use of escrowed resources.

@AvarianKnight
Copy link
Contributor Author

It's a great idea to provide a way to prevent the deletion of server-created entities. However, I think it would be beneficial to add native functions to allow or disallow the deletion of entities regardless of the convar value (similar to SetEntityIgnoreRequestControlFilter) A convar is not very flexible; for some servers, it could involve modifying a considerable number of scripts, which can be particularly complicated with the increasing use of escrowed resources.

This is a good idea, I will implement it here in a bit.

@AvarianKnight AvarianKnight force-pushed the feat/disallow-client-deletion branch 3 times, most recently from bff6769 to b32dc9e Compare March 19, 2024 09:08
@AvarianKnight
Copy link
Contributor Author

This now adds SET_ENTITY_REJECTS_CLIENT_DELETION and adds another flag rejectClientDeletion that will default to the value of sv_disallowClientDelete

@AvarianKnight AvarianKnight changed the title feat(fivem/state): add ConVar to disallow server created entities being deleted by the client feat(fivem/state): add ConVar & Native to disallow server created entities being deleted by the client Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants