1
0

Scoreboard protocol support

This commit is contained in:
andrew
2014-01-21 15:58:17 +02:00
parent ff2302ebd5
commit aa61f55b74
17 changed files with 321 additions and 23 deletions

View File

@@ -705,6 +705,46 @@ void cProtocol172::SendExperienceOrb(const cExpOrb & a_ExpOrb)
void cProtocol172::SendScoreboardObjective(const AString & a_Name, const AString & a_DisplayName, Byte a_Mode)
{
cPacketizer Pkt(*this, 0x3b);
Pkt.WriteString(a_Name);
Pkt.WriteString(a_DisplayName);
Pkt.WriteByte(a_Mode);
}
void cProtocol172::SendScoreUpdate(const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode)
{
cPacketizer Pkt(*this, 0x3c);
Pkt.WriteString(a_Player);
Pkt.WriteByte(a_Mode);
if (a_Mode != 1)
{
Pkt.WriteString(a_Objective);
Pkt.WriteInt((int) a_Score);
}
}
void cProtocol172::SendDisplayObjective(const AString & a_Objective, cScoreboard::eDisplaySlot a_Display)
{
cPacketizer Pkt(*this, 0x3d);
Pkt.WriteByte((int) a_Display);
Pkt.WriteString(a_Objective);
}
void cProtocol172::SendSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) // a_Src coords are Block * 8
{
cPacketizer Pkt(*this, 0x29); // Sound Effect packet