You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Goal: Currently the RCON overrides any layer found by the log parser. RCON fails to find the correct layer more often and provides not up to update information on the current layer. These changes prioritize Layer updating in order of accuracy and adds using the layer information from the the A2S query (which gives layer id as opposed to RCON which gives layer name).
Idea: Basic idea of the logic is that if the current layer in this.currentLayer gives the same information that is given from the squad server (for either A2S or RCON) then it should not update the current layer to whatever it would possibly find (either no layer or an incorrect layer).
Special Considerations: This code also takes into account a race condition with the log parser in which if we start the RCON/A2S query then compare to the current layer data, it's possible that the log parser changed the current layer data after the squad server gave the information to the query but before that query returned in squadjs. Does this by pulling the current layer data before initiating the query.
Simpler logic could not be used (eg if (this.currentLayer == null) update layer) in the rare case that we lose the log parser (eg the log parser is on ftp or similar).
Testing: Currently not tested and needs sanity checking (I use different logic for my squadJS at the moment, will be copying this in and testing shortly).
Recommended here is RCON first as it is more reliable and will have to be the focus for changes to Squad that are planned down the road. I'd rather keep it RCON first if that is the current method.
Current method is if either the NEW_GAME or updateLayerInformation events run they unconditionally set this.currentLayer to whatever they think the layer is or isn't, it just so happens that the RCON based updateLayerInformation gets called periodically and thus destroys any information that the log parser may have found, even when the RCON doesn't find the layer it overwrites it with null. The log parser has a higher chance of finding the correct layer because it uses the layer id rather than the layer name.
With this as well, the current information is essentially double checked by RCON and if found incorrect then RCON will update it if it finds 'better' information.
A2S works the same way and is given equal priority with regards to RCON however has a higher chance of finding a correct layer due to reporting layer id rather than layer name (it also required minimal changes).
It's more along the lines of if one of the queries finds bad information then it shouldn't overwrite what's already there.
Testing: Currently not tested and needs sanity checking (I use different logic for my squadJS at the moment, will be copying this in and testing shortly).
This will need public testing before I can push anything through.
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
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.
Goal: Currently the RCON overrides any layer found by the log parser. RCON fails to find the correct layer more often and provides not up to update information on the current layer. These changes prioritize Layer updating in order of accuracy and adds using the layer information from the the A2S query (which gives layer id as opposed to RCON which gives layer name).
Idea: Basic idea of the logic is that if the current layer in
this.currentLayergives the same information that is given from the squad server (for either A2S or RCON) then it should not update the current layer to whatever it would possibly find (either no layer or an incorrect layer).Special Considerations: This code also takes into account a race condition with the log parser in which if we start the RCON/A2S query then compare to the current layer data, it's possible that the log parser changed the current layer data after the squad server gave the information to the query but before that query returned in squadjs. Does this by pulling the current layer data before initiating the query.
Simpler logic could not be used (eg
if (this.currentLayer == null) update layer) in the rare case that we lose the log parser (eg the log parser is on ftp or similar).Testing: Currently not tested and needs sanity checking (I use different logic for my squadJS at the moment, will be copying this in and testing shortly).