]> Dogcows Code - chaz/carfire/blobdiff - Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs
testing
[chaz/carfire] / Project06 / CS 3505 Project 06 / CS 3505 Project 06 / LobbyGUI.cs
index 516a85a1302e44abb64c5212d35d0d4bb692383b..31ce27bfd6274646daa1a54fa547907b31b34ed5 100644 (file)
@@ -171,7 +171,6 @@ namespace CS_3505_Project_06
                     {\r
                         currentState = lobbyState.Connected;\r
                         networkGame.CreateSession(4);\r
-                        players = networkGame.LocalGamers;\r
                     }   \r
                     break;\r
 \r
@@ -182,7 +181,14 @@ namespace CS_3505_Project_06
                         ready = false;\r
                     }\r
                     availableSessions = networkGame.FindSessions();\r
+                    if (availableSessions != null)\r
+                    {\r
+                        networkGame.JoinSession(availableSessions[0]);\r
+                        currentState = lobbyState.Connected;\r
 \r
+                        availableSessions.Dispose();\r
+                        availableSessions = null;\r
+                    }\r
                     break;\r
 \r
                 case lobbyState.Connected:\r
@@ -198,6 +204,15 @@ namespace CS_3505_Project_06
                     }\r
                     if (currentKeyboardState.IsKeyDown(Keys.R) && previousKeyboardState.IsKeyUp(Keys.R))\r
                         ready = true;\r
+\r
+                    if (networkGame.sessionExists())\r
+                    {\r
+                        players = networkGame.LocalGamers;\r
+                    }\r
+                    else\r
+                        currentState = lobbyState.Welcome;\r
+\r
+\r
                     break;\r
 \r
             }\r
@@ -253,8 +268,8 @@ namespace CS_3505_Project_06
                                 color = Color.Red;\r
 \r
                             spriteBatch.DrawString(menuFont, availableSessions[sessionIndex].HostGamertag, new Vector2(150, 100 + sessionIndex * menuFont.LineSpacing), color, 0f, zero, .7f, SpriteEffects.None, 0.5f);\r
-                            spriteBatch.DrawString(menuFont, availableSessions[sessionIndex].CurrentGamerCount + " / " + availableSessions[sessionIndex].OpenPublicGamerSlots, new Vector2(400, 300 + sessionIndex * menuFont.LineSpacing), color, 0f, zero, .7f, SpriteEffects.None, 0.5f);\r
-                            spriteBatch.DrawString(menuFont, availableSessions[sessionIndex].QualityOfService + "", new Vector2(350, 100 + sessionIndex * menuFont.LineSpacing), color, 0f, zero, .7f, SpriteEffects.None, 0.5f);\r
+                            spriteBatch.DrawString(menuFont, availableSessions[sessionIndex].CurrentGamerCount + " / " + availableSessions[sessionIndex].OpenPublicGamerSlots + availableSessions[sessionIndex].OpenPrivateGamerSlots,\r
+                                                   new Vector2(400, 100 + sessionIndex * menuFont.LineSpacing), color, 0f, zero, .7f, SpriteEffects.None, 0.5f);\r
                         }\r
                     }\r
                     break;\r
This page took 0.02004 seconds and 4 git commands to generate.