From d45ab3d89a5dada4c241d8d9eee8182ca2a07b04 Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Tue, 25 Jan 2005 05:11:18 +0000 Subject: [PATCH] Change: Different code for starting song in sync. It seems to work better, but it's still in progess. --- stepmania/src/ScreenGameplay.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 9792b7ce1a..4d317f043f 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1135,10 +1135,6 @@ float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusi p.StopMode = RageSoundParams::M_CONTINUE; p.m_StartSecond = fStartSecond; - //Secondary (Precice) start request - //used for syncing up songs. - NSMAN->StartRequest(1); - m_pSoundMusic->Play( &p ); /* Make sure GAMESTATE->m_fMusicSeconds is set up. */ @@ -1252,6 +1248,30 @@ void ScreenGameplay::Update( float fDeltaTime ) { StartPlayingSong( 0, 0 ); // *kick* (no transitions) } + else if ( NSMAN->useSMserver ) + { + //If we're using networking, we must not have any + //delay. If we do this can cause inconsistancy + //on different computers and differet themes + + StartPlayingSong( 0, 0 ); + m_pSoundMusic->Stop(); + + NSMAN->StartRequest(1); + + RageSoundParams p; + p.AccurateSync = true; + p.SetPlaybackRate( 1.0 ); //Force 1.0 playback speed + p.StopMode = RageSoundParams::M_CONTINUE; + p.m_StartSecond = 0.0; + m_pSoundMusic->Play( &p ); + + UpdateSongPosition(0); + + //We need to artifically trigger the sm_playeready so we can end game + //We want to post so this happens only after we're done what we're doing. + SCREENMAN->PostMessageToTopScreen( SM_PlayReady, 0.0 ); + } else { float fMinTimeToMusic = m_In.GetLengthSeconds(); // start of m_Ready