aboutsummaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-22 16:30:23 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-22 16:30:23 +0200
commit3de176cc587c4e0601c3c3f5a049e30db6bd2c17 (patch)
tree0a85d68c29e1354acda46e0c4e46e80a6f891039 /src/client.cpp
parent2e41a5e304d9c35ece851b8a65482bca8784b582 (diff)
downloadhax-minetest-server-3de176cc587c4e0601c3c3f5a049e30db6bd2c17.tar.gz
hax-minetest-server-3de176cc587c4e0601c3c3f5a049e30db6bd2c17.zip
crafting system!
Diffstat (limited to '')
-rw-r--r--src/client.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp
index a5d035d3f..32f62e3ba 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1540,6 +1540,24 @@ void Client::sendSignText(v3s16 blockpos, s16 id, std::string text)
// Send as reliable
Send(0, data, true);
}
+
+void Client::sendInventoryAction(InventoryAction *a)
+{
+ std::ostringstream os(std::ios_base::binary);
+ u8 buf[12];
+
+ // Write command
+ writeU16(buf, TOSERVER_INVENTORY_ACTION);
+ os.write((char*)buf, 2);
+
+ a->serialize(os);
+
+ // Make data buffer
+ std::string s = os.str();
+ SharedBuffer<u8> data((u8*)s.c_str(), s.size());
+ // Send as reliable
+ Send(0, data, true);
+}
void Client::sendPlayerPos()
{