Differentiated between starts. Added course support. Fixed course Crashing bug.
This commit is contained in:
@@ -11,7 +11,7 @@ void NetworkSyncManager::PostStartUp( CString ServerIP ) { }
|
||||
bool NetworkSyncManager::Connect(const CString& addy, unsigned short port) { return false; }
|
||||
void NetworkSyncManager::ReportScore(int playerID, int step, int score, int combo) { }
|
||||
void NetworkSyncManager::ReportSongOver() { }
|
||||
void NetworkSyncManager::StartRequest() { }
|
||||
void NetworkSyncManager::StartRequest(int position) { }
|
||||
void NetworkSyncManager::DisplayStartupStatus() { }
|
||||
void NetworkSyncManager::Update( float fDeltaTime ) { }
|
||||
|
||||
@@ -22,6 +22,7 @@ void NetworkSyncManager::Update( float fDeltaTime ) { }
|
||||
#include "StepMania.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "song.h"
|
||||
#include "Course.h"
|
||||
#include "GameState.h"
|
||||
#include "StageStats.h"
|
||||
#include "Steps.h"
|
||||
@@ -222,7 +223,7 @@ void NetworkSyncManager::ReportSongOver()
|
||||
return;
|
||||
}
|
||||
|
||||
void NetworkSyncManager::StartRequest()
|
||||
void NetworkSyncManager::StartRequest(short position)
|
||||
{
|
||||
if (!useSMserver)
|
||||
return ;
|
||||
@@ -248,10 +249,25 @@ void NetworkSyncManager::StartRequest()
|
||||
ctr = uint8_t(ctr+tSteps->GetMeter());
|
||||
|
||||
Write1(m_packet,ctr);
|
||||
|
||||
//Notify server if this is for sync or not.
|
||||
ctr = position*16;
|
||||
Write1(m_packet,ctr);
|
||||
|
||||
WriteNT(m_packet,GAMESTATE->m_pCurSong->m_sMainTitle);
|
||||
WriteNT(m_packet,GAMESTATE->m_pCurSong->m_sSubTitle);
|
||||
WriteNT(m_packet,GAMESTATE->m_pCurSong->m_sArtist);
|
||||
if (GAMESTATE->m_pCurSong !=NULL) {
|
||||
WriteNT(m_packet,GAMESTATE->m_pCurSong->m_sMainTitle);
|
||||
WriteNT(m_packet,GAMESTATE->m_pCurSong->m_sSubTitle);
|
||||
WriteNT(m_packet,GAMESTATE->m_pCurSong->m_sArtist);
|
||||
} else {
|
||||
WriteNT(m_packet,"");
|
||||
WriteNT(m_packet,"");
|
||||
WriteNT(m_packet,"");
|
||||
}
|
||||
|
||||
if (GAMESTATE->m_pCurCourse != NULL)
|
||||
WriteNT(m_packet,GAMESTATE->m_pCurCourse->GetFullDisplayTitle());
|
||||
else
|
||||
WriteNT(m_packet,CString(""));
|
||||
|
||||
NetPlayerClient->SendPack((char*)&m_packet.Data, m_packet.Position);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
//If "useSMserver" then send score to server
|
||||
void ReportScore(int playerID, int step, int score, int combo);
|
||||
void ReportSongOver(); //Report to server that song is over
|
||||
void StartRequest(); //Request a start. Block until granted.
|
||||
void StartRequest(short position); //Request a start. Block until granted.
|
||||
bool Connect(const CString& addy, unsigned short port); // Connect to SM Server
|
||||
|
||||
void PostStartUp(CString ServerIP);
|
||||
|
||||
@@ -382,7 +382,7 @@ void ScreenGameplay::Init()
|
||||
// if you wait too long at the second checkpoint, you will
|
||||
// appear dead when you begin your game.
|
||||
//
|
||||
NSMAN->StartRequest();
|
||||
NSMAN->StartRequest(0);
|
||||
|
||||
|
||||
|
||||
@@ -1059,7 +1059,7 @@ float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusi
|
||||
|
||||
//Secondary (Precice) start request
|
||||
//used for syncing up songs.
|
||||
NSMAN->StartRequest();
|
||||
NSMAN->StartRequest(1);
|
||||
|
||||
m_soundMusic.Play( &p );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user