mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 20:08:56 +02:00
remove quickExit option from AS, fix cleanup in DS
This commit is contained in:
parent
8f4e641ade
commit
e99b126134
4 changed files with 13 additions and 16 deletions
|
@ -804,11 +804,6 @@ AnimationServer::AnimationServer(int &argc, char **argv) :
|
||||||
printf("PROCESSING_FPS=%d\n",PROCESSING_FPS);
|
printf("PROCESSING_FPS=%d\n",PROCESSING_FPS);
|
||||||
printf("PROCESSING_INTERVAL_USECS=%d\n",PROCESSING_INTERVAL_USECS);
|
printf("PROCESSING_INTERVAL_USECS=%d\n",PROCESSING_INTERVAL_USECS);
|
||||||
|
|
||||||
if (cmdOptionExists(argc, (const char**) argv, "--quickExit")) {
|
|
||||||
qDebug() << "quick exit asked for\n";
|
|
||||||
quit();
|
|
||||||
}
|
|
||||||
|
|
||||||
nodeList->linkedDataCreateCallback = NULL; // do we need a callback?
|
nodeList->linkedDataCreateCallback = NULL; // do we need a callback?
|
||||||
|
|
||||||
// Create our JurisdictionListener so we'll know where to send edit packets
|
// Create our JurisdictionListener so we'll know where to send edit packets
|
||||||
|
@ -869,8 +864,7 @@ void AnimationServer::readPendingDatagrams() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationServer::exit(int returnCode) {
|
AnimationServer::~AnimationServer() {
|
||||||
qDebug() << "AS exit called!\n";
|
|
||||||
pthread_join(animateVoxelThread, NULL);
|
pthread_join(animateVoxelThread, NULL);
|
||||||
|
|
||||||
if (::jurisdictionListener) {
|
if (::jurisdictionListener) {
|
||||||
|
|
|
@ -15,7 +15,7 @@ class AnimationServer : public QCoreApplication {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AnimationServer(int &argc, char **argv);
|
AnimationServer(int &argc, char **argv);
|
||||||
void exit(int retCode = 0);
|
~AnimationServer();
|
||||||
private slots:
|
private slots:
|
||||||
void readPendingDatagrams();
|
void readPendingDatagrams();
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,6 +22,12 @@
|
||||||
|
|
||||||
const int RESTART_HOLD_TIME_MSECS = 5 * 1000;
|
const int RESTART_HOLD_TIME_MSECS = 5 * 1000;
|
||||||
|
|
||||||
|
void signalhandler(int sig){
|
||||||
|
if (sig == SIGINT) {
|
||||||
|
qApp->quit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DomainServer* DomainServer::domainServerInstance = NULL;
|
DomainServer* DomainServer::domainServerInstance = NULL;
|
||||||
|
|
||||||
DomainServer::DomainServer(int argc, char* argv[]) :
|
DomainServer::DomainServer(int argc, char* argv[]) :
|
||||||
|
@ -35,6 +41,8 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
||||||
{
|
{
|
||||||
DomainServer::setDomainServerInstance(this);
|
DomainServer::setDomainServerInstance(this);
|
||||||
|
|
||||||
|
signal(SIGINT, signalhandler);
|
||||||
|
|
||||||
const char CUSTOM_PORT_OPTION[] = "-p";
|
const char CUSTOM_PORT_OPTION[] = "-p";
|
||||||
const char* customPortString = getCmdOption(argc, (const char**) argv, CUSTOM_PORT_OPTION);
|
const char* customPortString = getCmdOption(argc, (const char**) argv, CUSTOM_PORT_OPTION);
|
||||||
unsigned short domainServerPort = customPortString ? atoi(customPortString) : DEFAULT_DOMAIN_SERVER_PORT;
|
unsigned short domainServerPort = customPortString ? atoi(customPortString) : DEFAULT_DOMAIN_SERVER_PORT;
|
||||||
|
@ -88,10 +96,8 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
||||||
|
|
||||||
// fire a single shot timer to add static assignments back into the queue after a restart
|
// fire a single shot timer to add static assignments back into the queue after a restart
|
||||||
QTimer::singleShot(RESTART_HOLD_TIME_MSECS, this, SLOT(addStaticAssignmentsBackToQueueAfterRestart()));
|
QTimer::singleShot(RESTART_HOLD_TIME_MSECS, this, SLOT(addStaticAssignmentsBackToQueueAfterRestart()));
|
||||||
}
|
|
||||||
|
connect(this, SIGNAL(aboutToQuit()), SLOT(cleanup()));
|
||||||
void DomainServer::exit(int retCode) {
|
|
||||||
cleanup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainServer::readAvailableDatagrams() {
|
void DomainServer::readAvailableDatagrams() {
|
||||||
|
@ -774,8 +780,6 @@ void DomainServer::addStaticAssignmentsBackToQueueAfterRestart() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainServer::cleanup() {
|
void DomainServer::cleanup() {
|
||||||
qDebug() << "cleanup called!\n";
|
|
||||||
|
|
||||||
_staticAssignmentFile.unmap(_staticAssignmentFileData);
|
_staticAssignmentFile.unmap(_staticAssignmentFileData);
|
||||||
_staticAssignmentFile.close();
|
_staticAssignmentFile.close();
|
||||||
}
|
}
|
|
@ -50,8 +50,6 @@ private:
|
||||||
const QUuid& checkInUUI);
|
const QUuid& checkInUUI);
|
||||||
void addReleasedAssignmentBackToQueue(Assignment* releasedAssignment);
|
void addReleasedAssignmentBackToQueue(Assignment* releasedAssignment);
|
||||||
|
|
||||||
void cleanup();
|
|
||||||
|
|
||||||
unsigned char* addNodeToBroadcastPacket(unsigned char* currentPosition, Node* nodeToAdd);
|
unsigned char* addNodeToBroadcastPacket(unsigned char* currentPosition, Node* nodeToAdd);
|
||||||
|
|
||||||
QMutex _assignmentQueueMutex;
|
QMutex _assignmentQueueMutex;
|
||||||
|
@ -69,6 +67,7 @@ private:
|
||||||
private slots:
|
private slots:
|
||||||
void readAvailableDatagrams();
|
void readAvailableDatagrams();
|
||||||
void addStaticAssignmentsBackToQueueAfterRestart();
|
void addStaticAssignmentsBackToQueueAfterRestart();
|
||||||
|
void cleanup();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__hifi__DomainServer__) */
|
#endif /* defined(__hifi__DomainServer__) */
|
||||||
|
|
Loading…
Reference in a new issue