mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:24:36 +02:00
removed persit file load time to help windows build
This commit is contained in:
parent
dec16c8f0b
commit
ef60aec81e
4 changed files with 11 additions and 27 deletions
|
@ -202,26 +202,13 @@ int OctreeServer::civetwebRequestHandler(struct mg_connection* connection) {
|
||||||
|
|
||||||
// display voxel file load time
|
// display voxel file load time
|
||||||
if (theServer->isInitialLoadComplete()) {
|
if (theServer->isInitialLoadComplete()) {
|
||||||
time_t* loadCompleted = theServer->getLoadCompleted();
|
if (theServer->isPersistEnabled()) {
|
||||||
if (loadCompleted) {
|
mg_printf(connection, "%s File Persist Enabled...\r\n", theServer->getMyServerName());
|
||||||
tm* voxelsLoadedAtLocal = localtime(loadCompleted);
|
|
||||||
const int MAX_TIME_LENGTH = 128;
|
|
||||||
char buffer[MAX_TIME_LENGTH];
|
|
||||||
strftime(buffer, MAX_TIME_LENGTH, "%m/%d/%Y %X", voxelsLoadedAtLocal);
|
|
||||||
mg_printf(connection, "%s File Loaded At: %s", theServer->getMyServerName(), buffer);
|
|
||||||
|
|
||||||
// Convert now to tm struct for UTC
|
|
||||||
tm* voxelsLoadedAtUTM = gmtime(theServer->getLoadCompleted());
|
|
||||||
if (gmtm != NULL) {
|
|
||||||
strftime(buffer, MAX_TIME_LENGTH, "%m/%d/%Y %X", voxelsLoadedAtUTM);
|
|
||||||
mg_printf(connection, " [%s UTM] ", buffer);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
mg_printf(connection, "%s File Persist Disabled...\r\n", theServer->getMyServerName());
|
mg_printf(connection, "%s File Persist Disabled...\r\n", theServer->getMyServerName());
|
||||||
}
|
}
|
||||||
mg_printf(connection, "%s", "\r\n");
|
mg_printf(connection, "%s", "\r\n");
|
||||||
|
|
||||||
|
|
||||||
uint64_t msecsElapsed = theServer->getLoadElapsedTime() / USECS_PER_MSEC;;
|
uint64_t msecsElapsed = theServer->getLoadElapsedTime() / USECS_PER_MSEC;;
|
||||||
float seconds = (msecsElapsed % MSECS_PER_MIN)/(float)MSECS_PER_SEC;
|
float seconds = (msecsElapsed % MSECS_PER_MIN)/(float)MSECS_PER_SEC;
|
||||||
int minutes = (msecsElapsed/(MSECS_PER_MIN)) % MIN_PER_HOUR;
|
int minutes = (msecsElapsed/(MSECS_PER_MIN)) % MIN_PER_HOUR;
|
||||||
|
|
|
@ -24,10 +24,10 @@
|
||||||
|
|
||||||
/// Handles assignments of type OctreeServer - sending octrees to various clients.
|
/// Handles assignments of type OctreeServer - sending octrees to various clients.
|
||||||
class OctreeServer : public ThreadedAssignment, public NodeListHook {
|
class OctreeServer : public ThreadedAssignment, public NodeListHook {
|
||||||
public:
|
public:
|
||||||
OctreeServer(const unsigned char* dataBuffer, int numBytes);
|
OctreeServer(const unsigned char* dataBuffer, int numBytes);
|
||||||
~OctreeServer();
|
~OctreeServer();
|
||||||
|
|
||||||
/// allows setting of run arguments
|
/// allows setting of run arguments
|
||||||
void setArguments(int argc, char** argv);
|
void setArguments(int argc, char** argv);
|
||||||
|
|
||||||
|
@ -37,15 +37,15 @@ public:
|
||||||
|
|
||||||
Octree* getOctree() { return _tree; }
|
Octree* getOctree() { return _tree; }
|
||||||
JurisdictionMap* getJurisdiction() { return _jurisdiction; }
|
JurisdictionMap* getJurisdiction() { return _jurisdiction; }
|
||||||
|
|
||||||
int getPacketsPerClientPerInterval() const { return _packetsPerClientPerInterval; }
|
int getPacketsPerClientPerInterval() const { return _packetsPerClientPerInterval; }
|
||||||
static OctreeServer* GetInstance() { return _theInstance; }
|
static OctreeServer* GetInstance() { return _theInstance; }
|
||||||
|
|
||||||
bool isInitialLoadComplete() const { return (_persistThread) ? _persistThread->isInitialLoadComplete() : true; }
|
bool isInitialLoadComplete() const { return (_persistThread) ? _persistThread->isInitialLoadComplete() : true; }
|
||||||
time_t* getLoadCompleted() { return (_persistThread) ? _persistThread->getLoadCompleted() : NULL; }
|
bool isPersistEnabled() const { return (_persistThread) ? true : false; }
|
||||||
uint64_t getLoadElapsedTime() const { return (_persistThread) ? _persistThread->getLoadElapsedTime() : 0; }
|
uint64_t getLoadElapsedTime() const { return (_persistThread) ? _persistThread->getLoadElapsedTime() : 0; }
|
||||||
|
|
||||||
// Subclasses must implement these methods
|
// Subclasses must implement these methods
|
||||||
virtual OctreeQueryNode* createOctreeQueryNode(Node* newNode) = 0;
|
virtual OctreeQueryNode* createOctreeQueryNode(Node* newNode) = 0;
|
||||||
virtual Octree* createTree() = 0;
|
virtual Octree* createTree() = 0;
|
||||||
virtual unsigned char getMyNodeType() const = 0;
|
virtual unsigned char getMyNodeType() const = 0;
|
||||||
|
@ -53,7 +53,7 @@ public:
|
||||||
virtual const char* getMyServerName() const = 0;
|
virtual const char* getMyServerName() const = 0;
|
||||||
virtual const char* getMyLoggingServerTargetName() const = 0;
|
virtual const char* getMyLoggingServerTargetName() const = 0;
|
||||||
virtual const char* getMyDefaultPersistFilename() const = 0;
|
virtual const char* getMyDefaultPersistFilename() const = 0;
|
||||||
|
|
||||||
// subclass may implement these method
|
// subclass may implement these method
|
||||||
virtual void beforeRun() { };
|
virtual void beforeRun() { };
|
||||||
virtual bool hasSpecialPacketToSend() { return false; }
|
virtual bool hasSpecialPacketToSend() { return false; }
|
||||||
|
@ -61,7 +61,7 @@ public:
|
||||||
|
|
||||||
static void attachQueryNodeToNode(Node* newNode);
|
static void attachQueryNodeToNode(Node* newNode);
|
||||||
|
|
||||||
// NodeListHook
|
// NodeListHook
|
||||||
virtual void nodeAdded(Node* node);
|
virtual void nodeAdded(Node* node);
|
||||||
virtual void nodeKilled(Node* node);
|
virtual void nodeKilled(Node* node);
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ protected:
|
||||||
|
|
||||||
char _persistFilename[MAX_FILENAME_LENGTH];
|
char _persistFilename[MAX_FILENAME_LENGTH];
|
||||||
int _packetsPerClientPerInterval;
|
int _packetsPerClientPerInterval;
|
||||||
Octree* _tree; // this IS a reaveraging tree
|
Octree* _tree; // this IS a reaveraging tree
|
||||||
bool _wantPersist;
|
bool _wantPersist;
|
||||||
bool _debugSending;
|
bool _debugSending;
|
||||||
bool _debugReceiving;
|
bool _debugReceiving;
|
||||||
|
|
|
@ -37,7 +37,6 @@ bool OctreePersistThread::process() {
|
||||||
}
|
}
|
||||||
_tree->unlock();
|
_tree->unlock();
|
||||||
|
|
||||||
_loadCompleted = time(0);
|
|
||||||
uint64_t loadDone = usecTimestampNow();
|
uint64_t loadDone = usecTimestampNow();
|
||||||
_loadTimeUSecs = loadDone - loadStarted;
|
_loadTimeUSecs = loadDone - loadStarted;
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,6 @@ public:
|
||||||
OctreePersistThread(Octree* tree, const QString& filename, int persistInterval = DEFAULT_PERSIST_INTERVAL);
|
OctreePersistThread(Octree* tree, const QString& filename, int persistInterval = DEFAULT_PERSIST_INTERVAL);
|
||||||
|
|
||||||
bool isInitialLoadComplete() const { return _initialLoadComplete; }
|
bool isInitialLoadComplete() const { return _initialLoadComplete; }
|
||||||
|
|
||||||
time_t* getLoadCompleted() { return &_loadCompleted; }
|
|
||||||
uint64_t getLoadElapsedTime() const { return _loadTimeUSecs; }
|
uint64_t getLoadElapsedTime() const { return _loadTimeUSecs; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
Loading…
Reference in a new issue