Organize engine-shared includes

This commit is contained in:
Robert Müller 2022-06-16 17:06:15 +02:00
parent 0a4b1b9a7b
commit 4048bbbf5c
7 changed files with 30 additions and 17 deletions

View file

@ -9,6 +9,7 @@
#include <engine/shared/json.h>
#include <engine/shared/masterserver.h>
#include <engine/shared/network.h>
#include <engine/shared/packer.h>
#include <engine/shared/uuid_manager.h>
class CRegister : public IRegister

View file

@ -3,9 +3,12 @@
#include "network.h"
#include <engine/config.h>
#include <engine/console.h>
class CConfig;
class CNetBan;
class ColorRGBA;
class CEcon
{
enum
@ -47,7 +50,7 @@ public:
CEcon();
IConsole *Console() { return m_pConsole; }
void Init(CConfig *pConfig, IConsole *pConsole, class CNetBan *pNetBan);
void Init(CConfig *pConfig, IConsole *pConsole, CNetBan *pNetBan);
void Update();
void Send(int ClientID, const char *pLine);
void Shutdown();

View file

@ -3,10 +3,12 @@
#ifndef ENGINE_SHARED_FILECOLLECTION_H
#define ENGINE_SHARED_FILECOLLECTION_H
#include <engine/storage.h>
#include <base/system.h>
#include <stdint.h>
class IStorage;
class CFileCollection
{
enum

View file

@ -12,7 +12,7 @@ class CJobPool;
class IJob
{
friend class CJobPool;
friend CJobPool;
private:
std::shared_ptr<IJob> m_pNext;

View file

@ -3,13 +3,15 @@
#ifndef ENGINE_SHARED_NETWORK_H
#define ENGINE_SHARED_NETWORK_H
#include "huffman.h"
#include "ringbuffer.h"
#include "stun.h"
#include <base/math.h>
#include <base/system.h>
#include <engine/message.h>
class CHuffman;
class CMsgPacker;
class CNetBan;
/*
@ -352,7 +354,7 @@ class CNetServer
NETADDR m_Address;
NETSOCKET m_Socket;
class CNetBan *m_pNetBan;
CNetBan *m_pNetBan;
CSlot m_aSlots[NET_MAX_CLIENTS];
int m_MaxClients;
int m_MaxClientsPerIP;
@ -393,7 +395,7 @@ public:
int SetCallbacks(NETFUNC_NEWCLIENT pfnNewClient, NETFUNC_NEWCLIENT_NOAUTH pfnNewClientNoAuth, NETFUNC_CLIENTREJOIN pfnClientRejoin, NETFUNC_DELCLIENT pfnDelClient, void *pUser);
//
bool Open(NETADDR BindAddr, class CNetBan *pNetBan, int MaxClients, int MaxClientsPerIP);
bool Open(NETADDR BindAddr, CNetBan *pNetBan, int MaxClients, int MaxClientsPerIP);
int Close();
//
@ -409,7 +411,7 @@ public:
bool HasSecurityToken(int ClientID) const { return m_aSlots[ClientID].m_Connection.SecurityToken() != NET_SECURITY_TOKEN_UNSUPPORTED; }
NETADDR Address() const { return m_Address; }
NETSOCKET Socket() const { return m_Socket; }
class CNetBan *NetBan() const { return m_pNetBan; }
CNetBan *NetBan() const { return m_pNetBan; }
int NetType() const { return net_socket_type(m_Socket); }
int MaxClients() const { return m_MaxClients; }
@ -439,7 +441,7 @@ class CNetConsole
};
NETSOCKET m_Socket;
class CNetBan *m_pNetBan;
CNetBan *m_pNetBan;
CSlot m_aSlots[NET_MAX_CONSOLE_CLIENTS];
NETFUNC_NEWCLIENT_CON m_pfnNewClient;
@ -452,7 +454,7 @@ public:
void SetCallbacks(NETFUNC_NEWCLIENT_CON pfnNewClient, NETFUNC_DELCLIENT pfnDelClient, void *pUser);
//
bool Open(NETADDR BindAddr, class CNetBan *pNetBan);
bool Open(NETADDR BindAddr, CNetBan *pNetBan);
int Close();
//
@ -466,7 +468,7 @@ public:
// status requests
const NETADDR *ClientAddr(int ClientID) const { return m_aSlots[ClientID].m_Connection.PeerAddress(); }
class CNetBan *NetBan() const { return m_pNetBan; }
CNetBan *NetBan() const { return m_pNetBan; }
};
// client side

View file

@ -3,6 +3,8 @@
#include "config.h"
#include "uuid_manager.h"
#include <engine/message.h>
#include <new>
void RegisterUuids(CUuidManager *pManager)
@ -12,7 +14,7 @@ void RegisterUuids(CUuidManager *pManager)
#undef UUID
}
int UnpackMessageID(int *pID, bool *pSys, struct CUuid *pUuid, CUnpacker *pUnpacker, CMsgPacker *pPacker)
int UnpackMessageID(int *pID, bool *pSys, CUuid *pUuid, CUnpacker *pUnpacker, CMsgPacker *pPacker)
{
*pID = 0;
*pSys = false;

View file

@ -1,7 +1,10 @@
#ifndef ENGINE_SHARED_PROTOCOL_EX_H
#define ENGINE_SHARED_PROTOCOL_EX_H
#include <engine/message.h>
#include <engine/shared/uuid_manager.h>
class CMsgPacker;
class CUnpacker;
enum
{
@ -29,9 +32,9 @@ enum
SERVERCAPFLAG_SYNCWEAPONINPUT = 1 << 5,
};
void RegisterUuids(class CUuidManager *pManager);
bool NetworkExDefaultHandler(int *pID, struct CUuid *pUuid, CUnpacker *pUnpacker, CMsgPacker *pPacker, int Type);
void RegisterUuids(CUuidManager *pManager);
bool NetworkExDefaultHandler(int *pID, CUuid *pUuid, CUnpacker *pUnpacker, CMsgPacker *pPacker, int Type);
int UnpackMessageID(int *pID, bool *pSys, struct CUuid *pUuid, CUnpacker *pUnpacker, CMsgPacker *pPacker);
int UnpackMessageID(int *pID, bool *pSys, CUuid *pUuid, CUnpacker *pUnpacker, CMsgPacker *pPacker);
#endif // ENGINE_SHARED_PROTOCOL_EX_H