+ // TODO: New method.\r
+ void JoinedSession(NetworkSession session, NetworkGame networkGame)\r
+ {\r
+ if (session != null)\r
+ {\r
+ currentState = lobbyState.Connected;\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("Couldn't create/join the session.");\r
+ }\r
+ }\r
+\r
+ // TODO: New method.\r
+ void FoundSessions(AvailableNetworkSessionCollection sessions, NetworkGame networkGame)\r
+ {\r
+ availableSessions = sessions;\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
+ private void UpdateChat(GameTime gameTime, NetworkGame networkGame)\r
+ {\r
+ List<ChatInfo> chts = networkGame.ReceiveChats();\r
+ for (int x = 0; x < chts.Count(); x++)\r
+ currentChat.Enqueue(chts[x]);\r
+ //if number of chat messages has reached max remove older messages as new ones are added\r
+ if (currentChat.Count() > 8)\r
+ {\r
+ for (int x = 0; x < chts.Count(); x++)\r
+ {\r
+ currentChat.Dequeue();\r
+ }\r
+ }\r
+\r
+ }\r
+\r