Skip to content
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

Workaround CS:GO Stringtable bug #1046

Merged
merged 1 commit into from Jul 19, 2019

Conversation

@asherkin
Copy link
Member

asherkin commented Jul 18, 2019

The cause of the infamous "Index error writing string table baseline"
error appears to be a timing issue between the engine's network message
processing, the stringtable encoding, and command processing when adding
stringtable entries in OnConfigsExecuted.

When the first client connects the map is re-loaded which causes a full
refresh, the game's stringtable entries are added at tick 65, the client
connection is registered at tick 66, and stringtable entries added in
OnConfigsExecuted are registered as being added in tick 67. The engine
later calls WriteBaselines with the client's signon tick, and neglects
to encode the SM added entries as it considers them from the future.

To avoid this, always pass INT_MAX as the current tick when encoding
the baseline, so all stringtable entries are included regardless of when
they were added. Tested on both Windows and Linux.

The cause of the infamous "Index error writing string table baseline"
error appears to be a timing issue between the engine's network message
processing, the stringtable encoding, and command processing when adding
stringtable entries in OnConfigsExecuted.

When the first client connects the map is re-loaded which causes a full
refresh, the game's stringtable entries are added at tick 65, the client
connection is registered at tick 66, and stringtable entries added in
OnConfigsExecuted are registered as being added in tick 67. The engine
later calls WriteBaselines with the client's signon tick, and neglects
to encode the SM added entries as it considers them from the future.

To avoid this, always pass INT_MAX as the current tick when encoding
the baseline, so all stringtable entries are included regardless of when
they were added. Tested on both Windows and Linux.
@asherkin asherkin requested review from psychonic and Drifter321 Jul 18, 2019
@peace-maker

This comment has been minimized.

Copy link
Contributor

peace-maker commented Jul 18, 2019

Are you sure there are no side effects from always passing INT_MAX instead of only for the first client?

@asherkin

This comment has been minimized.

Copy link
Member Author

asherkin commented Jul 18, 2019

It’s definitely fine, for later clients their signon tick is already far in the future than the added entries.

@KyleSanderson

This comment has been minimized.

Copy link
Member

KyleSanderson commented Jul 19, 2019

Can we get this in cstrike?

Copy link
Member

Drifter321 left a comment

lgtm

Copy link
Member

Headline left a comment

nice

@VoiDeD
VoiDeD approved these changes Jul 19, 2019
@asherkin

This comment has been minimized.

Copy link
Member Author

asherkin commented Jul 19, 2019

Can we get this in cstrike?

As far as I know CS:GO is the only engine branch with this delta stringtable encoding, all the older games unconditionally send the entire table on signon and never again.

@asherkin asherkin merged commit fcafd07 into master Jul 19, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@KyleSanderson

This comment has been minimized.

Copy link
Member

KyleSanderson commented Jul 20, 2019

Can we get this in cstrike?

As far as I know CS:GO is the only engine branch with this delta stringtable encoding, all the older games unconditionally send the entire table on signon and never again.

Which is why it should have been in cstrike ;-).

@Headline Headline deleted the csgo-stringtable branch Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.