Changed around player info stuff so it actually makes sense now.

Also... Made it so it reports who'se playing.
This commit is contained in:
Charles Lohr
2004-08-16 06:55:21 +00:00
parent 40f7dc38f1
commit e431570722
3 changed files with 25 additions and 16 deletions
+19 -16
View File
@@ -12,6 +12,7 @@ bool NetworkSyncManager::Connect(const CString& addy, unsigned short port) { ret
void NetworkSyncManager::ReportTiming(float offset, int PlayerNumber) { }
void NetworkSyncManager::ReportScore(int playerID, int step, int score, int combo) { }
void NetworkSyncManager::ReportSongOver() { }
void NetworkSyncManager::ReportStyle() {}
void NetworkSyncManager::StartRequest(short position) { }
void NetworkSyncManager::DisplayStartupStatus() { }
void NetworkSyncManager::Update( float fDeltaTime ) { }
@@ -28,6 +29,7 @@ bool NetworkSyncManager::ChangedScoreboard() {}
#include "StageStats.h"
#include "Steps.h"
#include "PrefsManager.h"
#include "ProductInfo.h"
NetworkSyncManager::NetworkSyncManager()
{
@@ -92,23 +94,8 @@ void NetworkSyncManager::PostStartUp(CString ServerIP)
Write1(m_packet, 2); //Hello Packet
Write1(m_packet, NETPROTOCOLVERSION);
int ctr = 2 * 16 + 0;
Write1(m_packet, (uint8_t) ctr);
vector<CString> profileNames;
profileNames.push_back("[No Prof]"); //Make a no profile option
PROFILEMAN->GetLocalProfileNames(profileNames);
FOREACH_PlayerNumber(pn)
{
int localID = atoi(PREFSMAN->m_sDefaultLocalProfileID[pn]);
/* If the length of the m_sDefaultLocalProfileID[pn] is greater than 0
there must be a profile there. */
if (PREFSMAN->m_sDefaultLocalProfileID[pn].length() > 0)
WriteNT(m_packet, profileNames[localID+1]);
else
WriteNT(m_packet, profileNames[localID]);
}
WriteNT(m_packet, CString(PRODUCT_NAME_VER));
NetPlayerClient->SendPack((char*)m_packet.Data,m_packet.Position);
@@ -261,6 +248,22 @@ void NetworkSyncManager::ReportSongOver()
return;
}
void NetworkSyncManager::ReportStyle()
{
ClearPacket(m_packet);
Write1(m_packet, 6);
Write1(m_packet, GAMESTATE->GetNumPlayersEnabled());
FOREACH_EnabledPlayer( pn )
{
Write1(m_packet,pn);
WriteNT(m_packet, GAMESTATE->GetPlayerDisplayName(pn));
}
NetPlayerClient->SendPack((char*)&m_packet.Data, m_packet.Position);
return;
}
void NetworkSyncManager::StartRequest(short position)
{
if (!useSMserver)