currentState = lobbyState.FindGame;\r
else if (availableSessions != null && availableSessions.Count > 0)\r
{\r
- if (currentKeyboardState.IsKeyDown(Keys.D1) && previousKeyboardState.IsKeyUp(Keys.D1))\r
+ if (currentKeyboardState.IsKeyDown(Keys.D1) && previousKeyboardState.IsKeyUp(Keys.D1) && availableSessions.Count > 0)\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
+ else if (currentKeyboardState.IsKeyDown(Keys.D2) && previousKeyboardState.IsKeyUp(Keys.D2) && availableSessions.Count > 1)\r
{\r
- networkGame.JoinSession(availableSessions[0], JoinedSession);\r
- currentState = lobbyState.JoiningGame;\r
-\r
- availableSessions.Dispose();\r
- availableSessions = null;\r
+ networkGame.JoinSession(availableSessions[1], JoinedSession);\r
+ }\r
+ else if (currentKeyboardState.IsKeyDown(Keys.D3) && previousKeyboardState.IsKeyUp(Keys.D3) && availableSessions.Count > 2)\r
+ {\r
+ networkGame.JoinSession(availableSessions[2], JoinedSession);\r
}\r
+ else if (currentKeyboardState.IsKeyDown(Keys.D4) && previousKeyboardState.IsKeyUp(Keys.D4) && availableSessions.Count > 3)\r
+ {\r
+ networkGame.JoinSession(availableSessions[3], JoinedSession);\r
+ }\r
+\r
+ currentState = lobbyState.JoiningGame;\r
+\r
+ availableSessions.Dispose();\r
+ availableSessions = null;\r
}\r
\r
break;\r