Fixed clients not being notified when a campaign is exited and a new one started, causing them to think they still have up-to-date save files for the new campaign and get kicked out due to desync as soon as a round starts. (See #315)

This commit is contained in:
Joonas Rikkonen
2018-03-06 14:18:37 +02:00
parent 8e8b8464af
commit 08ade1dc6f
3 changed files with 28 additions and 4 deletions
@@ -605,7 +605,19 @@ namespace Barotrauma.Networking
c.LastRecvCampaignSave = inc.ReadUInt16();
if (c.LastRecvCampaignSave > 0)
{
byte campaignID = inc.ReadByte();
c.LastRecvCampaignUpdate = inc.ReadUInt16();
if (GameMain.GameSession?.GameMode is MultiplayerCampaign)
{
//the client has a campaign save for another campaign
//(the server started a new campaign and the client isn't aware of it yet?)
if (((MultiplayerCampaign)GameMain.GameSession.GameMode).CampaignID != campaignID)
{
c.LastRecvCampaignSave = 0;
c.LastRecvCampaignUpdate = 0;
}
}
}
break;
case ClientNetObject.CHAT_MESSAGE: