Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Connection Failed when trying to join custom map #12881 #12976
ToDictionary(o => o.Id, o => o) failed due to duplicated Rule Id, e.g. PlayerResourcesInfo rules from Player and World, but it seems options from server.Map.Rules aren't needed here, as they are all added in LoadMapSettings function into defaults so I assume it is better to simply remove it than fix the duplicity again here.
referenced this pull request
Mar 16, 2017
Ok. Here is picture that could help you save some time:
I think it can be removed, but if you prefer, I propose to change Dictionary to List, as it only checks key's (option name) presence not value.
It works with List as it can contain duplicate Id (option name) and the connection doesn fail then for some maps.
The code looks sensible, and the map in question doesn't crash anymore.
However, this does come down to us accepting maps with broken rules, which I'm not sure I'm ok with.
Our stance has always been that it's better to crash than to silently ignore errors.
There is also another issue with map failure only in MP due to this I assume. We can inhance lint checks, but this new client joined info has different logic than core logic.
I agree that this should still be fixed, but mainly because we already handle duplicates in all cases but this.
The crash is caused because the map is incorrectly putting the trait on a different actor, which means that there are legitimately multiple sources of that map setting. An actual override will not trigger that crash.