aboutsummaryrefslogtreecommitdiff
path: root/src/network/clientopcodes.cpp
blob: 3364de8c5340571ac727093f377db24caba2103e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2015 nerzhul, Loic Blot <loic.blot@unix-experience.fr>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "clientopcodes.h"

const static ToClientCommandHandler null_command_handler = {"TOCLIENT_NULL", TOCLIENT_STATE_ALL, &Client::handleCommand_Null};

const ToClientCommandHandler toClientCommandTable[TOCLIENT_NUM_MSG_TYPES] =
{
	null_command_handler, // 0x00 (never use this)
	null_command_handler, // 0x01
	{ "TOCLIENT_HELLO",                   TOCLIENT_STATE_NOT_CONNECTED, &Client::handleCommand_Hello }, // 0x02
	{ "TOCLIENT_AUTH_ACCEPT",             TOCLIENT_STATE_NOT_CONNECTED, &Client::handleCommand_AuthAccept }, // 0x03
	{ "TOCLIENT_ACCEPT_SUDO_MODE",        TOCLIENT_STATE_CONNECTED, &Client::handleCommand_AcceptSudoMode}, // 0x04
	{ "TOCLIENT_DENY_SUDO_MODE",          TOCLIENT_STATE_CONNECTED, &Client::handleCommand_DenySudoMode}, // 0x05
	null_command_handler, // 0x06
	null_command_handler, // 0x07
	null_command_handler, // 0x08
	null_command_handler, // 0x09
	{ "TOCLIENT_ACCESS_DENIED",           TOCLIENT_STATE_NOT_CONNECTED, &Client::handleCommand_AccessDenied }, // 0x0A
	null_command_handler, // 0x0B
	null_command_handler, // 0x0C
	null_command_handler, // 0x0D
	null_command_handler, // 0x0E
	null_command_handler, // 0x0F
	{ "TOCLIENT_INIT",                    TOCLIENT_STATE_NOT_CONNECTED, &Client::handleCommand_InitLegacy }, // 0x10
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	{ "TOCLIENT_BLOCKDATA",                TOCLIENT_STATE_CONNECTED, &Client::handleCommand_BlockData }, // 0x20
	{ "TOCLIENT_ADDNODE",                  TOCLIENT_STATE_CONNECTED, &Client::handleCommand_AddNode }, // 0x21
	{ "TOCLIENT_REMOVENODE",               TOCLIENT_STATE_CONNECTED, &Client::handleCommand_RemoveNode }, // 0x22
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	{ "TOCLIENT_INVENTORY",                TOCLIENT_STATE_CONNECTED, &Client::handleCommand_Inventory }, // 0x27
	null_command_handler,
	{ "TOCLIENT_TIME_OF_DAY",              TOCLIENT_STATE_CONNECTED, &Client::handleCommand_TimeOfDay }, // 0x29
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	{ "TOCLIENT_CHAT_MESSAGE",             TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ChatMessage }, // 0x30
	{ "TOCLIENT_ACTIVE_OBJECT_REMOVE_ADD", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ActiveObjectRemoveAdd }, // 0x31
	{ "TOCLIENT_ACTIVE_OBJECT_MESSAGES",   TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ActiveObjectMessages }, // 0x32
	{ "TOCLIENT_HP",                       TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HP }, // 0x33
	{ "TOCLIENT_MOVE_PLAYER",              TOCLIENT_STATE_CONNECTED, &Client::handleCommand_MovePlayer }, // 0x34
	{ "TOCLIENT_ACCESS_DENIED_LEGACY",     TOCLIENT_STATE_NOT_CONNECTED, &Client::handleCommand_AccessDenied }, // 0x35
	{ "TOCLIENT_PLAYERITEM",               TOCLIENT_STATE_CONNECTED, &Client::handleCommand_PlayerItem }, // 0x36
	{ "TOCLIENT_DEATHSCREEN",              TOCLIENT_STATE_CONNECTED, &Client::handleCommand_DeathScreen }, // 0x37
	{ "TOCLIENT_MEDIA",                    TOCLIENT_STATE_CONNECTED, &Client::handleCommand_Media }, // 0x38
	{ "TOCLIENT_TOOLDEF",                  TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ToolDef }, // 0x39
	{ "TOCLIENT_NODEDEF",                  TOCLIENT_STATE_CONNECTED, &Client::handleCommand_NodeDef }, // 0x3a
	{ "TOCLIENT_CRAFTITEMDEF",             TOCLIENT_STATE_CONNECTED, &Client::handleCommand_CraftItemDef }, // 0x3b
	{ "TOCLIENT_ANNOUNCE_MEDIA",           TOCLIENT_STATE_CONNECTED, &Client::handleCommand_AnnounceMedia }, // 0x3c
	{ "TOCLIENT_ITEMDEF",                  TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ItemDef }, // 0x3d
	null_command_handler,
	{ "TOCLIENT_PLAY_SOUND",               TOCLIENT_STATE_CONNECTED, &Client::handleCommand_PlaySound }, // 0x3f
	{ "TOCLIENT_STOP_SOUND",               TOCLIENT_STATE_CONNECTED, &Client::handleCommand_StopSound }, // 0x40
	{ "TOCLIENT_PRIVILEGES",               TOCLIENT_STATE_CONNECTED, &Client::handleCommand_Privileges }, // 0x41
	{ "TOCLIENT_INVENTORY_FORMSPEC",       TOCLIENT_STATE_CONNECTED, &Client::handleCommand_InventoryFormSpec }, // 0x42
	{ "TOCLIENT_DETACHED_INVENTORY",       TOCLIENT_STATE_CONNECTED, &Client::handleCommand_DetachedInventory }, // 0x43
	{ "TOCLIENT_SHOW_FORMSPEC",            TOCLIENT_STATE_CONNECTED, &Client::handleCommand_ShowFormSpec }, // 0x44
	{ "TOCLIENT_MOVEMENT",                 TOCLIENT_STATE_CONNECTED, &Client::handleCommand_Movement }, // 0x45
	{ "TOCLIENT_SPAWN_PARTICLE",           TOCLIENT_STATE_CONNECTED, &Client::handleCommand_SpawnParticle }, // 0x46
	{ "TOCLIENT_ADD_PARTICLESPAWNER",      TOCLIENT_STATE_CONNECTED, &Client::handleCommand_AddParticleSpawner }, // 0x47
	{ "TOCLIENT_DELETE_PARTICLESPAWNER_LEGACY",   TOCLIENT_STATE_CONNECTED, &Client::handleCommand_DeleteParticleSpawner }, // 0x48
	{ "TOCLIENT_HUDADD",                   TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HudAdd }, // 0x49
	{ "TOCLIENT_HUDRM",                    TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HudRemove }, // 0x4a
	{ "TOCLIENT_HUDCHANGE",                TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HudChange }, // 0x4b
	{ "TOCLIENT_HUD_SET_FLAGS",            TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HudSetFlags }, // 0x4c
	{ "TOCLIENT_HUD_SET_PARAM",            TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HudSetParam }, // 0x4d
	{ "TOCLIENT_BREATH",                   TOCLIENT_STATE_CONNECTED, &Client::handleCommand_Breath }, // 0x4e
	{ "TOCLIENT_SET_SKY",                  TOCLIENT_STATE_CONNECTED, &Client::handleCommand_HudSetSky }, // 0x4f
	{ "TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO", TOCLIENT_STATE_CONNECTED, &Client::handleCommand_OverrideDayNightRatio }, // 0x50
	{ "TOCLIENT_LOCAL_PLAYER_ANIMATIONS",  TOCLIENT_STATE_CONNECTED, &Client::handleCommand_LocalPlayerAnimations }, // 0x51
	{ "TOCLIENT_EYE_OFFSET",               TOCLIENT_STATE_CONNECTED, &Client::handleCommand_EyeOffset }, // 0x52
	{ "TOCLIENT_DELETE_PARTICLESPAWNER",   TOCLIENT_STATE_CONNECTED, &Client::handleCommand_DeleteParticleSpawner }, // 0x53
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	null_command_handler,
	{ "TOCLIENT_SRP_BYTES_S_B",            TOCLIENT_STATE_NOT_CONNECTED, &Client::handleCommand_SrpBytesSandB }, // 0x60
};

