Common errors

## The client has forcefully closed the game (alt + f4)

```
An error occurred when handling client packet... Full Stack Trace:
System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer.
 ---> System.Net.Sockets.SocketException (104): Connection reset by peer
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.StreamReader.ReadBuffer()
   at System.IO.StreamReader.ReadLine()
   at OpenWorldReduxServer.Network.ListenToClient(ServerClient client)

```

## Client Disconnected from the server - likely internet issues

```
An error occurred when handling client packet... Full Stack Trace:
System.IO.IOException: Unable to read data from the transport connection: Connection timed out.
 ---> System.Net.Sockets.SocketException (110): Connection timed out
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.StreamReader.ReadBuffer()
   at System.IO.StreamReader.ReadLine()
   at OpenWorldReduxServer.Network.ListenToClient(ServerClient client)

```

## Firewall or antivirus blocking the connection

```
An error occurred when handling client packet... Full Stack Trace:
System.IO.IOException: Unable to read data from the transport connection: No route to host.
 ---> System.Net.Sockets.SocketException (113): No route to host
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.StreamReader.ReadBuffer()
   at System.IO.StreamReader.ReadLine()
   at OpenWorldReduxServer.Network.ListenToClient(ServerClient client)

```

## Wealth Warning/ Ban number above maximum number

max wealth number: 1999999999 (1,999,999,999)

```
Unhandled exception. System.OverflowException: Value was either too large or too small for an Int32.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
   at Open_World_Server.ServerUtils.CheckSettingsFile()
   at Open_World_Server.ServerUtils.CheckForFiles()
   at Open_World_Server.MainProgram.Main()

```

## The port you have listed in the server config.json is in use

```
Unhandled exception. System.Net.Sockets.SocketException (10048): Only one usage of each socket address (protocol/network address/port) is normally permitted.
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at System.Net.Sockets.TcpListener.Start(Int32 backlog)
   at System.Net.Sockets.TcpListener.Start()
   at Open_World_Server.Networking.ReadyServer()
   at System.Threading.Thread.StartHelper.Callback(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Thread.StartCallback()

```

## This is a potentially corrupted player data,

Delete all player data

```
Unhandled exception. System.Runtime.Serialization.SerializationException: Attempting to deserialize an empty steam.
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializtionStream)
   at Open_World_Server.SaveSystem.LoadUserData(String username)
   at Open_World_Server.PlayerUtils.CheckSavedPlayers()
   at Open_World_Server.ServerUtils.CheckForFiles()
   at Open_World_Server.MainProgram.Main()

```

## The local ip listed in the Config.json is not correct

Check Creating a server on how to find your local ip

```
Unhandled exception. System.FormatException: An invalid IP address was specified.
 ---> System.Net.Sockets.SocketException (10022): An invalid argument was supplied.
   --- End of inner exception stack trace ---
   at System.Net.IPAddressParser.Parse(ReadOnlySpan`1 ipSpan, Boolean tryParse)
   at System.Net.IPAddress.Parse(String ipString)
   at Open_World_Server.ServerUtils.CheckSettingsFile()
   at Open_World_Server.ServerUtils.CheckForFiles()
   at Open_World_Server.MainProgram.Main()

```

## Mod corrupted/ downloaded incorrectly

Delete and redownload mod listed in the file path

```
Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path **'C:\Users\saffue\Desktop\RimWord\Mods\OpenWorld-main\About\About.xml'.**
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.File.InternalReadAllLines(String path, Encoding encoding)
   at System.IO.File.ReadAllLines(String path)
   at Open_World_Server.ServerUtils.CheckMods()
   at Open_World_Server.ServerUtils.CheckForFiles()
   at Open_World_Server.MainProgram.Main()

```

## World generation settings set up incorrectly

Check that your world settings.txt is set up correctly by looking at the default config listed in the "extras" then "default settings files"

```
Error in WorldGenStep: System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.Planet.TileFinder+<>c__DisplayClass1_0.<RandomSettlementTileFor>b__1 (System.Int32 x) [0x0000c] in <81af9f8a18324e17b286924a43555a7c>:0
  at Verse.GenCollection.TryRandomElementByWeight[T] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] weightSelector, T& result) [0x00125] in <81af9f8a18324e17b286924a43555a7c>:0
  at RimWorld.Planet.TileFinder.RandomSettlementTileFor (RimWorld.Faction faction, System.Boolean mustBeAutoChoosable, System.Predicate`1[T] extraValidator) [0x0004b] in <81af9f8a18324e17b286924a43555a7c>:0
  at RimWorld.FactionGenerator.NewGeneratedFaction (RimWorld.FactionGeneratorParms parms) [0x001d1] in <81af9f8a18324e17b286924a43555a7c>:0
  at (wrapper dynamic-method) RimWorld.FactionGenerator.RimWorld.FactionGenerator.GenerateFactionsIntoWorld_Patch1(System.Collections.Generic.Dictionary`2<RimWorld.FactionDef, int>)
  at RimWorld.Planet.WorldGenStep_Factions.GenerateFresh (System.String seed) [0x00005] in <81af9f8a18324e17b286924a43555a7c>:0
  at RimWorld.Planet.WorldGenerator.GenerateWorld (System.Single planetCoverage, System.String seedString, RimWorld.Planet.OverallRainfall overallRainfall, RimWorld.Planet.OverallTemperature overallTemperature, RimWorld.Planet.OverallPopulation population, System.Collections.Generic.Dictionary`2[TKey,TValue] factionCounts) [0x000fd] in <81af9f8a18324e17b286924a43555a7c>:0
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

```

## Using an illegal character in the server or username

remove any character that isnt a letter or number, this will sometimes include characters from languages such as Korean, Chinese, Japanese, etc

```
 Exception while saving game: System.IO.DirectoryNotFoundException: Could not find a part of the path "C:\Users\MyName\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Saves\Open World Save - OS:RimWorld - Hille.rws".
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00164] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at Verse.ScribeSaver.InitSaving (System.String filePath, System.String documentElementName) [0x000d6] in <1ea541f48818430abd724fc665f76dc4>:0
  at Verse.SafeSaver.DoSave (System.String fullPath, System.String documentElementName, System.Action saveAction) [0x00058] in <1ea541f48818430abd724fc665f76dc4>:0
  at Verse.SafeSaver.Save (System.String path, System.String documentElementName, System.Action saveAction, System.Boolean leaveOldFile) [0x00186] in <1ea541f48818430abd724fc665f76dc4>:0
  at (wrapper dynamic-method) Verse.GameDataSaveLoader.Verse.GameDataSaveLoader.SaveGame_Patch1(string)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

```