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::ReportTiming(float offset, int PlayerNumber) { }
void NetworkSyncManager::ReportScore(int playerID, int step, int score, int combo) { } void NetworkSyncManager::ReportScore(int playerID, int step, int score, int combo) { }
void NetworkSyncManager::ReportSongOver() { } void NetworkSyncManager::ReportSongOver() { }
void NetworkSyncManager::ReportStyle() {}
void NetworkSyncManager::StartRequest(short position) { } void NetworkSyncManager::StartRequest(short position) { }
void NetworkSyncManager::DisplayStartupStatus() { } void NetworkSyncManager::DisplayStartupStatus() { }
void NetworkSyncManager::Update( float fDeltaTime ) { } void NetworkSyncManager::Update( float fDeltaTime ) { }
@@ -28,6 +29,7 @@ bool NetworkSyncManager::ChangedScoreboard() {}
#include "StageStats.h" #include "StageStats.h"
#include "Steps.h" #include "Steps.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "ProductInfo.h"
NetworkSyncManager::NetworkSyncManager() NetworkSyncManager::NetworkSyncManager()
{ {
@@ -92,23 +94,8 @@ void NetworkSyncManager::PostStartUp(CString ServerIP)
Write1(m_packet, 2); //Hello Packet Write1(m_packet, 2); //Hello Packet
Write1(m_packet, NETPROTOCOLVERSION); Write1(m_packet, NETPROTOCOLVERSION);
int ctr = 2 * 16 + 0;
Write1(m_packet, (uint8_t) ctr);
vector<CString> profileNames; WriteNT(m_packet, CString(PRODUCT_NAME_VER));
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]);
}
NetPlayerClient->SendPack((char*)m_packet.Data,m_packet.Position); NetPlayerClient->SendPack((char*)m_packet.Data,m_packet.Position);
@@ -261,6 +248,22 @@ void NetworkSyncManager::ReportSongOver()
return; 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) void NetworkSyncManager::StartRequest(short position)
{ {
if (!useSMserver) if (!useSMserver)
+1
View File
@@ -29,6 +29,7 @@ public:
void ReportTiming(float offset, int PlayerNumber); void ReportTiming(float offset, int PlayerNumber);
void ReportScore(int playerID, int step, int score, int combo); void ReportScore(int playerID, int step, int score, int combo);
void ReportSongOver(); //Report to server that song is over void ReportSongOver(); //Report to server that song is over
void ReportStyle(); //Report to server the style, players, and names
void StartRequest(short position); //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 bool Connect(const CString& addy, unsigned short port); // Connect to SM Server
+5
View File
@@ -2,6 +2,7 @@
#include "ScreenSelectStyle.h" #include "ScreenSelectStyle.h"
#include "GameManager.h" #include "GameManager.h"
#include "GameSoundManager.h" #include "GameSoundManager.h"
#include "NetworkSyncManager.h"
#include "ThemeManager.h" #include "ThemeManager.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "ScreenManager.h" #include "ScreenManager.h"
@@ -182,6 +183,10 @@ void ScreenSelectStyle::MenuStart( PlayerNumber pn )
for( unsigned i=0; i<m_SubActors.size(); i++ ) for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->StopTweening(); m_SubActors[i]->StopTweening();
//Report All Stlye-dependant info
NSMAN->ReportStyle();
SCREENMAN->PlayStartSound(); SCREENMAN->PlayStartSound();
SCREENMAN->SendMessageToTopScreen( SM_AllDoneChoosing ); SCREENMAN->SendMessageToTopScreen( SM_AllDoneChoosing );