-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add in Argument Parsing with options seed #37
Merged
Merged
Conversation
This file contains 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
…epresented as base64 strings. Included encoding and decoding of string. Added additional argument parsing to enable debugging without needing to encode strings. Also added in more randomness to the number of mexes and hydros generated based on number of spawns.
…e you want 0.1.6 made seed argument optional.
This also deals with FAForever/downlords-faf-client#1781 |
This was
linked to
issues
Jun 20, 2020
As we discussed this should also move the version up to 1.0.0 |
1-alex98
approved these changes
Jun 23, 2020
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.
This looks to attempt to solve #35 with including a random seed and an options seed in the map name. Both seeds are encoded as base64 strings to try to keep the length of the map names reasonable.
Currently each argument is a single byte which is then translated into an appropriate value in the parse options method. The original command line argument parser is adapted and left intact to minimize the changes necessary to the client to send over arguments as well as to try and increase compatibility between map generator versions. Default values are defined in case the options string is not passed and an encoding function for the map name is included for generation of the map name solely inside of the map generator if needed.
Additionally other argument parsing methods have been added so that developers do not have to have an encoded string for testing however a valid map name is generated and used to save the map with all argument parsing options. For all argument parsing the map name will override any other options that are set.
The base64 encoding is changed slightly when saving the map by replacing the '' character with a '-' character. When parsing the map the '-' character is replaced with a '' character to ensure a base64 compliant string in the case that the slightly modified version is given to the generator.