Fixed sprinting in 1.6.1, made speeds available through API; fixed messages containing quotes.
Fixes FS #415 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1660 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -74,7 +74,7 @@ void cProtocol161::SendAttachEntity(const cEntity & a_Entity, const cEntity * a_
|
||||
|
||||
void cProtocol161::SendChat(const AString & a_Message)
|
||||
{
|
||||
super::SendChat(Printf("{\"text\":\"%s\"}", a_Message.c_str()));
|
||||
super::SendChat(Printf("{\"text\":\"%s\"}", EscapeString(a_Message).c_str()));
|
||||
}
|
||||
|
||||
|
||||
@@ -83,15 +83,7 @@ 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();
|
||||
SendPlayerMaxSpeed();
|
||||
}
|
||||
|
||||
|
||||
@@ -112,6 +104,21 @@ void cProtocol161::SendHealth(void)
|
||||
|
||||
|
||||
|
||||
void cProtocol161::SendPlayerMaxSpeed(void)
|
||||
{
|
||||
cCSLock Lock(m_CSPacket);
|
||||
WriteByte(PACKET_ENTITY_PROPERTIES);
|
||||
WriteInt(m_Client->GetPlayer()->GetUniqueID());
|
||||
WriteInt(1);
|
||||
WriteString("generic.movementSpeed");
|
||||
WriteDouble(m_Client->GetPlayer()->GetMaxSpeed());
|
||||
Flush();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cProtocol161::SendWindowOpen(char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots)
|
||||
{
|
||||
if (a_WindowType < 0)
|
||||
|
||||
Reference in New Issue
Block a user