client.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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. #pragma once
  17. #include "clientenvironment.h"
  18. #include "irrlichttypes_extrabloated.h"
  19. #include <ostream>
  20. #include <map>
  21. #include <memory>
  22. #include <set>
  23. #include <vector>
  24. #include <unordered_set>
  25. #include "clientobject.h"
  26. #include "gamedef.h"
  27. #include "inventorymanager.h"
  28. #include "client/hud.h"
  29. #include "tileanimation.h"
  30. #include "network/address.h"
  31. #include "network/peerhandler.h"
  32. #include "gameparams.h"
  33. #include "clientdynamicinfo.h"
  34. #include <fstream>
  35. #include "util/numeric.h"
  36. #define CLIENT_CHAT_MESSAGE_LIMIT_PER_10S 10.0f
  37. struct ClientEvent;
  38. struct MeshMakeData;
  39. struct ChatMessage;
  40. class MapBlockMesh;
  41. class RenderingEngine;
  42. class IWritableTextureSource;
  43. class IWritableShaderSource;
  44. class IWritableItemDefManager;
  45. class ISoundManager;
  46. class NodeDefManager;
  47. //class IWritableCraftDefManager;
  48. class ClientMediaDownloader;
  49. class SingleMediaDownloader;
  50. struct MapDrawControl;
  51. class ModChannelMgr;
  52. class MtEventManager;
  53. struct PointedThing;
  54. struct MapNode;
  55. class MapDatabase;
  56. class Minimap;
  57. struct MinimapMapblock;
  58. class MeshUpdateManager;
  59. class ParticleManager;
  60. class Camera;
  61. struct PlayerControl;
  62. class NetworkPacket;
  63. namespace con {
  64. class Connection;
  65. }
  66. using sound_handle_t = int;
  67. enum LocalClientState {
  68. LC_Created,
  69. LC_Init,
  70. LC_Ready
  71. };
  72. /*
  73. Packet counter
  74. */
  75. class PacketCounter
  76. {
  77. public:
  78. PacketCounter() = default;
  79. void add(u16 command)
  80. {
  81. auto n = m_packets.find(command);
  82. if (n == m_packets.end())
  83. m_packets[command] = 1;
  84. else
  85. n->second++;
  86. }
  87. void clear()
  88. {
  89. m_packets.clear();
  90. }
  91. u32 sum() const;
  92. void print(std::ostream &o) const;
  93. private:
  94. // command, count
  95. std::map<u16, u32> m_packets;
  96. };
  97. class ClientScripting;
  98. class GameUI;
  99. class Client : public con::PeerHandler, public InventoryManager, public IGameDef
  100. {
  101. public:
  102. /*
  103. NOTE: Nothing is thread-safe here.
  104. */
  105. Client(
  106. const char *playername,
  107. const std::string &password,
  108. MapDrawControl &control,
  109. IWritableTextureSource *tsrc,
  110. IWritableShaderSource *shsrc,
  111. IWritableItemDefManager *itemdef,
  112. NodeDefManager *nodedef,
  113. ISoundManager *sound,
  114. MtEventManager *event,
  115. RenderingEngine *rendering_engine,
  116. GameUI *game_ui,
  117. ELoginRegister allow_login_or_register
  118. );
  119. ~Client();
  120. DISABLE_CLASS_COPY(Client);
  121. // Load local mods into memory
  122. void scanModSubfolder(const std::string &mod_name, const std::string &mod_path,
  123. std::string mod_subpath);
  124. inline void scanModIntoMemory(const std::string &mod_name, const std::string &mod_path)
  125. {
  126. scanModSubfolder(mod_name, mod_path, "");
  127. }
  128. /*
  129. request all threads managed by client to be stopped
  130. */
  131. void Stop();
  132. bool isShutdown();
  133. void connect(const Address &address, const std::string &address_name,
  134. bool is_local_server);
  135. /*
  136. Stuff that references the environment is valid only as
  137. long as this is not called. (eg. Players)
  138. If this throws a PeerNotFoundException, the connection has
  139. timed out.
  140. */
  141. void step(float dtime);
  142. /*
  143. * Command Handlers
  144. */
  145. void handleCommand(NetworkPacket* pkt);
  146. void handleCommand_Null(NetworkPacket* pkt) {};
  147. void handleCommand_Deprecated(NetworkPacket* pkt);
  148. void handleCommand_Hello(NetworkPacket* pkt);
  149. void handleCommand_AuthAccept(NetworkPacket* pkt);
  150. void handleCommand_AcceptSudoMode(NetworkPacket* pkt);
  151. void handleCommand_DenySudoMode(NetworkPacket* pkt);
  152. void handleCommand_AccessDenied(NetworkPacket* pkt);
  153. void handleCommand_RemoveNode(NetworkPacket* pkt);
  154. void handleCommand_AddNode(NetworkPacket* pkt);
  155. void handleCommand_NodemetaChanged(NetworkPacket *pkt);
  156. void handleCommand_BlockData(NetworkPacket* pkt);
  157. void handleCommand_Inventory(NetworkPacket* pkt);
  158. void handleCommand_TimeOfDay(NetworkPacket* pkt);
  159. void handleCommand_ChatMessage(NetworkPacket *pkt);
  160. void handleCommand_ActiveObjectRemoveAdd(NetworkPacket* pkt);
  161. void handleCommand_ActiveObjectMessages(NetworkPacket* pkt);
  162. void handleCommand_Movement(NetworkPacket* pkt);
  163. void handleCommand_Fov(NetworkPacket *pkt);
  164. void handleCommand_HP(NetworkPacket* pkt);
  165. void handleCommand_Breath(NetworkPacket* pkt);
  166. void handleCommand_MovePlayer(NetworkPacket* pkt);
  167. void handleCommand_MovePlayerRel(NetworkPacket* pkt);
  168. void handleCommand_DeathScreen(NetworkPacket* pkt);
  169. void handleCommand_AnnounceMedia(NetworkPacket* pkt);
  170. void handleCommand_Media(NetworkPacket* pkt);
  171. void handleCommand_NodeDef(NetworkPacket* pkt);
  172. void handleCommand_ItemDef(NetworkPacket* pkt);
  173. void handleCommand_PlaySound(NetworkPacket* pkt);
  174. void handleCommand_StopSound(NetworkPacket* pkt);
  175. void handleCommand_FadeSound(NetworkPacket *pkt);
  176. void handleCommand_Privileges(NetworkPacket* pkt);
  177. void handleCommand_InventoryFormSpec(NetworkPacket* pkt);
  178. void handleCommand_DetachedInventory(NetworkPacket* pkt);
  179. void handleCommand_ShowFormSpec(NetworkPacket* pkt);
  180. void handleCommand_SpawnParticle(NetworkPacket* pkt);
  181. void handleCommand_AddParticleSpawner(NetworkPacket* pkt);
  182. void handleCommand_DeleteParticleSpawner(NetworkPacket* pkt);
  183. void handleCommand_HudAdd(NetworkPacket* pkt);
  184. void handleCommand_HudRemove(NetworkPacket* pkt);
  185. void handleCommand_HudChange(NetworkPacket* pkt);
  186. void handleCommand_HudSetFlags(NetworkPacket* pkt);
  187. void handleCommand_HudSetParam(NetworkPacket* pkt);
  188. void handleCommand_HudSetSky(NetworkPacket* pkt);
  189. void handleCommand_HudSetSun(NetworkPacket* pkt);
  190. void handleCommand_HudSetMoon(NetworkPacket* pkt);
  191. void handleCommand_HudSetStars(NetworkPacket* pkt);
  192. void handleCommand_CloudParams(NetworkPacket* pkt);
  193. void handleCommand_OverrideDayNightRatio(NetworkPacket* pkt);
  194. void handleCommand_LocalPlayerAnimations(NetworkPacket* pkt);
  195. void handleCommand_EyeOffset(NetworkPacket* pkt);
  196. void handleCommand_UpdatePlayerList(NetworkPacket* pkt);
  197. void handleCommand_ModChannelMsg(NetworkPacket *pkt);
  198. void handleCommand_ModChannelSignal(NetworkPacket *pkt);
  199. void handleCommand_SrpBytesSandB(NetworkPacket *pkt);
  200. void handleCommand_FormspecPrepend(NetworkPacket *pkt);
  201. void handleCommand_CSMRestrictionFlags(NetworkPacket *pkt);
  202. void handleCommand_PlayerSpeed(NetworkPacket *pkt);
  203. void handleCommand_MediaPush(NetworkPacket *pkt);
  204. void handleCommand_MinimapModes(NetworkPacket *pkt);
  205. void handleCommand_SetLighting(NetworkPacket *pkt);
  206. void ProcessData(NetworkPacket *pkt);
  207. void Send(NetworkPacket* pkt);
  208. void interact(InteractAction action, const PointedThing &pointed);
  209. void sendNodemetaFields(v3s16 p, const std::string &formname,
  210. const StringMap &fields);
  211. void sendInventoryFields(const std::string &formname,
  212. const StringMap &fields);
  213. void sendInventoryAction(InventoryAction *a);
  214. void sendChatMessage(const std::wstring &message);
  215. void clearOutChatQueue();
  216. void sendChangePassword(const std::string &oldpassword,
  217. const std::string &newpassword);
  218. void sendDamage(u16 damage);
  219. void sendRespawn();
  220. void sendReady();
  221. void sendHaveMedia(const std::vector<u32> &tokens);
  222. void sendUpdateClientInfo(const ClientDynamicInfo &info);
  223. ClientEnvironment& getEnv() { return m_env; }
  224. ITextureSource *tsrc() { return getTextureSource(); }
  225. ISoundManager *sound() { return getSoundManager(); }
  226. static const std::string &getBuiltinLuaPath();
  227. static const std::string &getClientModsLuaPath();
  228. const std::vector<ModSpec> &getMods() const override;
  229. const ModSpec* getModSpec(const std::string &modname) const override;
  230. // Causes urgent mesh updates (unlike Map::add/removeNodeWithEvent)
  231. void removeNode(v3s16 p);
  232. // helpers to enforce CSM restrictions
  233. MapNode CSMGetNode(v3s16 p, bool *is_valid_position);
  234. int CSMClampRadius(v3s16 pos, int radius);
  235. v3s16 CSMClampPos(v3s16 pos);
  236. void addNode(v3s16 p, MapNode n, bool remove_metadata = true);
  237. void setPlayerControl(PlayerControl &control);
  238. // Returns true if the inventory of the local player has been
  239. // updated from the server. If it is true, it is set to false.
  240. bool updateWieldedItem();
  241. /* InventoryManager interface */
  242. Inventory* getInventory(const InventoryLocation &loc) override;
  243. void inventoryAction(InventoryAction *a) override;
  244. // Send the item number 'item' as player item to the server
  245. void setPlayerItem(u16 item);
  246. const std::set<std::string> &getConnectedPlayerNames()
  247. {
  248. return m_env.getPlayerNames();
  249. }
  250. float getAnimationTime();
  251. int getCrackLevel();
  252. v3s16 getCrackPos();
  253. void setCrack(int level, v3s16 pos);
  254. u16 getHP();
  255. bool checkPrivilege(const std::string &priv) const
  256. { return (m_privileges.count(priv) != 0); }
  257. const std::unordered_set<std::string> &getPrivilegeList() const
  258. { return m_privileges; }
  259. bool getChatMessage(std::wstring &message);
  260. void typeChatMessage(const std::wstring& message);
  261. u64 getMapSeed(){ return m_map_seed; }
  262. void addUpdateMeshTask(v3s16 blockpos, bool ack_to_server=false, bool urgent=false);
  263. // Including blocks at appropriate edges
  264. void addUpdateMeshTaskWithEdge(v3s16 blockpos, bool ack_to_server=false, bool urgent=false);
  265. void addUpdateMeshTaskForNode(v3s16 nodepos, bool ack_to_server=false, bool urgent=false);
  266. void updateCameraOffset(v3s16 camera_offset);
  267. bool hasClientEvents() const { return !m_client_event_queue.empty(); }
  268. // Get event from queue. If queue is empty, it triggers an assertion failure.
  269. ClientEvent * getClientEvent();
  270. bool accessDenied() const { return m_access_denied; }
  271. bool reconnectRequested() const { return m_access_denied_reconnect; }
  272. void setFatalError(const std::string &reason)
  273. {
  274. m_access_denied = true;
  275. m_access_denied_reason = reason;
  276. }
  277. inline void setFatalError(const LuaError &e)
  278. {
  279. setFatalError(std::string("Lua: ") + e.what());
  280. }
  281. // Renaming accessDeniedReason to better name could be good as it's used to
  282. // disconnect client when CSM failed.
  283. const std::string &accessDeniedReason() const { return m_access_denied_reason; }
  284. bool itemdefReceived() const
  285. { return m_itemdef_received; }
  286. bool nodedefReceived() const
  287. { return m_nodedef_received; }
  288. bool mediaReceived() const
  289. { return !m_media_downloader; }
  290. bool activeObjectsReceived() const
  291. { return m_activeobjects_received; }
  292. u16 getProtoVersion() const
  293. { return m_proto_ver; }
  294. bool m_simple_singleplayer_mode;
  295. float mediaReceiveProgress();
  296. void afterContentReceived();
  297. void showUpdateProgressTexture(void *args, u32 progress, u32 max_progress);
  298. float getRTT();
  299. float getCurRate();
  300. // has the server ever replied to us, used for connection retry/fallback
  301. bool hasServerReplied() const {
  302. return getProtoVersion() != 0; // (set in TOCLIENT_HELLO)
  303. }
  304. Minimap* getMinimap() { return m_minimap; }
  305. void setCamera(Camera* camera) { m_camera = camera; }
  306. Camera* getCamera () { return m_camera; }
  307. scene::ISceneManager *getSceneManager();
  308. // IGameDef interface
  309. IItemDefManager* getItemDefManager() override;
  310. const NodeDefManager* getNodeDefManager() override;
  311. ICraftDefManager* getCraftDefManager() override;
  312. ITextureSource* getTextureSource();
  313. virtual IWritableShaderSource* getShaderSource();
  314. u16 allocateUnknownNodeId(const std::string &name) override;
  315. virtual ISoundManager* getSoundManager();
  316. MtEventManager* getEventManager();
  317. virtual ParticleManager* getParticleManager();
  318. bool checkLocalPrivilege(const std::string &priv)
  319. { return checkPrivilege(priv); }
  320. virtual scene::IAnimatedMesh* getMesh(const std::string &filename, bool cache = false);
  321. const std::string* getModFile(std::string filename);
  322. ModStorageDatabase *getModStorageDatabase() override { return m_mod_storage_database; }
  323. // Migrates away old files-based mod storage if necessary
  324. void migrateModStorage();
  325. // The following set of functions is used by ClientMediaDownloader
  326. // Insert a media file appropriately into the appropriate manager
  327. bool loadMedia(const std::string &data, const std::string &filename,
  328. bool from_media_push = false);
  329. // Send a request for conventional media transfer
  330. void request_media(const std::vector<std::string> &file_requests);
  331. LocalClientState getState() { return m_state; }
  332. void makeScreenshot();
  333. inline void pushToChatQueue(ChatMessage *cec)
  334. {
  335. m_chat_queue.push(cec);
  336. }
  337. ClientScripting *getScript() { return m_script; }
  338. bool modsLoaded() const { return m_mods_loaded; }
  339. void pushToEventQueue(ClientEvent *event);
  340. // IP and port we're connected to
  341. const Address getServerAddress();
  342. // Hostname of the connected server (but can also be a numerical IP)
  343. const std::string &getAddressName() const
  344. {
  345. return m_address_name;
  346. }
  347. inline u64 getCSMRestrictionFlags() const
  348. {
  349. return m_csm_restriction_flags;
  350. }
  351. inline bool checkCSMRestrictionFlag(CSMRestrictionFlags flag) const
  352. {
  353. return m_csm_restriction_flags & flag;
  354. }
  355. bool joinModChannel(const std::string &channel) override;
  356. bool leaveModChannel(const std::string &channel) override;
  357. bool sendModChannelMessage(const std::string &channel,
  358. const std::string &message) override;
  359. ModChannel *getModChannel(const std::string &channel) override;
  360. const std::string &getFormspecPrepend() const;
  361. inline MeshGrid getMeshGrid()
  362. {
  363. return m_mesh_grid;
  364. }
  365. bool inhibit_inventory_revert = false;
  366. private:
  367. void loadMods();
  368. // Virtual methods from con::PeerHandler
  369. void peerAdded(con::Peer *peer) override;
  370. void deletingPeer(con::Peer *peer, bool timeout) override;
  371. void initLocalMapSaving(const Address &address,
  372. const std::string &hostname,
  373. bool is_local_server);
  374. void ReceiveAll();
  375. void sendPlayerPos();
  376. void deleteAuthData();
  377. // helper method shared with clientpackethandler
  378. static AuthMechanism choseAuthMech(const u32 mechs);
  379. void sendInit(const std::string &playerName);
  380. void startAuth(AuthMechanism chosen_auth_mechanism);
  381. void sendDeletedBlocks(std::vector<v3s16> &blocks);
  382. void sendGotBlocks(const std::vector<v3s16> &blocks);
  383. void sendRemovedSounds(const std::vector<s32> &soundList);
  384. bool canSendChatMessage() const;
  385. // remove sounds attached to object
  386. void removeActiveObjectSounds(u16 id);
  387. float m_packetcounter_timer = 0.0f;
  388. float m_connection_reinit_timer = 0.1f;
  389. float m_avg_rtt_timer = 0.0f;
  390. float m_playerpos_send_timer = 0.0f;
  391. IntervalLimiter m_map_timer_and_unload_interval;
  392. IWritableTextureSource *m_tsrc;
  393. IWritableShaderSource *m_shsrc;
  394. IWritableItemDefManager *m_itemdef;
  395. NodeDefManager *m_nodedef;
  396. ISoundManager *m_sound;
  397. MtEventManager *m_event;
  398. RenderingEngine *m_rendering_engine;
  399. std::unique_ptr<MeshUpdateManager> m_mesh_update_manager;
  400. ClientEnvironment m_env;
  401. std::unique_ptr<ParticleManager> m_particle_manager;
  402. std::unique_ptr<con::Connection> m_con;
  403. std::string m_address_name;
  404. ELoginRegister m_allow_login_or_register = ELoginRegister::Any;
  405. Camera *m_camera = nullptr;
  406. Minimap *m_minimap = nullptr;
  407. // Server serialization version
  408. u8 m_server_ser_ver;
  409. // Used version of the protocol with server
  410. // Values smaller than 25 only mean they are smaller than 25,
  411. // and aren't accurate. We simply just don't know, because
  412. // the server didn't send the version back then.
  413. // If 0, server init hasn't been received yet.
  414. u16 m_proto_ver = 0;
  415. bool m_update_wielded_item = false;
  416. Inventory *m_inventory_from_server = nullptr;
  417. float m_inventory_from_server_age = 0.0f;
  418. PacketCounter m_packetcounter;
  419. // Block mesh animation parameters
  420. float m_animation_time = 0.0f;
  421. int m_crack_level = -1;
  422. v3s16 m_crack_pos;
  423. // 0 <= m_daynight_i < DAYNIGHT_CACHE_COUNT
  424. //s32 m_daynight_i;
  425. //u32 m_daynight_ratio;
  426. std::queue<std::wstring> m_out_chat_queue;
  427. u32 m_last_chat_message_sent;
  428. float m_chat_message_allowance = 5.0f;
  429. std::queue<ChatMessage *> m_chat_queue;
  430. // The authentication methods we can use to enter sudo mode (=change password)
  431. u32 m_sudo_auth_methods;
  432. // The seed returned by the server in TOCLIENT_INIT is stored here
  433. u64 m_map_seed = 0;
  434. // Auth data
  435. std::string m_playername;
  436. std::string m_password;
  437. // If set, this will be sent (and cleared) upon a TOCLIENT_ACCEPT_SUDO_MODE
  438. std::string m_new_password;
  439. // Usable by auth mechanisms.
  440. AuthMechanism m_chosen_auth_mech;
  441. void *m_auth_data = nullptr;
  442. bool m_access_denied = false;
  443. bool m_access_denied_reconnect = false;
  444. std::string m_access_denied_reason = "";
  445. std::queue<ClientEvent *> m_client_event_queue;
  446. bool m_itemdef_received = false;
  447. bool m_nodedef_received = false;
  448. bool m_activeobjects_received = false;
  449. bool m_mods_loaded = false;
  450. std::vector<std::string> m_remote_media_servers;
  451. // Media downloader, only exists during init
  452. ClientMediaDownloader *m_media_downloader;
  453. // Pending downloads of dynamic media (key: token)
  454. std::vector<std::pair<u32, std::shared_ptr<SingleMediaDownloader>>> m_pending_media_downloads;
  455. // time_of_day speed approximation for old protocol
  456. bool m_time_of_day_set = false;
  457. float m_last_time_of_day_f = -1.0f;
  458. float m_time_of_day_update_timer = 0.0f;
  459. // An interval for generally sending object positions and stuff
  460. float m_recommended_send_interval = 0.1f;
  461. // Sounds
  462. float m_removed_sounds_check_timer = 0.0f;
  463. // Mapping from server sound ids to our sound ids
  464. std::unordered_map<s32, sound_handle_t> m_sounds_server_to_client;
  465. // And the other way!
  466. // This takes ownership for the sound handles.
  467. std::unordered_map<sound_handle_t, s32> m_sounds_client_to_server;
  468. // Relation of client id to object id
  469. std::unordered_map<sound_handle_t, u16> m_sounds_to_objects;
  470. // Privileges
  471. std::unordered_set<std::string> m_privileges;
  472. // Detached inventories
  473. // key = name
  474. std::unordered_map<std::string, Inventory*> m_detached_inventories;
  475. // Storage for mesh data for creating multiple instances of the same mesh
  476. StringMap m_mesh_data;
  477. // own state
  478. LocalClientState m_state;
  479. GameUI *m_game_ui;
  480. // Used for saving server map to disk client-side
  481. MapDatabase *m_localdb = nullptr;
  482. IntervalLimiter m_localdb_save_interval;
  483. u16 m_cache_save_interval;
  484. // Client modding
  485. ClientScripting *m_script = nullptr;
  486. ModStorageDatabase *m_mod_storage_database = nullptr;
  487. float m_mod_storage_save_timer = 10.0f;
  488. std::vector<ModSpec> m_mods;
  489. StringMap m_mod_vfs;
  490. bool m_shutdown = false;
  491. // CSM restrictions byteflag
  492. u64 m_csm_restriction_flags = CSMRestrictionFlags::CSM_RF_NONE;
  493. u32 m_csm_restriction_noderange = 8;
  494. std::unique_ptr<ModChannelMgr> m_modchannel_mgr;
  495. // The number of blocks the client will combine for mesh generation.
  496. MeshGrid m_mesh_grid;
  497. };