1#ifndef ENGINE_SERVER_REGISTER_H
2#define ENGINE_SERVER_REGISTER_H
3
4class CConfig;
5class IConsole;
6class IEngine;
7class IHttp;
8struct CNetChunk;
9
10class IRegister
11{
12public:
13 virtual ~IRegister() {}
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
30