octgn / OCTGN

Online Card and Tabletop Gaming Network

Home Page:http://www.octgn.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when joining a LAN game that has already started

brine opened this issue · comments

commented

Steps:

  1. Load up OCTGN (test v324)
  2. Host a LAN game then start it with 1 player
  3. 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)

commented

This happens on games hosted online as well. Spectator mode basically doesn't work anymore

commented

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