This commit is contained in:
2025-11-15 13:50:18 +01:00
parent 331258692b
commit 7edc57784c
6 changed files with 470 additions and 1004 deletions
+5 -53
View File
@@ -11,7 +11,6 @@
#include <memory>
#include <vector>
#include <functional>
#include "syslog.hpp"
using namespace std;
@@ -80,11 +79,6 @@ class SClient : ISadClient {
string mServerComputerName{};
int mServerStepTime{-1};
//--- Server Project ---
string mServerProjectID;
string mServerProjectName;
int mServerFramesPerSecond;
public:
/** The ID of the client.<br>Every client instance should set an unique id*/
string getID() { return mID; }
@@ -129,7 +123,7 @@ class SClient : ISadClient {
// Reconnect to the server when connection is lost see eventConnectionStatus and eventServerDetected
bool _doReconnect{}; // true = on eventServerDetected connect to the server identified by mServerID
public:
int sendSPITMessage(Message::OPPart & spitMessageOPPart);
int sendMessage(Message::OPPart & spitMessageOPPart);
//--------------- ServerAutoDetection SAD ---------------
public:
@@ -179,11 +173,7 @@ class SClient : ISadClient {
/** Used internally. When the connection to the SPITServer is lost an eventConnectionStatus will occur*/
void eventWatchdogLost();
//--------------- SPIT Project ---------------
private:
void parseReportProject(Message::ReportProject &message);
void parseCloseProject(Message::CloseProject &message);
public:
/** Returns the SPITServer's project ID - may be the same as the project's name*/
string getServerProjectID();
/** Returns the SPITServer's project name*/
@@ -191,11 +181,6 @@ class SClient : ISadClient {
/** Returns frame rate per second. This is the time resolution in which the server transmits time data. The unit of time data is always frames.*/
int getServerFramesPerSecond();
private:
void parseRequestProjectTransfer(Message::RequestProjectTransfer &message);
void parseStartProjectTransfer(Message::StartProjectTransfer &message);
void parseEndProjectTransfer(Message::EndProjectTransfer &message);
public:
static void sendProject(SClient *p_PtrSClient);
@@ -231,31 +216,16 @@ class SClient : ISadClient {
private:
// receive SPIT-Types
void parseReportType(Message::ReportType &message);
void parseRemoveSPITType(Message::RemoveType &message);
int sendSPITTypeInternal(SType &spitType);
int sendTypeInternal(SType &spitType);
public:
/**
* If a client wants to change a SPITType, he should send it to the server.<br>
* If the SPITTye is a fixed one and not created by the client himself, then an eventSPITType can be sent from the server, which cancels the change.<br>
* @param spitypeID the id of the SPITType to remove.
* @return 0 = is sended, -1 = is not sended
*/
bool changeSPITType(SType *spitType);
/**
* If a client wants to remove a SPITType, he should send it to the server.<br>
* If the SPITTye is a fixed one and not created by the client himself, then an eventSPITType can be sent from the server, which cancels the deletion.<br>
* @param spitypeID the id of the SPITType to remove.
* @return 0 = is sended, -1 = is not sended
*/
int removeSPITType(string spitypeID);
bool changeType(SType *spitType) { return mProcessor.changeType(spitType); }
int removeType(string spitypeID) { return mProcessor.removeType(spitypeID); }
public:
//--------------- SPIT Objects ---------------
private:
void parseReportSPITObject(Message::ReportObject &message);
void parseRemoveSPITObject(Message::RemoveObject &message);
int sendSPITObjectInternal(SObject *ptrObject);
int sendObjectInternal(SObject *sObject);
public:
/**
@@ -265,21 +235,6 @@ class SClient : ISadClient {
* @return 0 = sended, -1 = not sended
*/
bool changeSPITObject(SObject *spitObject);
/**
* When the client removes a SPITObject (normally the client should not do this), then he should send it to the SPITServer.<br>
* The SPITServer may discard the deletion and an eventSPITObject occurs.<br>
* @param objectID the id of the SPITObject to remove.
* @return 0 = sended, -1 = not sended
*/
int removeSPITObject(string objectID);
public:
//--------------- Play SPIT Objects ---------------
private:
void parsePlaySPITStart(Message::PlayStart &message);
void parsePlaySPITObject(Message::PlayObject &message);
void parsePlaySPITEnd(Message::PlayEnd &message);
void parseReportPlayStatus(Message::ReportPlayStatus &message);
public:
//--------- Remote ----------
@@ -295,9 +250,6 @@ class SClient : ISadClient {
void answerWatchdog() {
sAnswered = true;
}
SpitRepo<SObject> mSpitObjects;
SpitRepo<SObject> mRemoteSpitObjects;
};
}