ntaklive / BackupMod

A 7 days to die modlet which makes it possible to automatically backup and restore your game saves
11 stars 3 forks source link

"Collection was modified; enumeration operation may not execute" InvalidOperationException during auto-backup #8

Open IanKemp opened 2 years ago

IanKemp commented 2 years ago

Version: Alpha 20.5 (b2) with Undead Legacy 2.5.82; BackupMod 2.1.3

Wasn't doing anything special, just tooling around a random world.

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.Dictionary`2+KeyCollection+Enumeration[TKey,TValue].MoveNext()
at EntityBuffs.Write(System.IO.BinaryWriter, bool)
at PlayerDataFile.FromPlayer(EntityPlayer)
at BackupMod.Services.WorldSaveAlgorithm.SavePrimaryPlayerData()

Unfortunately I cannot provide the complete stack trace as (AFAIK) 7DtD does not provide a mechanism to dump the console contents to a file; the above is manually typed out by myself, I think that is the most pertinent info.

jonathan-robertson commented 2 years ago

Console logs are stored in a file somewhere under AppData, I believe it's %APPDATA%\7DaysToDie\logs on windows, but it may depend on how you installed the game files.

ntaklive commented 2 years ago

That's enough. It looks like the game cannot save some player data (I use the original saving algorithm from the game code, just without exiting to main menu). I've never encountered something like this, but I'll try to fix that in a few days, when I have time.