Error when joining a LAN game that has already started
brine opened this issue · comments
Steps:
- Load up OCTGN (test v324)
- Host a LAN game then start it with 1 player
- Attempt to join the listed game (can be done in the same OCTGN instance or with the second one)
Expected behavior is to join the game as a spectator.
System.InvalidOperationException: All player count is 0
at Octgn.GameEngine.Begin()
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)
This happens on games hosted online as well. Spectator mode basically doesn't work anymore
https://github.com/octgn/OCTGN/blame/master/octgnFX/Octgn.JodsEngine/Play/State/GameEngine.cs#L664
it seems the spectator doesn't see the other players in the game at the time this line executes. Commenting it out fixes the bug. Should this exception be handled further down in the code?
@kellyelton it was added during this commit: 5544e16