the whole game

This commit is contained in:
2026-03-02 22:04:18 +03:00
parent 816e9060b4
commit f0617a5d22
2069 changed files with 581500 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
/// \file
///
/// This file is part of RakNet Copyright 2003 Jenkins Software LLC
///
/// Usage of RakNet is subject to the appropriate license agreement.
#ifndef __NETWORK_ID_MANAGER_H
#define __NETWORK_ID_MANAGER_H
#include "RakNetTypes.h"
#include "Export.h"
#include "RakMemoryOverride.h"
#include "NetworkIDObject.h"
#include "Rand.h"
namespace RakNet
{
/// Increase this value if you plan to have many persistent objects
/// This value must match on all systems
#define NETWORK_ID_MANAGER_HASH_LENGTH 1024
/// This class is simply used to generate a unique number for a group of instances of NetworkIDObject
/// An instance of this class is required to use the ObjectID to pointer lookup system
/// You should have one instance of this class per game instance.
/// Call SetIsNetworkIDAuthority before using any functions of this class, or of NetworkIDObject
class RAK_DLL_EXPORT NetworkIDManager
{
public:
// GetInstance() and DestroyInstance(instance*)
STATIC_FACTORY_DECLARATIONS(NetworkIDManager)
NetworkIDManager();
virtual ~NetworkIDManager(void);
/// Returns the parent object, or this instance if you don't use a parent.
/// Supports NetworkIDObject anywhere in the inheritance hierarchy
/// \pre You must first call SetNetworkIDManager before using this function
template <class returnType>
returnType GET_OBJECT_FROM_ID(NetworkID x) {
NetworkIDObject *nio = GET_BASE_OBJECT_FROM_ID(x);
if (nio==0)
return 0;
if (nio->GetParent())
return (returnType) nio->GetParent();
return (returnType) nio;
}
/// \internal
NetworkIDObject *GET_BASE_OBJECT_FROM_ID(NetworkID x);
/// \internal
void TrackNetworkIDObject(NetworkIDObject *networkIdObject);
void StopTrackingNetworkIDObject(NetworkIDObject *networkIdObject);
protected:
friend class NetworkIDObject;
NetworkIDObject *networkIdHash[NETWORK_ID_MANAGER_HASH_LENGTH];
unsigned int NetworkIDToHashIndex(NetworkID networkId);
uint64_t startingOffset;
/// \internal
NetworkID GetNewNetworkID(void);
};
} // namespace RakNet
#endif