Nihlus / Crystite

Custom headless server for the VR sandbox Resonite
GNU Affero General Public License v3.0
27 stars 4 forks source link

ForcedPort doesnt work with idleRestartInterval or forcedRestartInterval #1

Closed Synkstar closed 1 year ago

Synkstar commented 1 year ago
1:58:29 INF] World [LBF] Hangout has been idle for 300 seconds, restarting
[11:58:29 INF] SessionID set to S-U-1Nd55iGqZ3Q:lbfhangout. LastModifyingUser:
[11:58:29 ERR] [B]Bind exception: System.Net.Sockets.SocketException (98): Address already in use
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at LiteNetLib.NetManager.BindSocket(Socket socket, IPEndPoint ep), errorCode: AddressAlreadyInUse
   at System.Environment.get_StackTrace()
   at Elements.Core.UniLog.Error(String message, Boolean stackTrace)
   at FrooxEngine.LNL_Logger.WriteNet(NetLogLevel level, String str, Object[] args)
   at LiteNetLib.NetDebug.WriteLogic(NetLogLevel logLevel, String str, Object[] args)
   at LiteNetLib.NetDebug.WriteError(String str)
   at LiteNetLib.NetManager.BindSocket(Socket socket, IPEndPoint ep)
   at LiteNetLib.NetManager.Start(IPAddress addressIPv4, IPAddress addressIPv6, Int32 port, Boolean manualMode)
   at LiteNetLib.NetManager.Start(IPAddress addressIPv4, IPAddress addressIPv6, Int32 port)
   at LiteNetLib.NetManager.Start(Int32 port)
   at FrooxEngine.LNL_Listener..ctor(String appId, UInt16 port, World world)
   at FrooxEngine.LNL_Manager.CreateListener(UInt16 port, World world)
   at FrooxEngine.NetworkManager.RequestAllListeners(UInt16 port, World world)
   at FrooxEngine.Session.StartNew(UInt16 port)
   at FrooxEngine.Session.NewSession(World owner, UInt16 port)
   at FrooxEngine.World.StartSession(WorldManager manager, WorldAction init, UInt16 port, String forceSessionId, DataTreeNode load, Boolean unsafeMode)
   at FrooxEngine.WorldManager.StartSession(WorldAction init, UInt16 port, String forceSessionId, DataTreeDictionary load, Boolean unsafeMode)
   at FrooxEngine.Userspace.StartSession(WorldAction init, UInt16 port, String forceSessionId, DataTreeDictionary load, Boolean focusWhenReady, Boolean unsafeMode)
   at FrooxEngine.Userspace.OpenWorldInternal(WorldStartSettings startInfo)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at FrooxEngine.Userspace.OpenWorldInternal(WorldStartSettings startInfo)
   at FrooxEngine.Userspace.<>c__DisplayClass183_0.<<OpenWorld>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at FrooxEngine.Userspace.<>c__DisplayClass183_0.<OpenWorld>b__0()
   at FrooxEngine.CoroutineManager.StartTask[T](Func`1 task, IUpdatable updatable)
   at FrooxEngine.Worker.StartTask[T](Func`1 task)
   at FrooxEngine.Userspace.OpenWorld(WorldStartSettings startInfo)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at FrooxEngine.Userspace.OpenWorld(WorldStartSettings startInfo)
   at Crystite.Services.WorldService.StartWorldAsync(WorldStartupParameters startupParameters, CancellationToken ct)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Crystite.Services.WorldService.StartWorldAsync(WorldStartupParameters startupParameters, CancellationToken ct)
   at Crystite.Services.WorldService.SessionHandlerAsync(SessionWrapper wrapper, CancellationToken ct)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at FrooxEngine.CoroutineManager.ExecuteWorldQueue(Double deltaTime)
   at FrooxEngine.Engine.UpdateStep()
   at FrooxEngine.Engine.RunUpdateLoop()
   at Crystite.StandaloneFrooxEngineService.EngineLoopAsync(CancellationToken ct)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.PeriodicTimer.State.Signal(Boolean stopping, CancellationToken cancellationToken)
   at System.Threading.PeriodicTimer.<>c.<.ctor>b__2_0(Object s)
   at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
[11:58:29 ERR] Failed to start listener
   at System.Environment.get_StackTrace()
   at Elements.Core.UniLog.Error(String message, Boolean stackTrace)
   at FrooxEngine.LNL_Listener..ctor(String appId, UInt16 port, World world)
   at FrooxEngine.LNL_Manager.CreateListener(UInt16 port, World world)
   at FrooxEngine.NetworkManager.RequestAllListeners(UInt16 port, World world)
   at FrooxEngine.Session.StartNew(UInt16 port)
   at FrooxEngine.Session.NewSession(World owner, UInt16 port)
   at FrooxEngine.World.StartSession(WorldManager manager, WorldAction init, UInt16 port, String forceSessionId, DataTreeNode load, Boolean unsafeMode)
   at FrooxEngine.WorldManager.StartSession(WorldAction init, UInt16 port, String forceSessionId, DataTreeDictionary load, Boolean unsafeMode)
   at FrooxEngine.Userspace.StartSession(WorldAction init, UInt16 port, String forceSessionId, DataTreeDictionary load, Boolean focusWhenReady, Boolean unsafeMode)
   at FrooxEngine.Userspace.OpenWorldInternal(WorldStartSettings startInfo)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at FrooxEngine.Userspace.OpenWorldInternal(WorldStartSettings startInfo)
   at FrooxEngine.Userspace.<>c__DisplayClass183_0.<<OpenWorld>b__0>d.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at FrooxEngine.Userspace.<>c__DisplayClass183_0.<OpenWorld>b__0()
   at FrooxEngine.CoroutineManager.StartTask[T](Func`1 task, IUpdatable updatable)
   at FrooxEngine.Worker.StartTask[T](Func`1 task)
   at FrooxEngine.Userspace.OpenWorld(WorldStartSettings startInfo)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at FrooxEngine.Userspace.OpenWorld(WorldStartSettings startInfo)
   at Crystite.Services.WorldService.StartWorldAsync(WorldStartupParameters startupParameters, CancellationToken ct)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Crystite.Services.WorldService.StartWorldAsync(WorldStartupParameters startupParameters, CancellationToken ct)
   at Crystite.Services.WorldService.SessionHandlerAsync(SessionWrapper wrapper, CancellationToken ct)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at FrooxEngine.CoroutineManager.ExecuteWorldQueue(Double deltaTime)
   at FrooxEngine.Engine.UpdateStep()
   at FrooxEngine.Engine.RunUpdateLoop()
   at Crystite.StandaloneFrooxEngineService.EngineLoopAsync(CancellationToken ct)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.PeriodicTimer.State.Signal(Boolean stopping, CancellationToken cancellationToken)
   at System.Threading.PeriodicTimer.<>c.<.ctor>b__2_0(Object s)
   at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
Nihlus commented 1 year ago

I've changed the way worlds are handled slightly - can you retest with the latest version?

Nihlus commented 1 year ago

Local tests suggest issue has been resolved - reopen it if it crops up again.