You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

713 lines
22 KiB

  1. /*
  2. Minetest
  3. Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #ifndef CLIENT_HEADER
  17. #define CLIENT_HEADER
  18. #include "network/connection.h"
  19. #include "clientenvironment.h"
  20. #include "irrlichttypes_extrabloated.h"
  21. #include <ostream>
  22. #include <map>
  23. #include <set>
  24. #include <vector>
  25. #include <unordered_set>
  26. #include "clientobject.h"
  27. #include "gamedef.h"
  28. #include "inventorymanager.h"
  29. #include "localplayer.h"
  30. #include "hud.h"
  31. #include "particles.h"
  32. #include "mapnode.h"
  33. #include "tileanimation.h"
  34. #include "mesh_generator_thread.h"
  35. #include <fstream>
  36. #define CLIENT_CHAT_MESSAGE_LIMIT_PER_10S 10.0f
  37. struct MeshMakeData;
  38. struct ChatMessage;
  39. class MapBlockMesh;
  40. class IWritableTextureSource;
  41. class IWritableShaderSource;
  42. class IWritableItemDefManager;
  43. class IWritableNodeDefManager;
  44. //class IWritableCraftDefManager;
  45. class ClientMediaDownloader;
  46. struct MapDrawControl;
  47. class MtEventManager;
  48. struct PointedThing;
  49. class MapDatabase;
  50. class Minimap;
  51. struct MinimapMapblock;
  52. class Camera;
  53. class NetworkPacket;
  54. enum LocalClientState {
  55. LC_Created,
  56. LC_Init,
  57. LC_Ready
  58. };
  59. enum ClientEventType
  60. {
  61. CE_NONE,
  62. CE_PLAYER_DAMAGE,
  63. CE_PLAYER_FORCE_MOVE,
  64. CE_DEATHSCREEN,
  65. CE_SHOW_FORMSPEC,
  66. CE_SHOW_LOCAL_FORMSPEC,
  67. CE_SPAWN_PARTICLE,
  68. CE_ADD_PARTICLESPAWNER,
  69. CE_DELETE_PARTICLESPAWNER,
  70. CE_HUDADD,
  71. CE_HUDRM,
  72. CE_HUDCHANGE,
  73. CE_SET_SKY,
  74. CE_OVERRIDE_DAY_NIGHT_RATIO,
  75. };
  76. struct ClientEvent
  77. {
  78. ClientEventType type;
  79. union{
  80. //struct{
  81. //} none;
  82. struct{
  83. u8 amount;
  84. } player_damage;
  85. struct{
  86. f32 pitch;
  87. f32 yaw;
  88. } player_force_move;
  89. struct{
  90. bool set_camera_point_target;
  91. f32 camera_point_target_x;
  92. f32 camera_point_target_y;
  93. f32 camera_point_target_z;
  94. } deathscreen;
  95. struct{
  96. std::string *formspec;
  97. std::string *formname;
  98. } show_formspec;
  99. //struct{
  100. //} textures_updated;
  101. struct{
  102. v3f *pos;
  103. v3f *vel;
  104. v3f *acc;
  105. f32 expirationtime;
  106. f32 size;
  107. bool collisiondetection;
  108. bool collision_removal;
  109. bool vertical;
  110. std::string *texture;
  111. struct TileAnimationParams animation;
  112. u8 glow;
  113. } spawn_particle;
  114. struct{
  115. u16 amount;
  116. f32 spawntime;
  117. v3f *minpos;
  118. v3f *maxpos;
  119. v3f *minvel;
  120. v3f *maxvel;
  121. v3f *minacc;
  122. v3f *maxacc;
  123. f32 minexptime;
  124. f32 maxexptime;
  125. f32 minsize;
  126. f32 maxsize;
  127. bool collisiondetection;
  128. bool collision_removal;
  129. u16 attached_id;
  130. bool vertical;
  131. std::string *texture;
  132. u32 id;
  133. struct TileAnimationParams animation;
  134. u8 glow;
  135. } add_particlespawner;
  136. struct{
  137. u32 id;
  138. } delete_particlespawner;
  139. struct{
  140. u32 id;
  141. u8 type;
  142. v2f *pos;
  143. std::string *name;
  144. v2f *scale;
  145. std::string *text;
  146. u32 number;
  147. u32 item;
  148. u32 dir;
  149. v2f *align;
  150. v2f *offset;
  151. v3f *world_pos;
  152. v2s32 * size;
  153. } hudadd;
  154. struct{
  155. u32 id;
  156. } hudrm;
  157. struct{
  158. u32 id;
  159. HudElementStat stat;
  160. v2f *v2fdata;
  161. std::string *sdata;
  162. u32 data;
  163. v3f *v3fdata;
  164. v2s32 * v2s32data;
  165. } hudchange;
  166. struct{
  167. video::SColor *bgcolor;
  168. std::string *type;
  169. std::vector<std::string> *params;
  170. bool clouds;
  171. } set_sky;
  172. struct{
  173. bool do_override;
  174. float ratio_f;
  175. } override_day_night_ratio;
  176. };
  177. };
  178. /*
  179. Packet counter
  180. */
  181. class PacketCounter
  182. {
  183. public:
  184. PacketCounter() = default;
  185. void add(u16 command)
  186. {
  187. std::map<u16, u16>::iterator n = m_packets.find(command);
  188. if(n == m_packets.end())
  189. {
  190. m_packets[command] = 1;
  191. }
  192. else
  193. {
  194. n->second++;
  195. }
  196. }
  197. void clear()
  198. {
  199. for (auto &m_packet : m_packets) {
  200. m_packet.second = 0;
  201. }
  202. }
  203. void print(std::ostream &o)
  204. {
  205. for (const auto &m_packet : m_packets) {
  206. o << "cmd "<< m_packet.first <<" count "<< m_packet.second << std::endl;
  207. }
  208. }
  209. private:
  210. // command, count
  211. std::map<u16, u16> m_packets;
  212. };
  213. class ClientScripting;
  214. struct GameUIFlags;
  215. class Client : public con::PeerHandler, public InventoryManager, public IGameDef
  216. {
  217. public:
  218. /*
  219. NOTE: Nothing is thread-safe here.
  220. */
  221. Client(
  222. const char *playername,
  223. const std::string &password,
  224. const std::string &address_name,
  225. MapDrawControl &control,
  226. IWritableTextureSource *tsrc,
  227. IWritableShaderSource *shsrc,
  228. IWritableItemDefManager *itemdef,
  229. IWritableNodeDefManager *nodedef,
  230. ISoundManager *sound,
  231. MtEventManager *event,
  232. bool ipv6,
  233. GameUIFlags *game_ui_flags
  234. );
  235. ~Client();
  236. DISABLE_CLASS_COPY(Client);
  237. // Load local mods into memory
  238. void scanModSubfolder(const std::string &mod_name, const std::string &mod_path,
  239. std::string mod_subpath);
  240. inline void scanModIntoMemory(const std::string &mod_name, const std::string &mod_path)
  241. {
  242. scanModSubfolder(mod_name, mod_path, "");
  243. }
  244. /*
  245. request all threads managed by client to be stopped
  246. */
  247. void Stop();
  248. bool isShutdown();
  249. /*
  250. The name of the local player should already be set when
  251. calling this, as it is sent in the initialization.
  252. */
  253. void connect(Address address, bool is_local_server);
  254. /*
  255. Stuff that references the environment is valid only as
  256. long as this is not called. (eg. Players)
  257. If this throws a PeerNotFoundException, the connection has
  258. timed out.
  259. */
  260. void step(float dtime);
  261. /*
  262. * Command Handlers
  263. */
  264. void handleCommand(NetworkPacket* pkt);
  265. void handleCommand_Null(NetworkPacket* pkt) {};
  266. void handleCommand_Deprecated(NetworkPacket* pkt);
  267. void handleCommand_Hello(NetworkPacket* pkt);
  268. void handleCommand_AuthAccept(NetworkPacket* pkt);
  269. void handleCommand_AcceptSudoMode(NetworkPacket* pkt);
  270. void handleCommand_DenySudoMode(NetworkPacket* pkt);
  271. void handleCommand_InitLegacy(NetworkPacket* pkt);
  272. void handleCommand_AccessDenied(NetworkPacket* pkt);
  273. void handleCommand_RemoveNode(NetworkPacket* pkt);
  274. void handleCommand_AddNode(NetworkPacket* pkt);
  275. void handleCommand_BlockData(NetworkPacket* pkt);
  276. void handleCommand_Inventory(NetworkPacket* pkt);
  277. void handleCommand_TimeOfDay(NetworkPacket* pkt);
  278. void handleCommand_ChatMessage(NetworkPacket *pkt);
  279. void handleCommand_ChatMessageOld(NetworkPacket *pkt);
  280. void handleCommand_ActiveObjectRemoveAdd(NetworkPacket* pkt);
  281. void handleCommand_ActiveObjectMessages(NetworkPacket* pkt);
  282. void handleCommand_Movement(NetworkPacket* pkt);
  283. void handleCommand_HP(NetworkPacket* pkt);
  284. void handleCommand_Breath(NetworkPacket* pkt);
  285. void handleCommand_MovePlayer(NetworkPacket* pkt);
  286. void handleCommand_DeathScreen(NetworkPacket* pkt);
  287. void handleCommand_AnnounceMedia(NetworkPacket* pkt);
  288. void handleCommand_Media(NetworkPacket* pkt);
  289. void handleCommand_NodeDef(NetworkPacket* pkt);
  290. void handleCommand_ItemDef(NetworkPacket* pkt);
  291. void handleCommand_PlaySound(NetworkPacket* pkt);
  292. void handleCommand_StopSound(NetworkPacket* pkt);
  293. void handleCommand_FadeSound(NetworkPacket *pkt);
  294. void handleCommand_Privileges(NetworkPacket* pkt);
  295. void handleCommand_InventoryFormSpec(NetworkPacket* pkt);
  296. void handleCommand_DetachedInventory(NetworkPacket* pkt);
  297. void handleCommand_ShowFormSpec(NetworkPacket* pkt);
  298. void handleCommand_SpawnParticle(NetworkPacket* pkt);
  299. void handleCommand_AddParticleSpawner(NetworkPacket* pkt);
  300. void handleCommand_DeleteParticleSpawner(NetworkPacket* pkt);
  301. void handleCommand_HudAdd(NetworkPacket* pkt);
  302. void handleCommand_HudRemove(NetworkPacket* pkt);
  303. void handleCommand_HudChange(NetworkPacket* pkt);
  304. void handleCommand_HudSetFlags(NetworkPacket* pkt);
  305. void handleCommand_HudSetParam(NetworkPacket* pkt);
  306. void handleCommand_HudSetSky(NetworkPacket* pkt);
  307. void handleCommand_OverrideDayNightRatio(NetworkPacket* pkt);
  308. void handleCommand_LocalPlayerAnimations(NetworkPacket* pkt);
  309. void handleCommand_EyeOffset(NetworkPacket* pkt);
  310. void handleCommand_UpdatePlayerList(NetworkPacket* pkt);
  311. void handleCommand_SrpBytesSandB(NetworkPacket* pkt);
  312. void handleCommand_CSMFlavourLimits(NetworkPacket *pkt);
  313. void ProcessData(NetworkPacket *pkt);
  314. void Send(NetworkPacket* pkt);
  315. void interact(u8 action, const PointedThing& pointed);
  316. void sendNodemetaFields(v3s16 p, const std::string &formname,
  317. const StringMap &fields);
  318. void sendInventoryFields(const std::string &formname,
  319. const StringMap &fields);
  320. void sendInventoryAction(InventoryAction *a);
  321. void sendChatMessage(const std::wstring &message);
  322. void clearOutChatQueue();
  323. void sendChangePassword(const std::string &oldpassword,
  324. const std::string &newpassword);
  325. void sendDamage(u8 damage);
  326. void sendBreath(u16 breath);
  327. void sendRespawn();
  328. void sendReady();
  329. ClientEnvironment& getEnv() { return m_env; }
  330. ITextureSource *tsrc() { return getTextureSource(); }
  331. ISoundManager *sound() { return getSoundManager(); }
  332. static const std::string &getBuiltinLuaPath();
  333. static const std::string &getClientModsLuaPath();
  334. virtual const std::vector<ModSpec> &getMods() const;
  335. virtual const ModSpec* getModSpec(const std::string &modname) const;
  336. // Causes urgent mesh updates (unlike Map::add/removeNodeWithEvent)
  337. void removeNode(v3s16 p);
  338. /**
  339. * Helper function for Client Side Modding
  340. * Flavour is applied there, this should not be used for core engine
  341. * @param p
  342. * @param is_valid_position
  343. * @return
  344. */
  345. MapNode getNode(v3s16 p, bool *is_valid_position);
  346. v3s16 CSMClampPos (v3s16 pos);
  347. void addNode(v3s16 p, MapNode n, bool remove_metadata = true);
  348. void setPlayerControl(PlayerControl &control);
  349. void selectPlayerItem(u16 item);
  350. u16 getPlayerItem() const
  351. { return m_playeritem; }
  352. // Returns true if the inventory of the local player has been
  353. // updated from the server. If it is true, it is set to false.
  354. bool getLocalInventoryUpdated();
  355. // Copies the inventory of the local player to parameter
  356. void getLocalInventory(Inventory &dst);
  357. /* InventoryManager interface */
  358. Inventory* getInventory(const InventoryLocation &loc);
  359. void inventoryAction(InventoryAction *a);
  360. const std::list<std::string> &getConnectedPlayerNames()
  361. {
  362. return m_env.getPlayerNames();
  363. }
  364. float getAnimationTime();
  365. int getCrackLevel();
  366. v3s16 getCrackPos();
  367. void setCrack(int level, v3s16 pos);
  368. u16 getHP();
  369. bool checkPrivilege(const std::string &priv) const
  370. { return (m_privileges.count(priv) != 0); }
  371. const std::unordered_set<std::string> &getPrivilegeList() const
  372. { return m_privileges; }
  373. bool getChatMessage(std::wstring &message);
  374. void typeChatMessage(const std::wstring& message);
  375. u64 getMapSeed(){ return m_map_seed; }
  376. void addUpdateMeshTask(v3s16 blockpos, bool ack_to_server=false, bool urgent=false);
  377. // Including blocks at appropriate edges
  378. void addUpdateMeshTaskWithEdge(v3s16 blockpos, bool ack_to_server=false, bool urgent=false);
  379. void addUpdateMeshTaskForNode(v3s16 nodepos, bool ack_to_server=false, bool urgent=false);
  380. void updateCameraOffset(v3s16 camera_offset)
  381. { m_mesh_update_thread.m_camera_offset = camera_offset; }
  382. bool hasClientEvents() const { return !m_client_event_queue.empty(); }
  383. // Get event from queue. If queue is empty, it triggers an assertion failure.
  384. ClientEvent getClientEvent();
  385. bool accessDenied() const { return m_access_denied; }
  386. bool reconnectRequested() const { return m_access_denied_reconnect; }
  387. void setFatalError(const std::string &reason)
  388. {
  389. m_access_denied = true;
  390. m_access_denied_reason = reason;
  391. }
  392. // Renaming accessDeniedReason to better name could be good as it's used to
  393. // disconnect client when CSM failed.
  394. const std::string &accessDeniedReason() const { return m_access_denied_reason; }
  395. const bool itemdefReceived() const
  396. { return m_itemdef_received; }
  397. const bool nodedefReceived() const
  398. { return m_nodedef_received; }
  399. const bool mediaReceived() const
  400. { return !m_media_downloader; }
  401. u8 getProtoVersion()
  402. { return m_proto_ver; }
  403. bool connectedToServer()
  404. { return m_con.Connected(); }
  405. float mediaReceiveProgress();
  406. void afterContentReceived();
  407. float getRTT();
  408. float getCurRate();
  409. Minimap* getMinimap() { return m_minimap; }
  410. void setCamera(Camera* camera) { m_camera = camera; }
  411. Camera* getCamera () { return m_camera; }
  412. bool shouldShowMinimap() const;
  413. // IGameDef interface
  414. virtual IItemDefManager* getItemDefManager();
  415. virtual INodeDefManager* getNodeDefManager();
  416. virtual ICraftDefManager* getCraftDefManager();
  417. ITextureSource* getTextureSource();
  418. virtual IShaderSource* getShaderSource();
  419. IShaderSource *shsrc() { return getShaderSource(); }
  420. virtual u16 allocateUnknownNodeId(const std::string &name);
  421. virtual ISoundManager* getSoundManager();
  422. virtual MtEventManager* getEventManager();
  423. virtual ParticleManager* getParticleManager();
  424. bool checkLocalPrivilege(const std::string &priv)
  425. { return checkPrivilege(priv); }
  426. virtual scene::IAnimatedMesh* getMesh(const std::string &filename, bool cache = false);
  427. const std::string* getModFile(const std::string &filename);
  428. virtual std::string getModStoragePath() const;
  429. virtual bool registerModStorage(ModMetadata *meta);
  430. virtual void unregisterModStorage(const std::string &name);
  431. // The following set of functions is used by ClientMediaDownloader
  432. // Insert a media file appropriately into the appropriate manager
  433. bool loadMedia(const std::string &data, const std::string &filename);
  434. // Send a request for conventional media transfer
  435. void request_media(const std::vector<std::string> &file_requests);
  436. LocalClientState getState() { return m_state; }
  437. void makeScreenshot();
  438. inline void pushToChatQueue(ChatMessage *cec)
  439. {
  440. m_chat_queue.push(cec);
  441. }
  442. ClientScripting *getScript() { return m_script; }
  443. const bool moddingEnabled() const { return m_modding_enabled; }
  444. const bool modsLoaded() const { return m_mods_loaded; }
  445. inline void pushToEventQueue(const ClientEvent &event)
  446. {
  447. m_client_event_queue.push(event);
  448. }
  449. void showGameChat(bool show = true);
  450. void showGameHud(bool show = true);
  451. void showMinimap(bool show = true);
  452. void showProfiler(bool show = true);
  453. void showGameFog(bool show = true);
  454. void showGameDebug(bool show = true);
  455. const Address getServerAddress()
  456. {
  457. return m_con.GetPeerAddress(PEER_ID_SERVER);
  458. }
  459. const std::string &getAddressName() const
  460. {
  461. return m_address_name;
  462. }
  463. inline bool checkCSMFlavourLimit(CSMFlavourLimit flag) const
  464. {
  465. return m_csm_flavour_limits & flag;
  466. }
  467. u32 getCSMNodeRangeLimit() const
  468. {
  469. return m_csm_noderange_limit;
  470. }
  471. private:
  472. void loadMods();
  473. bool checkBuiltinIntegrity();
  474. // Virtual methods from con::PeerHandler
  475. void peerAdded(con::Peer *peer);
  476. void deletingPeer(con::Peer *peer, bool timeout);
  477. void initLocalMapSaving(const Address &address,
  478. const std::string &hostname,
  479. bool is_local_server);
  480. void ReceiveAll();
  481. void Receive();
  482. void sendPlayerPos();
  483. // Send the item number 'item' as player item to the server
  484. void sendPlayerItem(u16 item);
  485. void deleteAuthData();
  486. // helper method shared with clientpackethandler
  487. static AuthMechanism choseAuthMech(const u32 mechs);
  488. void sendLegacyInit(const char* playerName, const char* playerPassword);
  489. void sendInit(const std::string &playerName);
  490. void startAuth(AuthMechanism chosen_auth_mechanism);
  491. void sendDeletedBlocks(std::vector<v3s16> &blocks);
  492. void sendGotBlocks(v3s16 block);
  493. void sendRemovedSounds(std::vector<s32> &soundList);
  494. // Helper function
  495. inline std::string getPlayerName()
  496. { return m_env.getLocalPlayer()->getName(); }
  497. bool canSendChatMessage() const;
  498. float m_packetcounter_timer = 0.0f;
  499. float m_connection_reinit_timer = 0.1f;
  500. float m_avg_rtt_timer = 0.0f;
  501. float m_playerpos_send_timer = 0.0f;
  502. float m_ignore_damage_timer = 0.0f; // Used after server moves player
  503. IntervalLimiter m_map_timer_and_unload_interval;
  504. IWritableTextureSource *m_tsrc;
  505. IWritableShaderSource *m_shsrc;
  506. IWritableItemDefManager *m_itemdef;
  507. IWritableNodeDefManager *m_nodedef;
  508. ISoundManager *m_sound;
  509. MtEventManager *m_event;
  510. MeshUpdateThread m_mesh_update_thread;
  511. ClientEnvironment m_env;
  512. ParticleManager m_particle_manager;
  513. con::Connection m_con;
  514. std::string m_address_name;
  515. Camera *m_camera = nullptr;
  516. Minimap *m_minimap = nullptr;
  517. bool m_minimap_disabled_by_server = false;
  518. // Server serialization version
  519. u8 m_server_ser_ver;
  520. // Used version of the protocol with server
  521. // Values smaller than 25 only mean they are smaller than 25,
  522. // and aren't accurate. We simply just don't know, because
  523. // the server didn't send the version back then.
  524. // If 0, server init hasn't been received yet.
  525. u8 m_proto_ver = 0;
  526. u16 m_playeritem = 0;
  527. bool m_inventory_updated = false;
  528. Inventory *m_inventory_from_server = nullptr;
  529. float m_inventory_from_server_age = 0.0f;
  530. PacketCounter m_packetcounter;
  531. // Block mesh animation parameters
  532. float m_animation_time = 0.0f;
  533. int m_crack_level = -1;
  534. v3s16 m_crack_pos;
  535. // 0 <= m_daynight_i < DAYNIGHT_CACHE_COUNT
  536. //s32 m_daynight_i;
  537. //u32 m_daynight_ratio;
  538. std::queue<std::wstring> m_out_chat_queue;
  539. u32 m_last_chat_message_sent;
  540. float m_chat_message_allowance = 5.0f;
  541. std::queue<ChatMessage *> m_chat_queue;
  542. // The authentication methods we can use to enter sudo mode (=change password)
  543. u32 m_sudo_auth_methods;
  544. // The seed returned by the server in TOCLIENT_INIT is stored here
  545. u64 m_map_seed = 0;
  546. // Auth data
  547. std::string m_playername;
  548. std::string m_password;
  549. // If set, this will be sent (and cleared) upon a TOCLIENT_ACCEPT_SUDO_MODE
  550. std::string m_new_password;
  551. // Usable by auth mechanisms.
  552. AuthMechanism m_chosen_auth_mech;
  553. void *m_auth_data = nullptr;
  554. bool m_access_denied = false;
  555. bool m_access_denied_reconnect = false;
  556. std::string m_access_denied_reason = "";
  557. std::queue<ClientEvent> m_client_event_queue;
  558. bool m_itemdef_received = false;
  559. bool m_nodedef_received = false;
  560. bool m_mods_loaded = false;
  561. ClientMediaDownloader *m_media_downloader;
  562. // time_of_day speed approximation for old protocol
  563. bool m_time_of_day_set = false;
  564. float m_last_time_of_day_f = -1.0f;
  565. float m_time_of_day_update_timer = 0.0f;
  566. // An interval for generally sending object positions and stuff
  567. float m_recommended_send_interval = 0.1f;
  568. // Sounds
  569. float m_removed_sounds_check_timer = 0.0f;
  570. // Mapping from server sound ids to our sound ids
  571. std::unordered_map<s32, int> m_sounds_server_to_client;
  572. // And the other way!
  573. std::unordered_map<int, s32> m_sounds_client_to_server;
  574. // And relations to objects
  575. std::unordered_map<int, u16> m_sounds_to_objects;
  576. // Privileges
  577. std::unordered_set<std::string> m_privileges;
  578. // Detached inventories
  579. // key = name
  580. std::unordered_map<std::string, Inventory*> m_detached_inventories;
  581. // Storage for mesh data for creating multiple instances of the same mesh
  582. StringMap m_mesh_data;
  583. StringMap m_mod_files;
  584. // own state
  585. LocalClientState m_state;
  586. // Used for saving server map to disk client-side
  587. MapDatabase *m_localdb = nullptr;
  588. IntervalLimiter m_localdb_save_interval;
  589. u16 m_cache_save_interval;
  590. ClientScripting *m_script = nullptr;
  591. bool m_modding_enabled;
  592. std::unordered_map<std::string, ModMetadata *> m_mod_storages;
  593. float m_mod_storage_save_timer = 10.0f;
  594. std::vector<ModSpec> m_mods;
  595. GameUIFlags *m_game_ui_flags;
  596. bool m_shutdown = false;
  597. // CSM flavour limits byteflag
  598. u64 m_csm_flavour_limits = CSMFlavourLimit::CSM_FL_NONE;
  599. u32 m_csm_noderange_limit = 8;
  600. };
  601. #endif // !CLIENT_HEADER