aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/client.cpp2
-rw-r--r--src/environment.cpp7
-rw-r--r--src/server.cpp10
4 files changed, 17 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c479b4e73..c18bb64a7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -188,10 +188,10 @@ if(BUILD_CLIENT)
${PNG_LIBRARIES}
${X11_LIBRARIES}
${GETTEXT_LIBRARY}
- ${PLATFORM_LIBS}
- ${CLIENT_PLATFORM_LIBS}
${JTHREAD_LIBRARY}
${SQLITE3_LIBRARY}
+ ${PLATFORM_LIBS}
+ ${CLIENT_PLATFORM_LIBS}
)
endif(BUILD_CLIENT)
@@ -200,9 +200,9 @@ if(BUILD_SERVER)
target_link_libraries(
${PROJECT_NAME}server
${ZLIB_LIBRARIES}
- ${PLATFORM_LIBS}
${JTHREAD_LIBRARY}
${SQLITE3_LIBRARY}
+ ${PLATFORM_LIBS}
)
endif(BUILD_SERVER)
diff --git a/src/client.cpp b/src/client.cpp
index 2e3984bae..522fb8087 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -431,7 +431,7 @@ void Client::step(float dtime)
snprintf((char*)&data[23], PASSWORD_SIZE, "%s", m_password.c_str());
// This should be incremented in each version
- writeU16(&data[51], 1);
+ writeU16(&data[51], 2);
// Send as unreliable
Send(0, data, false);
diff --git a/src/environment.cpp b/src/environment.cpp
index 8103b7110..07c535b70 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -1345,8 +1345,6 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
i.atEnd()==false; i++)
{
ServerActiveObject* obj = i.getNode()->getValue();
- u16 id = i.getNode()->getKey();
- v3f objectpos = obj->getBasePosition();
// This shouldn't happen but check it
if(obj == NULL)
@@ -1357,9 +1355,12 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
continue;
}
+ u16 id = i.getNode()->getKey();
+ v3f objectpos = obj->getBasePosition();
+
// The block in which the object resides in
v3s16 blockpos_o = getNodeBlockPos(floatToInt(objectpos, BS));
-
+
// If block is active, don't remove
if(m_active_blocks.contains(blockpos_o))
continue;
diff --git a/src/server.cpp b/src/server.cpp
index 689a2b538..304eb8920 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2010,6 +2010,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
L"Your client is too old. Please upgrade.");
return;
}
+
+ /* Uhh... this should actually be a warning but let's do it like this */
+ if(net_proto_version < 2)
+ {
+ SendAccessDenied(m_con, peer_id,
+ L"Your client is too old. Please upgrade.");
+ return;
+ }
/*
Set up player
@@ -4141,7 +4149,7 @@ void Server::UpdateCrafting(u16 peer_id)
InventoryList *clist = player->inventory.getList("craft");
InventoryList *rlist = player->inventory.getList("craftresult");
- if(rlist->getUsedSlots() == 0)
+ if(rlist && rlist->getUsedSlots() == 0)
player->craftresult_is_preview = true;
if(rlist && player->craftresult_is_preview)