forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 84
[ZH] Prevent hang in network lobby with long player names #1119
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
Open
slurmlord
wants to merge
15
commits into
TheSuperHackers:main
Choose a base branch
from
slurmlord:fix-lobby-hang
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+132
−22
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5efb9b8
Add estimates for required name truncation to prevent game info strin…
slurmlord ca773e0
Rename index var to si to avoid colliding with i.
slurmlord b7eafeb
Move name truncation to separate method and make 2 serialization pass…
slurmlord d5a4150
Split Player name list creation and truncation into separate functions.
slurmlord 1ae9876
Add removeLastNChars method to AsciiString.
slurmlord cdbf4b7
Ensure game options are null terminated.
slurmlord aab7f02
Ensure we accept the maximum length game options.
slurmlord f8600c6
Fairer truncation algo, rewarding short names.
slurmlord ca15e22
VC6 compat.
slurmlord 60d1b56
Rename removeLastNChars to truncate.
slurmlord c83bae0
Merge remote-tracking branch 'origin/main' into fix-lobby-hang
slurmlord 87b552e
Improve truncation target length selection and move away from std::pair.
slurmlord fad4c92
Merge remote-tracking branch 'origin/main' into fix-lobby-hang
slurmlord d1ec6c7
Simplify truncation algorithm, ensure unique truncated names.
slurmlord d1b8e9f
Inadvertent whitespace change.
slurmlord File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
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.
So originally it would have returned the long string if it was unable to (theoretically) truncate. What happens if we return an empty string or a string that is longer than the cap?