Fix !sandbox clean breaking factions when removing founder#147
Merged
Jimmacle merged 9 commits intoTorchAPI:masterfrom Apr 22, 2020
LordTylus:master
Merged
Fix !sandbox clean breaking factions when removing founder#147Jimmacle merged 9 commits intoTorchAPI:masterfrom LordTylus:master
Jimmacle merged 9 commits intoTorchAPI:masterfrom
LordTylus:master
Conversation
…he grid in question
…nd improved it a little to deal with offline players as well.
Main Advantage over faction.KickMember is that KickMember is only used for actually kicking members. If the founder is kicked the next player in line wont be promoted. There are isntances where the identityID of the founder was still in the safe file, but the identity itself was deleted. causing internal NREs on faction.Members.Keys as the founder ID will always be in the members list. But without identity building the DictionaryReader fails internally as it doesnt like NULL
Contributor
Author
|
Also I should have recreated my fork instead of merging upstream master to my fork as the other commits are already merged to Essentials... Welp will know for next time :-) |
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.
I have received instances where my RespawnFix Plugin failed due to an NRE when calling faction.Members.Keys
faction was protected by a NULL check so could not be NULL however. Calling Members creates a new Dictionary Reader which seems to cross reference the Known identities.
In the Dictionary that holds the members there ALWAYS is the ID of the founder added to the ctor. In the world that was provided to me there were factions without founder. And all of these factions caused an NRE when being worked with.
Interestingly the FounderID was still in the safe file but since its Identity was no longer there cross referencing the ID failed.
I verified that when doing !sandbox clean while I was a member of a faction I stayed member even if the founder was deleted. Which effectively broke the Faction.
Replacing faction.KickMember with the VST Call has the following advantages:
Theoretically with that the check for empty factions is no longer necessary however I left that code in as there may still be some old broken worlds out there.