Files
itgmania212121/stepmania/src/NetworkSyncManager.h
T

72 lines
1.7 KiB
C++
Raw Normal View History

#ifndef NetworkSyncManager_H
#define NetworkSyncManager_H
/*
-----------------------------------------------------------------------------
Class: NetworkSyncManager (And netholder)
Desc: Uses ezsockets for primitive song syncing and score reporting.
Copyright (c) 2003-2004 by the person(s) listed below. All rights reserved.
Charles Lohr
Joshua Allen
-----------------------------------------------------------------------------
*/
2004-03-30 07:43:12 +00:00
#include "PlayerNumber.h"
2004-03-17 06:05:52 +00:00
class EzSockets;
class NetworkSyncManager
{
public:
2004-03-17 06:05:52 +00:00
NetworkSyncManager(int argc, char **argv);
~NetworkSyncManager();
2004-03-17 13:31:42 +00:00
//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.
2004-03-17 13:31:42 +00:00
bool Connect(const CString& addy, unsigned short port); // Connect to SM Server
int m_playerLife[NUM_PLAYERS]; //Life
2004-03-17 13:31:42 +00:00
private:
int m_playerID; //these are currently unused, but need to stay
int m_step;
int m_score;
int m_combo;
2004-03-31 04:18:44 +00:00
bool FlashXMLStyle; //Append 4 0s at end of packet.
//For FLASH client.
bool useSMserver;
2004-03-17 06:05:52 +00:00
EzSockets *NetPlayerClient;
int m_ServerVersion; //ServerVersion
bool Listen(unsigned short port);
2004-03-17 06:05:52 +00:00
struct netHolder //Data structure used for sending data to server
{
int m_playerID; //PID (also used for Commands)
int m_step; //SID (StepID, 0-6 for Miss to Marv, 7,8 for boo and ok)
int m_score; //Player's Score
int m_combo; //Player's Current Combo
int m_life; //Player's Life
2004-03-17 06:05:52 +00:00
};
2004-03-31 04:18:44 +00:00
struct netHolderFlash
{
char data[73];
};
2004-03-17 06:05:52 +00:00
};
2004-03-17 06:05:52 +00:00
extern NetworkSyncManager *NSMAN;
#endif