-
Notifications
You must be signed in to change notification settings - Fork 0
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
CLIENT-NETWORK: Add system receive broadcast position absolute #104
CLIENT-NETWORK: Add system receive broadcast position absolute #104
Conversation
WalkthroughThe changes primarily focus on introducing a new function Changes
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 1
Files selected for processing (4)
- src/Client/Systems/Network/ClientNetwork.cpp (1 hunks)
- src/Client/Systems/Network/ClientNetwork.hpp (1 hunks)
- src/Nitwork/NitworkClient.hpp (1 hunks)
- src/Nitwork/NitworkServer.hpp (1 hunks)
Files skipped from review due to trivial changes (2)
- src/Client/Systems/Network/ClientNetwork.hpp
- src/Nitwork/NitworkClient.hpp
Additional comments (Suppressed): 2
src/Nitwork/NitworkServer.hpp (1)
- 161-165: The function call
sendData<struct packetPositionAbsolute_s>(packet);
has been replaced withsendData<struct packetPositionAbsoluteBroadcast_s>(packet);
. Ensure that the new structpacketPositionAbsoluteBroadcast_s
is defined and compatible with thesendData
function. Also, verify that all instances wherePOSITION_ABSOLUTE_BROADCAST
messages are sent have been updated to use the new packet structure.src/Client/Systems/Network/ClientNetwork.cpp (1)
- 169-192: The new function
receiveBroadcastAbsolutePosition
is introduced to handle the receipt of broadcasted absolute position messages. It uses a mutex to ensure thread safety when accessing the sharedRegistry
object. The function looks for the corresponding player entity in the registry and updates its position. If the entity is not found, the function returns early. This function seems to be well-structured and follows good practices for thread safety and error handling. However, it's important to ensure that the mutex lock doesn't introduce any performance issues or deadlocks.
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.
Review Status
Actionable comments generated: 0
Files selected for processing (1)
- src/Client/Systems/Network/ClientNetwork.cpp (1 hunks)
Additional comments (Suppressed): 2
src/Client/Systems/Network/ClientNetwork.cpp (2)
169-191: The
receiveBroadcastAbsolutePosition
function is well-structured and follows good practices. It uses a mutex to ensure thread safety when accessing the registry, which is crucial in a multi-threaded environment. The function also checks if the other player entity is found in the registry before updating its position, which is a good practice to avoid potential errors. However, it's important to ensure that themsgPositionAbsoluteBroadcast_s
structure andmsg
object are correctly defined and populated before they are used.193-195: The
getNetworkSystems
function is not updated to include the newreceiveBroadcastAbsolutePosition
function. As per the previous comment chain, this is intentional and does not need to be changed.
MINOR
What is the current behavior? (link an issue based on the kind of change this pr introduce)
What is the new behavior (if this is a feature change)?
Other information:
Summary by CodeRabbit