}\r
}\r
\r
+ // TODO: New method.\r
+ void AsyncCallbackFailed(Exception exception, NetworkGame networkGame)\r
+ {\r
+ currentState = lobbyState.Welcome;\r
+ Console.WriteLine("Exception as thrown during async call: " + exception.Message);\r
+ }\r
+\r
+\r
public long Update(GameTime gameTime, NetworkGame networkGame)\r
{\r
\r
if (currentKeyboardState.IsKeyDown(Keys.Y) && previousKeyboardState.IsKeyUp(Keys.Y))\r
{\r
currentState = lobbyState.JoiningGame;\r
+ networkGame.ErrorDelegate = AsyncCallbackFailed;\r
networkGame.CreateSession(JoinedSession);\r
} \r
break;\r
currentState = lobbyState.Welcome;\r
ready = false;\r
}\r
+ networkGame.ErrorDelegate = AsyncCallbackFailed;\r
networkGame.FindSessions(FoundSessions);\r
currentState = lobbyState.FindingGames;\r
break;\r
}\r
\r
//allows host to start the game when all players are ready, change count below to different number for testing with less then 4 players\r
- if(allReady && players.Count == 1 && localPlayer == players[0])\r
+ if(allReady && players.Count == 2 && localPlayer == players[0])\r
{\r
if (currentKeyboardState.IsKeyDown(Keys.B) && previousKeyboardState.IsKeyUp(Keys.B))\r
{\r