const static ServerCommandFactory null_command_factory = { "TOSERVER_NULL", 0, false };

const ServerCommandFactory serverCommandFactoryTable[TOSERVER_NUM_MSG_TYPES] =
{
	null_command_factory, // 0x00
	null_command_factory, // 0x01
	{ "TOSERVER_INIT",               1, false }, // 0x02
	null_command_factory, // 0x03
	null_command_factory, // 0x04
	null_command_factory, // 0x05
	null_command_factory, // 0x06
	null_command_factory, // 0x07
	null_command_factory, // 0x08
	null_command_factory, // 0x09
	null_command_factory, // 0x0a
	null_command_factory, // 0x0b
	null_command_factory, // 0x0c
	null_command_factory, // 0x0d
	null_command_factory, // 0x0e
	null_command_factory, // 0x0F
	{ "TOSERVER_INIT_LEGACY",        1, false }, // 0x10
	{ "TOSERVER_INIT2",              1, true }, // 0x11
	null_command_factory, // 0x12
	null_command_factory, // 0x13
	null_command_factory, // 0x14
	null_command_factory, // 0x15
	null_command_factory, // 0x16
	null_command_factory, // 0x17
	null_command_factory, // 0x18
	null_command_factory, // 0x19
	null_command_factory, // 0x1a
	null_command_factory, // 0x1b
	null_command_factory, // 0x1c
	null_command_factory, // 0x1d
	null_command_factory, // 0x1e
	null_command_factory, // 0x1f
	null_command_factory, // 0x20
	null_command_factory, // 0x21
	null_command_factory, // 0x22
	{ "TOSERVER_PLAYERPOS",          0, false }, // 0x23
	{ "TOSERVER_GOTBLOCKS",          2, true }, // 0x24
	{ "TOSERVER_DELETEDBLOCKS",      2, true }, // 0x25
	null_command_factory, // 0x26
	{ "TOSERVER_CLICK_OBJECT",       0, false }, // 0x27
	{ "TOSERVER_GROUND_ACTION",      0, false }, // 0x28
	{ "TOSERVER_RELEASE",            0, false }, // 0x29
	null_command_factory, // 0x2a
	null_command_factory, // 0x2b
	null_command_factory, // 0x2c
	null_command_factory, // 0x2d
	null_command_factory, // 0x2e
	null_command_factory, // 0x2f
	{ "TOSERVER_SIGNTEXT",           0, false }, // 0x30
	{ "TOSERVER_INVENTORY_ACTION",   0, true }, // 0x31
	{ "TOSERVER_CHAT_MESSAGE",       0, true }, // 0x32
	{ "TOSERVER_SIGNNODETEXT",       0, false }, // 0x33
	{ "TOSERVER_CLICK_ACTIVEOBJECT", 0, false }, // 0x34
	{ "TOSERVER_DAMAGE",             0, true }, // 0x35
	{ "TOSERVER_PASSWORD_LEGACY",    0, true }, // 0x36
	{ "TOSERVER_PLAYERITEM",         0, true }, // 0x37
	{ "TOSERVER_RESPAWN",            0, true }, // 0x38
	{ "TOSERVER_INTERACT",           0, true }, // 0x39
	{ "TOSERVER_REMOVED_SOUNDS",     1, true }, // 0x3a
	{ "TOSERVER_NODEMETA_FIELDS",    0, true }, // 0x3b
	{ "TOSERVER_INVENTORY_FIELDS",   0, true }, // 0x3c
	null_command_factory, // 0x3d
	null_command_factory, // 0x3e
	null_command_factory, // 0x3f
	{ "TOSERVER_REQUEST_MEDIA",      1, true }, // 0x40
	{ "TOSERVER_RECEIVED_MEDIA",     1, true }, // 0x41
	{ "TOSERVER_BREATH",             0, true }, // 0x42
	{ "TOSERVER_CLIENT_READY",       0, true }, // 0x43
	null_command_factory, // 0x44
	null_command_factory, // 0x45
	null_command_factory, // 0x46
	null_command_factory, // 0x47
	null_command_factory, // 0x48
	null_command_factory, // 0x49
	null_command_factory, // 0x4a
	null_command_factory, // 0x4b
	null_command_factory, // 0x4c
	null_command_factory, // 0x4d
	null_command_factory, // 0x4e
	null_command_factory, // 0x4f
	{ "TOSERVER_FIRST_SRP",          1, true }, // 0x50
	{ "TOSERVER_SRP_BYTES_A",        1, true }, // 0x51
	{ "TOSERVER_SRP_BYTES_M",        1, true }, // 0x52
};
lArea b(min, max); if(b.getVolume() != 0) result.push_back(b); } // Take bottom area, X inclusive { v3s16 min(MinEdge.X, MinEdge.Y, a.MinEdge.Z); v3s16 max(MaxEdge.X, a.MinEdge.Y-1, a.MaxEdge.Z); VoxelArea b(min, max); if(b.getVolume() != 0) result.push_back(b); } // Take left area, non-inclusive { v3s16 min(MinEdge.X, a.MinEdge.Y, a.MinEdge.Z); v3s16 max(a.MinEdge.X-1, a.MaxEdge.Y, a.MaxEdge.Z); VoxelArea b(min, max); if(b.getVolume() != 0) result.push_back(b); } // Take right area, non-inclusive { v3s16 min(a.MaxEdge.X+1, a.MinEdge.Y, a.MinEdge.Z); v3s16 max(MaxEdge.X, a.MaxEdge.Y, a.MaxEdge.Z); VoxelArea b(min, max); if(b.getVolume() != 0) result.push_back(b); } } /* Translates position from virtual coordinates to array index */ s32 index(s16 x, s16 y, s16 z) const { v3s16 em = getExtent(); v3s16 off = MinEdge; s32 i = (s32)(z-off.Z)*em.Y*em.X + (y-off.Y)*em.X + (x-off.X); //dstream<<" i("<<x<<","<<y<<","<<z<<")="<<i<<" "; return i; } s32 index(v3s16 p) const { return index(p.X, p.Y, p.Z); } // Translate index in the X coordinate void add_x(const v3s16 &extent, u32 &i, s16 a) { i += a; } // Translate index in the Y coordinate void add_y(const v3s16 &extent, u32 &i, s16 a) { i += a * extent.X; } // Translate index in the Z coordinate void add_z(const v3s16 &extent, u32 &i, s16 a) { i += a * extent.X*extent.Y; } // Translate index in space void add_p(const v3s16 &extent, u32 &i, v3s16 a) { i += a.Z*extent.X*extent.Y + a.Y*extent.X + a.X; } /* Print method for debugging */ void print(std::ostream &o) const { v3s16 e = getExtent(); o<<"("<<MinEdge.X <<","<<MinEdge.Y <<","<<MinEdge.Z <<")("<<MaxEdge.X <<","<<MaxEdge.Y <<","<<MaxEdge.Z <<")" <<"="<<e.X<<"x"<<e.Y<<"x"<<e.Z<<"="<<getVolume(); } // Edges are inclusive v3s16 MinEdge; v3s16 MaxEdge; }; // Hasn't been copied from source (emerged) #define VOXELFLAG_NOT_LOADED (1<<0) // Checked as being inexistent in source #define VOXELFLAG_INEXISTENT (1<<1) // Algorithm-dependent #define VOXELFLAG_CHECKED1 (1<<2) // Algorithm-dependent #define VOXELFLAG_CHECKED2 (1<<3) // Algorithm-dependent #define VOXELFLAG_CHECKED3 (1<<4) // Algorithm-dependent #define VOXELFLAG_CHECKED4 (1<<5) enum VoxelPrintMode { VOXELPRINT_NOTHING, VOXELPRINT_MATERIAL, VOXELPRINT_WATERPRESSURE, }; class VoxelManipulator /*: public NodeContainer*/ { public: VoxelManipulator(); virtual ~VoxelManipulator(); /* Virtuals from NodeContainer */ /*virtual u16 nodeContainerId() const { return NODECONTAINER_ID_VOXELMANIPULATOR; } bool isValidPosition(v3s16 p) { emerge(p); return !(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT); }*/ /* These are a bit slow and shouldn't be used internally. Use m_data[m_area.index(p)] instead. */ MapNode getNode(v3s16 p) { emerge(p); if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT) { /*dstream<<"EXCEPT: VoxelManipulator::getNode(): " <<"p=("<<p.X<<","<<p.Y<<","<<p.Z<<")" <<", index="<<m_area.index(p) <<", flags="<<(int)m_flags[m_area.index(p)] <<" is inexistent"<<std::endl;*/ throw InvalidPositionException ("VoxelManipulator: getNode: inexistent"); } return m_data[m_area.index(p)]; } MapNode getNodeNoEx(v3s16 p) { emerge(p); if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT) { return MapNode(CONTENT_IGNORE); } return m_data[m_area.index(p)]; } MapNode getNodeNoExNoEmerge(v3s16 p) { if(m_area.contains(p) == false) return MapNode(CONTENT_IGNORE); if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT) return MapNode(CONTENT_IGNORE); return m_data[m_area.index(p)]; } MapNode & getNodeRef(v3s16 p) { emerge(p); if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT) { /*dstream<<"EXCEPT: VoxelManipulator::getNode(): " <<"p=("<<p.X<<","<<p.Y<<","<<p.Z<<")" <<", index="<<m_area.index(p) <<", flags="<<(int)m_flags[m_area.index(p)] <<" is inexistent"<<std::endl;*/ throw InvalidPositionException ("VoxelManipulator: getNode: inexistent"); } return m_data[m_area.index(p)]; } void setNode(v3s16 p, MapNode &n) { emerge(p); m_data[m_area.index(p)] = n; m_flags[m_area.index(p)] &= ~VOXELFLAG_INEXISTENT; m_flags[m_area.index(p)] &= ~VOXELFLAG_NOT_LOADED; } void setNodeNoRef(v3s16 p, MapNode n) { setNode(p, n); } /*void setExists(VoxelArea a) { emerge(a); for(s32 z=a.MinEdge.Z; z<=a.MaxEdge.Z; z++) for(s32 y=a.MinEdge.Y; y<=a.MaxEdge.Y; y++) for(s32 x=a.MinEdge.X; x<=a.MaxEdge.X; x++) { m_flags[m_area.index(x,y,z)] &= ~VOXELFLAG_INEXISTENT; } }*/ /*MapNode & operator[](v3s16 p) { //dstream<<"operator[] p=("<<p.X<<","<<p.Y<<","<<p.Z<<")"<<std::endl; if(isValidPosition(p) == false) emerge(VoxelArea(p)); return m_data[m_area.index(p)]; }*/ /* Set stuff if available without an emerge. Return false if failed. This is convenient but slower than playing around directly with the m_data table with indices. */ bool setNodeNoEmerge(v3s16 p, MapNode n) { if(m_area.contains(p) == false) return false; m_data[m_area.index(p)] = n; return true; } bool setNodeNoEmerge(s32 i, MapNode n) { if(m_area.contains(i) == false) return false; m_data[i] = n; return true; } /*bool setContentNoEmerge(v3s16 p, u8 c) { if(isValidPosition(p) == false) return false; m_data[m_area.index(p)].d = c; }*/ /* Control */ virtual void clear(); void print(std::ostream &o, INodeDefManager *nodemgr, VoxelPrintMode mode=VOXELPRINT_MATERIAL); void addArea(VoxelArea area); /* Copy data and set flags to 0 dst_area.getExtent() <= src_area.getExtent() */ void copyFrom(MapNode *src, VoxelArea src_area, v3s16 from_pos, v3s16 to_pos, v3s16 size); // Copy data void copyTo(MapNode *dst, VoxelArea dst_area, v3s16 dst_pos, v3s16 from_pos, v3s16 size); /* Algorithms */ void clearFlag(u8 flag); void unspreadLight(enum LightBank bank, v3s16 p, u8 oldlight, core::map<v3s16, bool> & light_sources, INodeDefManager *nodemgr); void unspreadLight(enum LightBank bank, core::map<v3s16, u8> & from_nodes, core::map<v3s16, bool> & light_sources, INodeDefManager *nodemgr); void spreadLight(enum LightBank bank, v3s16 p, INodeDefManager *nodemgr); void spreadLight(enum LightBank bank, core::map<v3s16, bool> & from_nodes, INodeDefManager *nodemgr); /* Virtual functions */ /* Get the contents of the requested area from somewhere. Shall touch only nodes that have VOXELFLAG_NOT_LOADED Shall reset VOXELFLAG_NOT_LOADED If not found from source, add with VOXELFLAG_INEXISTENT */ virtual void emerge(VoxelArea a, s32 caller_id=-1) { //dstream<<"emerge p=("<<p.X<<","<<p.Y<<","<<p.Z<<")"<<std::endl; addArea(a); for(s32 z=a.MinEdge.Z; z<=a.MaxEdge.Z; z++) for(s32 y=a.MinEdge.Y; y<=a.MaxEdge.Y; y++) for(s32 x=a.MinEdge.X; x<=a.MaxEdge.X; x++) { s32 i = m_area.index(x,y,z); // Don't touch nodes that have already been loaded if(!(m_flags[i] & VOXELFLAG_NOT_LOADED)) continue; m_flags[i] = VOXELFLAG_INEXISTENT; } } /* Member variables */ /* The area that is stored in m_data. addInternalBox should not be used if getExtent() == v3s16(0,0,0) MaxEdge is 1 higher than maximum allowed position */ VoxelArea m_area; /* NULL if data size is 0 (extent (0,0,0)) Data is stored as [z*h*w + y*h + x] */ MapNode *m_data; /* Flags of all nodes */ u8 *m_flags; //TODO: Use these or remove them //TODO: Would these make any speed improvement? //bool m_pressure_route_valid; //v3s16 m_pressure_route_surface; /* Some settings */ //bool m_disable_water_climb; private: }; #endif