1
0

Fixed 1.6.1's movement speed

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1649 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-07-05 21:02:08 +00:00
parent 1e37002528
commit b818addde4
3 changed files with 28 additions and 4 deletions

View File

@ -254,6 +254,9 @@ void cClientHandle::Authenticate(void)
// Send health
m_Player->SendHealth();
// Send gamemode (1.6.1 movementSpeed):
SendGameMode(m_Player->GetGameMode());
m_Player->Initialize(World);
StreamChunks();
m_State = csDownloadingWorld;

View File

@ -35,10 +35,12 @@ Implements the 1.6.x protocol classes:
enum
{
PACKET_CHAT = 0x03,
PACKET_UPDATE_HEALTH = 0x08,
PACKET_ATTACH_ENTITY = 0x27,
PACKET_WINDOW_OPEN = 0x64,
PACKET_CHAT = 0x03,
PACKET_UPDATE_HEALTH = 0x08,
PACKET_ATTACH_ENTITY = 0x27,
PACKET_ENTITY_PROPERTIES = 0x2c,
PACKET_WINDOW_OPEN = 0x64,
PACKET_PLAYER_ABILITIES = 0xca,
} ;
@ -77,6 +79,24 @@ void cProtocol161::SendChat(const AString & a_Message)
void cProtocol161::SendGameMode(eGameMode a_GameMode)
{
super::SendGameMode(a_GameMode);
// Also send the EntityProperties packet specifying the movementSpeed:
cCSLock Lock(m_CSPacket);
WriteByte(PACKET_ENTITY_PROPERTIES);
WriteInt(m_Client->GetPlayer()->GetUniqueID());
WriteInt(1);
WriteString("generic.movementSpeed");
WriteDouble(0.1);
Flush();
}
void cProtocol161::SendHealth(void)
{
cCSLock Lock(m_CSPacket);

View File

@ -31,6 +31,7 @@ public:
// cProtocol150 overrides:
virtual void SendAttachEntity(const cEntity & a_Entity, const cEntity * a_Vehicle) override;
virtual void SendChat (const AString & a_Message) override;
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;
virtual void SendWindowOpen (char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots) override;