DarkflameServer/dMasterServer/ObjectIDManager.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
677 B
C++
Raw Normal View History

#include "ObjectIDManager.h"
// Custom Classes
#include "Database.h"
#include "dLogger.h"
// Static Variables
ObjectIDManager* ObjectIDManager::m_Address = nullptr;
//! Initializes the manager
void ObjectIDManager::Initialize(dLogger* logger) {
this->mLogger = logger;
2023-10-10 00:40:48 +00:00
this->currentPersistentID = Database::Connection->GetObjectIDTracker();
}
//! Generates a new persistent ID
uint32_t ObjectIDManager::GeneratePersistentID(void) {
uint32_t toReturn = ++this->currentPersistentID;
2023-10-10 00:40:48 +00:00
Database::Connection->SetObjectIDTracker(toReturn);
return toReturn;
}
void ObjectIDManager::SaveToDatabase() {
2023-10-10 00:40:48 +00:00
Database::Connection->SetObjectIDTracker(this->currentPersistentID);
}