mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-26 23:43:34 +00:00
41 lines
844 B
C
41 lines
844 B
C
|
#pragma once
|
||
|
|
||
|
// C++
|
||
|
#include <functional>
|
||
|
#include <vector>
|
||
|
#include <stdint.h>
|
||
|
|
||
|
/*!
|
||
|
\file ObjectIDManager.h
|
||
|
\brief A manager for handling object ID generation
|
||
|
*/
|
||
|
|
||
|
//! The Object ID Manager
|
||
|
namespace ObjectIDManager {
|
||
|
//! Requests a persistent ID
|
||
|
/*!
|
||
|
\param callback The callback function
|
||
|
*/
|
||
|
void RequestPersistentID(const std::function<void(uint32_t)> callback);
|
||
|
|
||
|
|
||
|
//! Handles a persistent ID response
|
||
|
/*!
|
||
|
\param requestID The request ID
|
||
|
\param persistentID The persistent ID
|
||
|
*/
|
||
|
void HandleRequestPersistentIDResponse(const uint64_t requestID, const uint32_t persistentID);
|
||
|
|
||
|
//! Generates an object ID server-sided
|
||
|
/*!
|
||
|
\return A generated object ID
|
||
|
*/
|
||
|
uint32_t GenerateObjectID();
|
||
|
|
||
|
//! Generates a random object ID server-sided
|
||
|
/*!
|
||
|
\return A generated object ID
|
||
|
*/
|
||
|
uint32_t GenerateRandomObjectID();
|
||
|
};
|