{\r
availableSessions = sessions;\r
\r
- if (availableSessions != null && availableSessions.Count > 0)\r
- {\r
- networkGame.JoinSession(availableSessions[0], JoinedSession);\r
- currentState = lobbyState.JoiningGame;\r
-\r
- availableSessions.Dispose();\r
- availableSessions = null;\r
- }\r
- else\r
- {\r
- // TODO: This should do something more than just throw the player back to the welcome screen.\r
- currentState = lobbyState.Welcome;\r
- Console.WriteLine("No sessions to join!");\r
- }\r
+ //if (availableSessions != null && availableSessions.Count > 0)\r
+ //{\r
+ // networkGame.JoinSession(availableSessions[0], JoinedSession);\r
+ // currentState = lobbyState.JoiningGame;\r
+\r
+ // availableSessions.Dispose();\r
+ // availableSessions = null;\r
+ //}\r
+ //else\r
+ //{\r
+ // // TODO: This should do something more than just throw the player back to the welcome screen.\r
+ // currentState = lobbyState.Welcome;\r
+ // Console.WriteLine("No sessions to join!");\r
+ //}\r
}\r
\r
// TODO: New method.\r
currentState = lobbyState.Welcome;\r
ready = false;\r
}\r
+ availableSessions = null;\r
networkGame.ErrorDelegate = AsyncCallbackFailed;\r
networkGame.FindSessions(FoundSessions);\r
currentState = lobbyState.FindingGames;\r
break;\r
\r
+ case lobbyState.FindingGames:\r
+ if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))\r
+ {\r
+ currentState = lobbyState.Welcome;\r
+ ready = false;\r
+ }\r
+ if (availableSessions != null && availableSessions.Count == 0)\r
+ currentState = lobbyState.FindGame;\r
+ else if (availableSessions != null && availableSessions.Count > 0)\r
+ {\r
+ if (currentKeyboardState.IsKeyDown(Keys.D1) && previousKeyboardState.IsKeyUp(Keys.D1))\r
+ {\r
+ networkGame.JoinSession(availableSessions[0], JoinedSession);\r
+ currentState = lobbyState.JoiningGame;\r
+\r
+ availableSessions.Dispose();\r
+ availableSessions = null;\r
+ }\r
+ if (currentKeyboardState.IsKeyDown(Keys.D2) && previousKeyboardState.IsKeyUp(Keys.D2))\r
+ {\r
+ networkGame.JoinSession(availableSessions[0], JoinedSession);\r
+ currentState = lobbyState.JoiningGame;\r
+\r
+ availableSessions.Dispose();\r
+ availableSessions = null;\r
+ }\r
+ }\r
+\r
+\r
+ Console.WriteLine("Finding");\r
+ break;\r
case lobbyState.Connected:\r
if (currentKeyboardState.IsKeyDown(Keys.X) && previousKeyboardState.IsKeyUp(Keys.X))\r
{\r
networkGame.LeaveSession();\r
}\r
currentState = lobbyState.Welcome;\r
+ \r
}\r
if (currentKeyboardState.IsKeyDown(Keys.R) && previousKeyboardState.IsKeyUp(Keys.R))\r
networkGame.LocalGamer.IsReady = true;\r