Typo in getOutgoingSequenceNumber => successfull to successful
[oweals/minetest.git] / src / network / serverpackethandler.cpp
index 97e46c515d75f0d74f0515fbd7017f75da3812f2..e01aeaa55e0d36b2058f884528a6be84fb533dae 100644 (file)
@@ -388,7 +388,7 @@ void Server::handleCommand_Init_Legacy(NetworkPacket* pkt)
                DenyAccess_Legacy(pkt->getPeerId(), std::wstring(
                                L"Your client's version is not supported.\n"
                                L"Server version is ")
-                               + narrow_to_wide(minetest_version_simple) + L"."
+                               + narrow_to_wide(g_version_string) + L"."
                );
                return;
        }
@@ -436,7 +436,7 @@ void Server::handleCommand_Init_Legacy(NetworkPacket* pkt)
                DenyAccess_Legacy(pkt->getPeerId(), std::wstring(
                                L"Your client's version is not supported.\n"
                                L"Server version is ")
-                               + narrow_to_wide(minetest_version_simple) + L",\n"
+                               + narrow_to_wide(g_version_string) + L",\n"
                                + L"server's PROTOCOL_VERSION is "
                                + narrow_to_wide(itos(SERVER_PROTOCOL_VERSION_MIN))
                                + L"..."
@@ -456,7 +456,7 @@ void Server::handleCommand_Init_Legacy(NetworkPacket* pkt)
                        DenyAccess_Legacy(pkt->getPeerId(), std::wstring(
                                        L"Your client's version is not supported.\n"
                                        L"Server version is ")
-                                       + narrow_to_wide(minetest_version_simple) + L",\n"
+                                       + narrow_to_wide(g_version_string) + L",\n"
                                        + L"server's PROTOCOL_VERSION (strict) is "
                                        + narrow_to_wide(itos(LATEST_PROTOCOL_VERSION))
                                        + L", client's PROTOCOL_VERSION is "
@@ -952,8 +952,8 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
                ma->from_inv.applyCurrentPlayer(player->getName());
                ma->to_inv.applyCurrentPlayer(player->getName());
 
-               setInventoryModified(ma->from_inv);
-               setInventoryModified(ma->to_inv);
+               setInventoryModified(ma->from_inv, false);
+               setInventoryModified(ma->to_inv, false);
 
                bool from_inv_is_current_player =
                        (ma->from_inv.type == InventoryLocation::PLAYER) &&
@@ -1006,7 +1006,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
 
                da->from_inv.applyCurrentPlayer(player->getName());
 
-               setInventoryModified(da->from_inv);
+               setInventoryModified(da->from_inv, false);
 
                /*
                        Disable dropping items out of craftpreview
@@ -1033,7 +1033,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
 
                ca->craft_inv.applyCurrentPlayer(player->getName());
 
-               setInventoryModified(ca->craft_inv);
+               setInventoryModified(ca->craft_inv, false);
 
                //bool craft_inv_is_current_player =
                //      (ca->craft_inv.type == InventoryLocation::PLAYER) &&
@@ -1052,6 +1052,8 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
        a->apply(this, playersao, this);
        // Eat the action
        delete a;
+
+       SendInventory(playersao);
 }
 
 void Server::handleCommand_ChatMessage(NetworkPacket* pkt)
@@ -1724,7 +1726,9 @@ void Server::handleCommand_Interact(NetworkPacket* pkt)
                if (m_script->item_OnUse(
                                item, playersao, pointed)) {
                        // Apply returned ItemStack
-                       playersao->setWieldedItem(item);
+                       if (playersao->setWieldedItem(item)) {
+                               SendInventory(playersao);
+                       }
                }
 
        } // action == 4