+ // 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
+ 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