From 3de176cc587c4e0601c3c3f5a049e30db6bd2c17 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Wed, 22 Dec 2010 16:30:23 +0200 Subject: crafting system! --- src/client.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/client.cpp') 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 data((u8*)s.c_str(), s.size()); + // Send as reliable + Send(0, data, true); +} void Client::sendPlayerPos() { -- cgit v1.2.3