}\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