| 1 | #ifndef ENGINE_SERVER_REGISTER_H |
| 2 | #define ENGINE_SERVER_REGISTER_H |
| 3 | |
| 4 | class CConfig; |
| 5 | class IConsole; |
| 6 | class IEngine; |
| 7 | class IHttp; |
| 8 | struct CNetChunk; |
| 9 | |
| 10 | class IRegister |
| 11 | { |
| 12 | public: |
| 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 | |
| 27 | IRegister *CreateRegister(CConfig *pConfig, IConsole *pConsole, IEngine *pEngine, IHttp *pHttp, int ServerPort, unsigned SixupSecurityToken); |
| 28 | |
| 29 | #endif |
| 30 | |