-
-
Notifications
You must be signed in to change notification settings - Fork 532
Enforce server-side jetpack state #4595
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
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
|
Okay, you’re actually right. There’s no way for a player to have a jetpack on the client side. |
Co-authored-by: Nico <122193236+Nico8345@users.noreply.github.com>
Co-authored-by: Nico <122193236+Nico8345@users.noreply.github.com>
Co-authored-by: Nico <122193236+Nico8345@users.noreply.github.com>
Co-authored-by: Nico <122193236+Nico8345@users.noreply.github.com>
Co-authored-by: Nico <122193236+Nico8345@users.noreply.github.com>
Co-authored-by: Nico <122193236+Nico8345@users.noreply.github.com>
Nico8345
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
qaisjp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great suggestion. some questions
| // Remove jetpack if he has one | ||
| if (pPed->IsPlayer() && pPed->HasJetPack()) | ||
| pPed->SetHasJetPack(false); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this change? Is this because we need to account for all the scenarios where the client automatically unsets the jetpack state?
| pPlayer->SetHealth(0.0f); | ||
| pPlayer->SetArmor(0.0f); | ||
| pPlayer->SetPosition(Packet.m_vecPosition); | ||
| pPlayer->SetHasJetPack(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same q as above
| // Remove jetpack from him | ||
| if (pPed->IsPlayer() && pPed->HasJetPack()) | ||
| pPed->SetHasJetPack(false); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same q as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I’m working on it. I think I’ll find time for it over the weekend.
|
|
||
| pSourcePlayer->SetInWater(flags.data.bIsInWater); | ||
| pSourcePlayer->SetOnGround(flags.data.bIsOnGround); | ||
| pSourcePlayer->SetHasJetPack(flags.data.bHasJetPack); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the specific important change for ignoring the client's opinion on the jetpack state?
On most MTA servers, a jetpack can only be granted by an moderator or administrator. Allowing clients to spoof a jetpack state can mislead players into thinking the cheater is a member of the administration or development team, which could later be exploited for scamming.
This PR forces the server-side jetpack state when synchronizing players. There is no legitimate way to grant a jetpack on the client side, so relying on client-provided jetpack data is inherently suspicious and should not be used.