From: brady Date: Mon, 29 Mar 2010 06:13:16 +0000 (+0000) Subject: testing, reset moved into a new gameStarted event X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=ab22d765e9c289860859fe8645e9f9901012ebed;p=chaz%2Fcarfire testing, reset moved into a new gameStarted event git-svn-id: https://bd85.net/svn/cs3505_group@33 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- diff --git a/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs b/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs index 2386ef6..55ab93d 100644 --- a/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs +++ b/Project06/CS 3505 Project 06/CS 3505 Project 06/NetworkGame.cs @@ -104,10 +104,17 @@ namespace CS_3505_Project_06 mNetworkSession = NetworkSession.EndCreate(result); mNetworkSession.AllowHostMigration = true; mNetworkSession.AllowJoinInProgress = false; - + mNetworkSession.GameStarted += new EventHandler(mNetworkSession_GameStarted); mJoinedSessionDelegate(mNetworkSession, this); } + + //gamestarted event + void mNetworkSession_GameStarted(object sender, GameStartedEventArgs e) + { + Reset(); + } + /// /// Determine whether or not the network game object is associated with any network session. /// @@ -232,10 +239,6 @@ namespace CS_3505_Project_06 if (mNetworkSession.SessionState == NetworkSessionState.Lobby) { mLobby.Update(gameTime, this); - - //if state started as lobby and was changed to playing, call reset. - if (mNetworkSession.SessionState == NetworkSessionState.Playing) - Reset(); } else if (mNetworkSession.SessionState == NetworkSessionState.Playing) {