Added a level equality check to client error handling to make it easier to diagnose bugs like #848 in the future.

This commit is contained in:
Joonas Rikkonen
2018-10-18 00:18:57 +03:00
parent 9f7fbb0cbe
commit ef9afedf42
3 changed files with 26 additions and 6 deletions
@@ -128,6 +128,16 @@ namespace Barotrauma
get { return seed; }
}
/// <summary>
/// A random integer assigned at the end of level generation. If these values differ between clients/server,
/// it means the levels aren't identical for some reason and there will most likely be major ID mismatches.
/// </summary>
public int EqualityCheckVal
{
get;
private set;
}
public float Difficulty
{
get;
@@ -538,6 +548,9 @@ namespace Barotrauma
GenerateSeaFloor(mirror);
backgroundSpriteManager.PlaceSprites(this, generationParams.BackgroundSpriteAmount);
EqualityCheckVal = Rand.Int(int.MaxValue, Rand.RandSync.Server);
#if CLIENT
backgroundCreatureManager.SpawnSprites(80);
#endif