Config gets corrupted when generating map with high seed number

Issue #14 resolved
Twan Ariens created an issue

Whenever you create a map with a high seed number, it get converted to an "e" number. I don't really know how to explain it but i will try the best i can.

If you create a new map with the following settings:

Scenario: Asteroids Initial Asteroid Amount: 4 Procedural Density: 1 Procedural Seed: 548968527

After you press the create button it does the following:

Scenario: Asteroids Initial Asteroid Amount: 4 Procedural Density: 1 Procedural Seed: 5.489685E+08

The procedural seed gets transformed to a value that is not compatible in the cfg. This is what it looks like in the cfg:

<ProceduralDensity>1</ProceduralDensity>
<ProceduralSeed>5.489685E+08</ProceduralSeed>

Which causes the following error:

2015-01-19 15:38:14.869 - Thread: 5 -> Log Started
2015-01-19 15:38:14.869 - Thread: 5 -> Timezone (local - UTC): 1h
2015-01-19 15:38:14.870 - Thread: 5 -> App Version: 0.2.4.5
2015-01-19 15:38:14.870 - Thread: 5 -> MyAPIGateway Initialized
2015-01-19 15:42:18.951 - Thread: 11 -> Asynchronous Save Setup Started: 57.0032ms
2015-01-19 15:42:18.986 - Thread: 4 -> Asynchronous Save Completed: 92,0052ms
2015-01-19 15:42:19.451 - Thread: 3 -> Stopping SEServerExtender Service...
2015-01-19 15:42:19.452 - Thread: 3 -> StopServer()
2015-01-19 15:42:19.452 - Thread: 3 -> Exiting
2015-01-19 15:42:20.030 - Thread: 11 -> TargetInvocationException - Server crashed
2015-01-19 15:42:20.031 - Thread: 11 -> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Threading.ThreadInterruptedException: Thread was interrupted from a waiting state.
   at System.Threading.Monitor.ObjWait(Boolean exitContext, Int32 millisecondsTimeout, Object obj)
   at System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at 168638249D29224100DB50BB468E7C07.398AD1E315E6E4D570C424BD0D168FC1.858DA51EB20785A82D9A03614304088A.0187A29A24275EC024A192E7E235CC2E.9C41E76459B99591F991CBA0833BD17E()
   at 168638249D29224100DB50BB468E7C07.6E0E814918D8AD6B2DC9CA5005102256.6FBBC9639DEA0D1FC0B91147CC43777A(9AA159E6C22F64A542015EED199D04B9 148A5BA193EB90E55F5E805EF96CAD48)
   at 168638249D29224100DB50BB468E7C07.398AD1E315E6E4D570C424BD0D168FC1.6FBBC9639DEA0D1FC0B91147CC43777A(9AA159E6C22F64A542015EED199D04B9 148A5BA193EB90E55F5E805EF96CAD48)
   at B337879D0C82A5F9C44D51D954769590.B3531963E948FB4FA1D057C4340C61B4.246E732EE67F7F6F88C4FF63B3901107(Boolean FF8E4184144DE7049FF5EC07D594DAB6, Action 8CF1B812E214DD1C51DD894D4C05D44A)
   at 83BCBFA49B3A2A6EC1BC99583DA2D399.49BCFF86BA276A9C7C0D269C2924DE2D.523C8831DA5DAB3A19F6D33A2C6437B5()
   at 83BCBFA49B3A2A6EC1BC99583DA2D399.49BCFF86BA276A9C7C0D269C2924DE2D.26A7ABEA729FAE1F24679E21470F8E98(String 8BF03A34188889479CB413E58490FC37, String 48C45E39212AAA2B19C972DA9195F48A, Boolean 7AC487C1B445CD9F481CF5FE695A7CEA, Boolean 4292A7A4DACAF323E558B7E11DD3CF00)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at SEModAPIInternal.API.Server.ServerAssemblyWrapper.StartServer(String instanceName, String overridePath, Boolean useConsole)
2015-01-19 15:42:20.031 - Thread: 11 -> System.Threading.ThreadInterruptedException: Thread was interrupted from a waiting state.
   at System.Threading.Monitor.ObjWait(Boolean exitContext, Int32 millisecondsTimeout, Object obj)
   at System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at 168638249D29224100DB50BB468E7C07.398AD1E315E6E4D570C424BD0D168FC1.858DA51EB20785A82D9A03614304088A.0187A29A24275EC024A192E7E235CC2E.9C41E76459B99591F991CBA0833BD17E()
   at 168638249D29224100DB50BB468E7C07.6E0E814918D8AD6B2DC9CA5005102256.6FBBC9639DEA0D1FC0B91147CC43777A(9AA159E6C22F64A542015EED199D04B9 148A5BA193EB90E55F5E805EF96CAD48)
   at 168638249D29224100DB50BB468E7C07.398AD1E315E6E4D570C424BD0D168FC1.6FBBC9639DEA0D1FC0B91147CC43777A(9AA159E6C22F64A542015EED199D04B9 148A5BA193EB90E55F5E805EF96CAD48)
   at B337879D0C82A5F9C44D51D954769590.B3531963E948FB4FA1D057C4340C61B4.246E732EE67F7F6F88C4FF63B3901107(Boolean FF8E4184144DE7049FF5EC07D594DAB6, Action 8CF1B812E214DD1C51DD894D4C05D44A)
   at 83BCBFA49B3A2A6EC1BC99583DA2D399.49BCFF86BA276A9C7C0D269C2924DE2D.523C8831DA5DAB3A19F6D33A2C6437B5()
   at 83BCBFA49B3A2A6EC1BC99583DA2D399.49BCFF86BA276A9C7C0D269C2924DE2D.26A7ABEA729FAE1F24679E21470F8E98(String 8BF03A34188889479CB413E58490FC37, String 48C45E39212AAA2B19C972DA9195F48A, Boolean 7AC487C1B445CD9F481CF5FE695A7CEA, Boolean 4292A7A4DACAF323E558B7E11DD3CF00)
2015-01-19 15:42:20.031 - Thread: 11 ->    at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at SEModAPIInternal.API.Server.ServerAssemblyWrapper.StartServer(String instanceName, String overridePath, Boolean useConsole)
   at SEModAPIExtensions.API.Server.RunServer()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

I can manually edit the cfg file and make it work but the hard part is, whenever you do something that edits the cfg file it gets corrupted again with the faulty Procedural Seed Value.

Comments (1)

  1. Log in to comment