In "Player packet usage" see all packet types#4779
Open
ArranTuna wants to merge 2 commits intomultitheftauto:masterfrom
Open
In "Player packet usage" see all packet types#4779ArranTuna wants to merge 2 commits intomultitheftauto:masterfrom
ArranTuna wants to merge 2 commits intomultitheftauto:masterfrom
Conversation
FileEX
requested changes
Apr 5, 2026
|
|
||
| constexpr size_t GetPacketIdCount() | ||
| { | ||
| return static_cast<size_t>(PACKET_ID_PLAYER_WORLD_SPECIAL_PROPERTY) + 1; |
Member
There was a problem hiding this comment.
This approach is not safe, because adding a new packet in the future would require manually updating this value.
It might be better to add something like NUM_PACKETS at the end of the ePacketID enum, along with a comment indicating that all new packets should be added above this line.
Comment on lines
+29
to
+31
| std::vector<uchar> GetAllPacketIds() | ||
| { | ||
| std::vector<uchar> packetIds(GetPacketIdCount()); |
|
|
||
| for (size_t index = 0; index < packetIds.size(); ++index) | ||
| { | ||
| packetIds[index] = static_cast<uchar>(index); |
| const uint uiNumPacketIds = NUMELMS(packetIdList); | ||
| // Build the request from the shared packet enum so new packet types show up in | ||
| // getPerformanceStats automatically instead of being hidden behind a stale shortlist. | ||
| auto packetIdList = GetAllPacketIds(); |
Collaborator
Author
|
Thanks FileEX, I've made a new commit which addresses your feedbacks. |
FileEX
approved these changes
Apr 5, 2026
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.
Summary
Current in player packet usage you can only see 3 types, command, lua event, and custom data. There are benefits to seeing all packets in order to detect malicious activity.
Motivation
My server, and after looking at the discord, many other servers are being attacked, one method of attack is certain packet types being sent in by a player, now although the "Packet usage" section shows you which packet is flooding, you don't know whose doing it, until now:
Test plan
I have tried different things and see that it is showing those packets come in, for example shooting would show me 98_Player_bulletsync, being on foot shows 32_Player_puresync, get in a vehicle it changes to 33_Player_vehicle_puresync incoming.
Checklist