From 17486c785331e809f5294fee40367b1590e0d36b Mon Sep 17 00:00:00 2001 From: faketruth Date: Sat, 29 Sep 2012 20:43:42 +0000 Subject: Beds can be slept in now (it doesn't change the time though) git-svn-id: http://mc-server.googlecode.com/svn/trunk@911 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Protocol/Protocol125.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'source/Protocol/Protocol125.cpp') diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp index 1f2edad63..bec6a19b6 100644 --- a/source/Protocol/Protocol125.cpp +++ b/source/Protocol/Protocol125.cpp @@ -46,7 +46,7 @@ enum PACKET_BLOCK_DIG = 0x0e, PACKET_BLOCK_PLACE = 0x0f, PACKET_SLOT_SELECTED = 0x10, - PACKET_ADD_TO_INV = 0x11, // TODO: Sure this is not Use Bed?? + PACKET_USE_BED = 0x11, // TODO: Sure this is not Use Bed?? PACKET_ANIMATION = 0x12, PACKET_PACKET_ENTITY_ACTION = 0x13, PACKET_PLAYER_SPAWN = 0x14, @@ -778,6 +778,22 @@ void cProtocol125::SendWindowOpen(char a_WindowID, char a_WindowType, const AStr +void cProtocol125::SendUseBed(const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) +{ + cCSLock Lock(m_CSPacket); + WriteByte(PACKET_USE_BED); + WriteInt (a_Entity.GetUniqueID()); + WriteByte(0); // Unknown byte only 0 has been observed + WriteInt (a_BlockX); + WriteByte(a_BlockY); + WriteInt (a_BlockZ); + Flush(); +} + + + + + AString cProtocol125::GetAuthServerID(void) { // http://wiki.vg/wiki/index.php?title=Session&oldid=2262 @@ -985,7 +1001,7 @@ int cProtocol125::ParseEntityAction(void) { HANDLE_PACKET_READ(ReadBEInt, int, EntityID); HANDLE_PACKET_READ(ReadChar, char, ActionID); - // TODO: m_Client->HandleEntityAction(...); + m_Client->HandleEntityAction(EntityID, ActionID); return PARSE_OK; } -- cgit v1.2.3