Fixed mid-round joining clients automatically getting kicked out because they're missing old events

Now they're kicked out if they're not in sync within 10 seconds of joining, TODO: calculate a reasonable timeout based on the amount of events and/or give the client more time if they keep receiving events
This commit is contained in:
Regalis
2017-03-09 21:40:58 +02:00
parent c956e7aa7f
commit 6a31d56175
3 changed files with 22 additions and 11 deletions
+8 -5
View File
@@ -627,13 +627,16 @@ namespace Barotrauma.Networking
if (gameStarted)
{
if (!c.inGame && c.NeedsMidRoundSync)
if (!c.inGame)
{
//client joined mid-round and has just started up the game
//check which unique messages they've missed
entityEventManager.InitClientMidRoundSync(c);
if (c.NeedsMidRoundSync)
{
//client joined mid-round and has just started up the game
//check which unique messages they've missed
entityEventManager.InitClientMidRoundSync(c);
}
c.inGame = true;
}
c.inGame = true;
}
ClientNetObject objHeader;