-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(gamestate/fivem): add a ConVar to disable REQUEST_RAGDOLL_EVENT #2244
feat(gamestate/fivem): add a ConVar to disable REQUEST_RAGDOLL_EVENT #2244
Conversation
d040826
to
e4c710f
Compare
As pointed out by @packfile, the initial implementation which filtered to not allow this for player peds specifically would break game functionality (i.e. stun guns, and possibly other stuff). Players who disable |
Hi, @AvarianKnight I think this should not break game functionality, I've tested with stun guns and everything is working fine with my code #2237 (and canceling the event) |
Stun gun was not working when testing this, are you sure had stun guns working when testing? |
https://streamable.com/g6z3nr shows a few cases where this event is triggered in gameplay: ramming peds with a vehicle, using the up-n-atomiser, falling over in rapids, punching & shooting peds, and setting them alight to mention a few Unsure if disabling this event would have any negative impact on the above, so it's worth this change being tested on those? |
e4c710f
to
510a2f5
Compare
Is it possible for us to somehow validate expected use cases here? A toggle like this seems risky given the side effects. |
Expected use case is to block players from exploiting the game event you can see some previous discussion in #2237. The main difference is that this PR doesn't expose the event handler to the end user. |
I was unable to reproduce the mentioned misuse of this event with normal native invocations within the given ScRTs, did anyone confirm that this game event is triggered when the mentioned behavior appears? Adding to @packfile's notes:
As this only seems to be misused on player-peds and blocking this doesn't seem to change any important behavior (at least from what I have gathered), maybe it works to just disable this for player-peds through a ConVar. Additionally, the video in #2237 (comment) shows a somewhat similar ragdoll-physic like when lightly hitting a player-ped with a vehicle, where this event isn't triggered. (Speculation: ragdoll is triggered by the owning client due to collision with a moving entity?) |
Going to post some previous discussion from the engineering discord: Tasing a ped you don't own does a If you tase a regular ped you go through a weird chain:
If you tase a Player everything happens pretty much instantly. 2023-10-18.17-12-51.mp4A weird quirk is that it doesn't matter if it gets canceled, at least for |
@CiastekbatakPro's solution blocks too many base-game events where ragdoll-physics are used. I was able to test the solution provided by @AvarianKnight with the mentioned "tools/cheats" and can confirm that blocking this event fixes the mentioned abuse. (Video down below) I wasn't able to find any game situation where blocking this event had any impact on the behavior (tasing, RAGDOLL_REQUEST_EVENT.mp4 |
I would like the opinion of @blattersturm here, as there's a bit of a cross roads.
The user will complain either way, I think that having a specific way to block this abuse is probably the better idea even with the draw backs. That being said, I think if the user opts-in to this possibly breaking change they should be greeted with a warning message that cannot be disabled so they know (even if they copy paste from somewhere else) that this can possibly break functionality. |
Hi @AvarianKnight, I think with the PR that I made users have the ability to customize the blocked cases. It wouldn't be just an on/off switch! Tell me what you think. |
Newer event handlers aren't supposed to expose the event, only convars. |
In the worst case scenario since this is very game logic dependent, it might be viable to expose an event anyway. Alternately, filtering this in client-side code to only act in legitimate use cases (or filter out blatantly illegitimate use cases) might also help. |
It seems like that in a networked environment this event doesn't matter for the actual ragdoll behavior of player-controlled peds. If the requesting client applies any type of damage to the player ped of the receiving client, the receiving client handles the ragdoll itself due to the damage event, the same for tasing and other cases where game logic invokes ped ragdoll events. I couldn't find any edge case where the receiving client doesn't invoke the ragdoll by itself due to missing context. The only case where this event matters is when the receiving client has some sort of desync happening and rejects/misses the specific game event that invokes the ragdoll (like damage/collision), but this might even improve sync accuracy in those cases as I personally remember a lot of situations where I ragdolled from a collision with a player-driven car even when the car didn't hit me on my client. |
Closing this as this PR didn't resolve the initial issue, likely cases of people abusing this are via |
Reopening as @tens0rfl0w mentioned this did fix some cases of abuse |
This was fixed with 468a8fa |
This is a follow up to some of the discussion from #2237
This adds a ConVar for server owners to disable ragdoll requests
set sv_enableRagdollRequests false
.