These config files often contain many repeated strings which result in different string references in memory. By using a pool, we can detect when the strings are equal and reuse an existing reference as strings are immutable.
The FromLines will now use a pool to de-duplicate strings for a single call. By allowing a pool to be provided as a parameter, we can reuse even more strings. The MapCache defines such a pool so that strings are reused across all maps in the cache for even more savings.
If the download failed, the map status would be MapStatus.DownloadError,
which would cause the Install method to return immediately. I've updated
the Install method now to account for MapStatus.DownloadError.
If the mapserver returned an unusable minimap blob, we'd end up dropping
the resulting exceptions on the floor, and committing a completely broken
MapPreview, which would then blow up the tail end of the map change
process, and all future ValidateClient calls after players join (which
itself was handled by kicking the player and logging some noise of dubious
value).
Adjusts exception handling in a number of places to log the exception
rather than dropping it on the floor, and makes the mapserver response
parsing tolerant of bogus minimap blobs -- in this case, we'd rather just
have no minimap.
Candidate for stable, as it fixes a bug present in the current release and
the current playtest series.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
The Download class cancels asynchronously, which means callers must handle cancellation inside the completion event, and not after requesting cancellation.
This was previously trying to use values that had
not yet been initialised, which meant that *all*
maps were treated as unsuitable. This would cause
the mod to always fall back to the first installed
map.