refact(skymp5-server): introduce GetActorToSendTo to make packets routing explicit#2553
Merged
Pospelove merged 3 commits intoskyrim-multiplayer:mainfrom Apr 16, 2026
Merged
Conversation
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to fbbea00 in 1 minute and 13 seconds. Click for details.
- Reviewed
243lines of code in6files - Skipped
0files when reviewing. - Skipped posting
8draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. PartOne.cpp:190
- Draft comment:
In SetUserActor the hoster mapping for an actor is cleared (using worldState.hosters.erase). Make sure this removal is safe against concurrent updates and that it doesn’t inadvertently remove valid hoster state. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. PartOne.cpp:703
- Draft comment:
The lambda for getUserId in CreateFormCallbacks returns st->UserByActor(actor). Ensure callbacks and actor pointers are always valid to prevent runtime exceptions. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. PartOne.cpp:544
- Draft comment:
In SetPrivateKey and SignedJS the OpenSSLSigner is attached and a signature is appended to JS code. Verify that the private key is securely handled and that the client properly parses the appended signature comment. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. PartOne.cpp:904
- Draft comment:
In TickDeferredMessages and packet history playback, the packet history buffer is accessed using saved offsets and lengths. Ensure that the buffer bounds are validated to avoid potential out‐of‐bounds access. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. MpObjectReference.cpp:1840
- Draft comment:
In SendInventoryUpdate the BitStream’s raw data is reinterpreted for sending. Consider adding extra validation on the stream data pointer and size to ensure that the data is valid when sending. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. MpObjectReference.cpp:59
- Draft comment:
In PreparePropertyMessage_ the code accesses base.rec to retrieve the record type. Add a safeguard in case LookupById returns a null record so that baseRecordType is handled gracefully. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. MpObjectReference.cpp:1822
- Draft comment:
In MoveOnGrid, objects recalc grid positions on every position update. Consider caching grid cell calculations if many objects update frequently to avoid performance bottlenecks. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
8. MpObjectReference.cpp:1182
- Draft comment:
In ApplyChangeForm a call to std::terminate is used if setProperty has been called already. Verify that killing the process in this scenario is intended, or consider a less drastic error handling strategy. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_2xlqVyMMf7QcaYGZ
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
F02K
pushed a commit
to F02K/skymp
that referenced
this pull request
Apr 23, 2026
F02K
pushed a commit
to F02K/skymp
that referenced
this pull request
Apr 24, 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.
Important
Refactor message sending in
skymp5-serverby introducingGetActorToSendTo()inMpActorto handle offline actors and fix the "invisible chat" bug.GetActorToSendTo()inMpActorto determine the correct actor for message sending, considering hosters.GetActorToSendTo().SendToUser()inActionListener.cpp,MpActor.cpp, andMpObjectReference.cppto fix the "invisible chat" bug.GetUserIdFntoFormCallbacksto retrieve user ID fromMpActor.SendToUser()calls withGetActorToSendTo().SendToUser()in multiple functions acrossMpActor.cppandMpObjectReference.cpp.CreateFormCallbacks()inPartOne.cppto includegetUserIdfunction.This description was created by
for fbbea00. You can customize this summary. It will automatically update as commits are pushed.