Online protocol improvements (#1393)
* Chartkey generation * Simfile filehash generation * Read filehash on NSCRSG. Add FLU packets and friendlist vectors. Add getserverversion method. Send chartkey, filehash and rate on start request. * Use filehash to find the selected song if it is not empty. * Friendlist update broadcast. * Send note row size if it's bigger than 1 * Used for chartkey generation * Define the ReportScore function with numNotes when WITHOUT_NETWORKING is defined
This commit is contained in:
@@ -181,14 +181,37 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
vector <Song *> AllSongs = SONGMAN->GetAllSongs();
|
||||
unsigned i;
|
||||
for( i=0; i < AllSongs.size(); i++ )
|
||||
bool found = false;
|
||||
if (NSMAN->GetServerVersion() >= 129)
|
||||
{
|
||||
m_cSong = AllSongs[i];
|
||||
if( ( !m_cSong->GetTranslitArtist().CompareNoCase( NSMAN->m_sArtist ) ) &&
|
||||
( !m_cSong->GetTranslitMainTitle().CompareNoCase( NSMAN->m_sMainTitle ) ) &&
|
||||
( !m_cSong->GetTranslitSubTitle().CompareNoCase( NSMAN->m_sSubTitle ) ) )
|
||||
break;
|
||||
//Dont earch by filehash if none was sent
|
||||
if(!NSMAN->m_sFileHash.empty())
|
||||
for (i = 0; i < AllSongs.size(); i++)
|
||||
{
|
||||
m_cSong = AllSongs[i];
|
||||
if (NSMAN->m_sArtist == m_cSong->GetTranslitArtist() &&
|
||||
NSMAN->m_sMainTitle == m_cSong->GetTranslitMainTitle() &&
|
||||
NSMAN->m_sSubTitle == m_cSong->GetTranslitSubTitle() &&
|
||||
NSMAN->m_sFileHash == m_cSong->GetFileHash())
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//If we couldnt find it using file hash search for it without using it, if using SMSERVER < 129 it will go here
|
||||
if(!found)
|
||||
for (i = 0; i < AllSongs.size(); i++)
|
||||
{
|
||||
m_cSong = AllSongs[i];
|
||||
if (NSMAN->m_sArtist == m_cSong->GetTranslitArtist() &&
|
||||
NSMAN->m_sMainTitle == m_cSong->GetTranslitMainTitle() &&
|
||||
NSMAN->m_sSubTitle == m_cSong->GetTranslitSubTitle())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool haveSong = i != AllSongs.size();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user