TerraMap / windows

TerraMap Windows is an interactive Terraria v1.4 world map viewer that loads quickly and lets you pan, zoom, find blocks, ores, items in chests, dungeons, NPCs, etc.
https://terramap.github.io/windows.html
GNU General Public License v3.0
83 stars 13 forks source link

EndOfStreamException in some 1.4 worlds #6

Closed nywek closed 4 years ago

nywek commented 4 years ago

Occasionlly some newly created 1.4 worlds cannot be opened. I tested this by generating a lot of 1.4 worlds with the following settings:

For example, trying to open the world with the seed 1574392356 causes the exception:

Stacktrace:

System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
   at System.IO.__Error.EndOfFile()
   at System.IO.BinaryReader.ReadString()
   at TerraMap.Data.World.ReadNPCsVersion2(BinaryReader reader) in C:\Users\Jason\source\terramap\windows\Data\World.cs:Line 1384.
   at TerraMap.Data.World.ReadWorldVersion2(BinaryReader reader) in C:\Users\Jason\source\terramap\windows\Data\World.cs:Line 473.
   at TerraMap.Data.World.Read(String filename) in C:\Users\Jason\source\terramap\windows\Data\World.cs:Line 431.
   at TerraMap.Data.World.<>c__DisplayClass374_0.<ReadAsync>b__0() in C:\Users\Jason\source\terramap\windows\Data\World.cs:Line 393.
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at TerraMap.MainWindow.<Open>d__24.MoveNext() in C:\Users\Jason\source\terramap\windows\TerraMap\MainWindow.xaml.cs:Line 287.
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at TerraMap.MainWindow.<Open>d__23.MoveNext() in C:\Users\Jason\source\terramap\windows\TerraMap\MainWindow.xaml.cs:Line 254.
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at TerraMap.MainWindow.<OnSelectedWorldFileChanged>d__58.MoveNext() in C:\Users\Jason\source\terramap\windows\TerraMap\MainWindow.xaml.cs:Line 1213.
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

From reading the stacktrace, it seems like this line is the cause for some reason.

Version: 1.4.0.26884 Terraria Version: 1.4.0.2

Edit: As an example for a world that actually can be opened, a world generated with the seed 826182833 can be opened properly.

KillerJWB86 commented 4 years ago

I have a issue just like yours, Large world, Master Difficulty, and someone did join the world with a pre 1.4 char. https://pastebin.com/4zdvEAfK https://pastebin.com/TejS8gXA https://pastebin.com/tuuMWugy I get different errors every time I load the world. Version: 1.4.0.26884 World was generated with terraria 1.4.0.1

jasoncoon commented 4 years ago

Should be fixed in the latest version, just released this morning, thanks! https://terramap.github.io/windows.html

KillerJWB86 commented 4 years ago

Getting a new error now, Could not find a part of the path 'C:\Users\Server\Documents\My Games\Terraria\Players' https://pastebin.com/LtN6U0wX Version: 1.4.1.15021

NVM,i just made a players folder and it works now.