-
Notifications
You must be signed in to change notification settings - Fork 11
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
Improve PF packet logic #306
base: master
Are you sure you want to change the base?
Conversation
@@ -1029,7 +1029,7 @@ CodeInjection multi_io_process_packets_injection{ | |||
0x0047918D, | |||
[](auto& regs) { | |||
int packet_type = regs.esi; | |||
if (packet_type > 0x37) { | |||
if (packet_type > 0x37 || packet_type == static_cast<int>(pf_packet_type::player_stats)) { |
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.
nice catch
game_patch/purefaction/pf.cpp
Outdated
std::memcpy(&in_stats, player_stats_ptr, sizeof(in_stats)); | ||
player_stats_ptr += sizeof(in_stats); | ||
auto* player = rf::multi_find_player_by_id(in_stats.player_id); | ||
if (player) { | ||
auto& stats = *static_cast<PlayerStatsNew*>(player->stats); | ||
// Ignore `is_pure`. Why is it in `player_stats`? |
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.
I think it makes sense in case AC checks every X seconds whatever you modified something, e.g. using CheatEngine. So we could probably use that. I don't see any downsides. WDYT?
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.
I guess so. Can PF fail auth after a player has authed?
@@ -13,6 +13,7 @@ struct PlayerStatsNew : rf::PlayerLevelStats | |||
float num_shots_fired; | |||
float damage_received; | |||
float damage_given; | |||
std::optional<uint8_t> received_accuracy{}; |
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.
what is your plan for this field? I don't think PF shown it anywhere... Do you think it should be visible in the scoreboard? I worry that people with bad skill wouldn't like it...
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.
it was in spectate iirc
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.
It is for spectate but could include console cmds or score board.
docs/CHANGELOG.md
Outdated
@@ -51,6 +51,7 @@ Version 1.9.0 (not released yet) | |||
- Support `©` in TrueType fonts | |||
- Improve frag messages | |||
- Search in command descriptions in `.` command | |||
- Improve PF packet logic |
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.
It's a bit generic. Does this change has any user-facing impact? I usually avoid adding changelog entries for purely technical changes
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.
Well PF clients shall see changes and it is what enables browser identifiers so I think it is worth something.
Recognize browsers and also support anticheat status and fire accuracy.
I cannot change anticheat code so it is a best effort.
This PR does not fix that
send_pf_player_stats_packet
is not regularly called.