X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=Project06%2FCS%203505%20Project%2006%2FCS%203505%20Project%2006%2FLobbyGUI.cs;h=e26d5e56d23b83fe91545bad981420ad0a7e3f80;hb=da08dd5249127eed106e041059d4fd987b17a65c;hp=516a85a1302e44abb64c5212d35d0d4bb692383b;hpb=7050e6960cdccc7560ea5a7efb8b04e02629f28a;p=chaz%2Fcarfire diff --git a/Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs b/Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs index 516a85a..e26d5e5 100644 --- a/Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs +++ b/Project06/CS 3505 Project 06/CS 3505 Project 06/LobbyGUI.cs @@ -171,7 +171,6 @@ namespace CS_3505_Project_06 { currentState = lobbyState.Connected; networkGame.CreateSession(4); - players = networkGame.LocalGamers; } break; @@ -182,7 +181,11 @@ namespace CS_3505_Project_06 ready = false; } availableSessions = networkGame.FindSessions(); - + if (availableSessions != null) + { + networkGame.JoinSession(availableSessions[0]); + currentState = lobbyState.Connected; + } break; case lobbyState.Connected: @@ -198,6 +201,15 @@ namespace CS_3505_Project_06 } if (currentKeyboardState.IsKeyDown(Keys.R) && previousKeyboardState.IsKeyUp(Keys.R)) ready = true; + + if (networkGame.sessionExists()) + { + players = networkGame.LocalGamers; + } + else + currentState = lobbyState.Welcome; + + break; } @@ -253,8 +265,8 @@ namespace CS_3505_Project_06 color = Color.Red; spriteBatch.DrawString(menuFont, availableSessions[sessionIndex].HostGamertag, new Vector2(150, 100 + sessionIndex * menuFont.LineSpacing), color, 0f, zero, .7f, SpriteEffects.None, 0.5f); - spriteBatch.DrawString(menuFont, availableSessions[sessionIndex].CurrentGamerCount + " / " + availableSessions[sessionIndex].OpenPublicGamerSlots, new Vector2(400, 300 + sessionIndex * menuFont.LineSpacing), color, 0f, zero, .7f, SpriteEffects.None, 0.5f); - spriteBatch.DrawString(menuFont, availableSessions[sessionIndex].QualityOfService + "", new Vector2(350, 100 + sessionIndex * menuFont.LineSpacing), color, 0f, zero, .7f, SpriteEffects.None, 0.5f); + spriteBatch.DrawString(menuFont, availableSessions[sessionIndex].CurrentGamerCount + " / " + availableSessions[sessionIndex].OpenPublicGamerSlots + availableSessions[sessionIndex].OpenPrivateGamerSlots, + new Vector2(400, 100 + sessionIndex * menuFont.LineSpacing), color, 0f, zero, .7f, SpriteEffects.None, 0.5f); } } break;