Polyphase Game Engine
Loading...
Searching...
No Matches
NetworkModule.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5// Undefine Windows macros that collide with our method names
6#ifdef SetPort
7#undef SetPort
8#endif
9
10#include "../PreferencesModule.h"
11
12class NetworkModule : public PreferencesModule
13{
14public:
15 DECLARE_PREFERENCES_MODULE(NetworkModule)
16
17 NetworkModule();
18 virtual ~NetworkModule();
19
20 virtual const char* GetName() const override { return GetStaticName(); }
21 virtual const char* GetParentPath() const override { return GetStaticParentPath(); }
22 virtual void Render() override;
23 virtual void LoadSettings(const rapidjson::Document& doc) override;
24 virtual void SaveSettings(rapidjson::Document& doc) override;
25
26 bool GetControllerServerEnabled() const { return mControllerServerEnabled; }
27 int GetPort() const { return mPort; }
28 bool GetLogRequests() const { return mLogRequests; }
29
30 void SetControllerServerEnabled(bool enabled);
31 void SetPort(int port);
32 void SetLogRequests(bool log);
33
34 static NetworkModule* Get();
35
36private:
37 bool mControllerServerEnabled = false;
38 int mPort = 7890;
39 bool mLogRequests = false;
40
41 static NetworkModule* sInstance;
42};
43
44#endif
Definition JsonHelpers.h:15