DDraceNetwork Documentation
Loading...
Searching...
No Matches
register.h
Go to the documentation of this file.
1#ifndef ENGINE_SERVER_REGISTER_H
2#define ENGINE_SERVER_REGISTER_H
3
4class CConfig;
5class IConsole;
6class IEngine;
7class IHttp;
8struct CNetChunk;
9
11{
12public:
13 virtual ~IRegister() = default;
14
15 virtual void Update() = 0;
16 // Call `OnConfigChange` if you change relevant config variables
17 // without going through the console.
18 virtual void OnConfigChange() = 0;
19 // Returns `true` if the packet was a packet related to registering
20 // code and doesn't have to processed furtherly.
21 virtual bool OnPacket(const CNetChunk *pPacket) = 0;
22 // `pInfo` must be an encoded JSON object.
23 virtual void OnNewInfo(const char *pInfo) = 0;
24 virtual void OnShutdown() = 0;
25};
26
27IRegister *CreateRegister(CConfig *pConfig, IConsole *pConsole, IEngine *pEngine, IHttp *pHttp, int ServerPort, unsigned SixupSecurityToken);
28
29#endif
Definition config.h:30
Definition console.h:20
Definition engine.h:15
Definition http.h:13
Definition register.h:11
virtual void Update()=0
virtual void OnNewInfo(const char *pInfo)=0
virtual void OnConfigChange()=0
virtual void OnShutdown()=0
virtual ~IRegister()=default
virtual bool OnPacket(const CNetChunk *pPacket)=0
IRegister * CreateRegister(CConfig *pConfig, IConsole *pConsole, IEngine *pEngine, IHttp *pHttp, int ServerPort, unsigned SixupSecurityToken)
Definition register.cpp:799
Definition network.h:132