Skip to content

fix: MessageContent::Build being called too late - #22

Merged
LumiFae merged 1 commit into
DiscordLabSCP:mainfrom
OMEGA3065:fix/TranslationBuilderWaitTime
Mar 5, 2026
Merged

fix: MessageContent::Build being called too late#22
LumiFae merged 1 commit into
DiscordLabSCP:mainfrom
OMEGA3065:fix/TranslationBuilderWaitTime

Conversation

@OMEGA3065

Copy link
Copy Markdown
Contributor

MessageContent::Build is called on the main thread fixing the Unity crashes, but this is at a cost of data accuracy.

The old system used data from when the event occurred, but the new system can be 1 Frame/Tick too late causing some data to be unusable.

An example of this is how DeathLogs would have the Player's (person who is killed) role be replaced with the role before they died (useful), but with the new system calling the builder 1 frame later causes it to be always set to Spectator.

This could be potentially also fixed by using some sort of snapshot system where data that can be used is fed into the translation methods generating delegates which will return the correct data based on the player or simply by having a custom class which will store all necessary player data.

…te after the event causing it to have not up-to-date values
Comment thread DiscordLab.Bot/API/Features/MessageContent.cs
@OMEGA3065
OMEGA3065 requested a review from LumiFae March 5, 2026 08:26
@OMEGA3065
OMEGA3065 force-pushed the fix/TranslationBuilderWaitTime branch from 3678ea6 to 921361c Compare March 5, 2026 17:35

@LumiFae LumiFae left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

peak, tyvm

@LumiFae
LumiFae merged commit df77644 into DiscordLabSCP:main Mar 5, 2026
@OMEGA3065
OMEGA3065 deleted the fix/TranslationBuilderWaitTime branch March 5, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants