Split TradeRoutePathCache into UI and DLL instances #10250
Merged
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.
Savegame incompatible (!) because I moved
m_aiLongestPotentialTradeRoute
fromCvCity
toCvGameTrade
.Split TradeRoutePathCache into UI and DLL instances to improve MP stability. After all my PRs it still desyncs, but splitting should finally resolve such issues.
Also added some kind of QoL improvement to MP games: when desync happened, desynced player sends a message to the chat. If you do MP stability test, you can do your report immediately after such message appeared, because we already have a desync and we have to investigate it, no sense to play until CTD or something like that. @Cyclopia31
If you play the real MP session, it can be just a signal that something is going wrong now. You may want to re-create session to restore the host's state to get rid of desync consequences, but no guarantees that it would not be triggered again.
m_bIsDesynced
variable resets after each turn and new message will appear with next turn if something is still desynced, so maybe spamming is possible in real MP sessions if you just continue the game after a detected desync. We can discuss, maybe it would be better to send such message just once and don't reset them_bIsDesynced
variable.Looks like so (with fake desync at each turn just for an example):
@axatin @RecursiveVision @ilteroi please, check my CPP because it can be error-prone a little bit 馃寶