Open
Conversation
Added check for official DLC maps. Prevents client missing DLC from looking for a usermap_hash in the infoJson when loading a DLC map. TODO: Handle missing map errors gracefully. Added is_dlc_map() to fastfiles header. WIP: logic for map guard. Reworked map checking. Added additional map_exists check... Added map exists checks to connect and set_new_map calls to prevent crashes when non-dlc owner joins or rotates to a dlc map. Should also prevent weird behavior for missing modmaps and joining servers with custom maps the user doesn't own. Added exit vlobby hook to set_new_map after disconenct to ensure client returns to correct state after mid-game disconnect.
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.
Description:
Addresses JSON 302 bug.
Observed behavior:
The client is using a "file exists" check to determine if a map was base game or usermap, assuming all base game and DLC files should always be present. This check resulted in unintended behavior when connecting to a server where-- if the client was missing a map-- the client would expect the usermap_hash when parsing the jsonInfo object from the server's CURL string. This missing json object key would result in a hanging connection state which required a full client restart. Users would simply received a JSON 302 error and have to restart the client if this happened.
Typically affected users were those who did not own the MWR DLC.
Expected behavior:
Joining a server which is hosting a map you do not own should result in a client error notification explaining they don't have the map, and then the client should return to the main MP lobby or the main menu screen.
Changes:
map_exists()function which returns the map type for a file as an enum or the enum valueMISSINGif the file doesn't actually exist in the filesystem.is_dlc_map()check which parses map strings for the 4 dlc map base namesset_new_map()andconnect_to_server_tcp()functions which handle disconnecting and notifying the player of missing files instead of crashing the game or putting the client in a bugged state.TODO:
In the future I would like to further improve the map file checks to include a LUT of all base game filenames so we can separate the exists() and is_stock_map() functions properly. The client should NOT be using exists to determine the difference between stock maps and usermaps.