summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol15x.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-01-22 18:13:12 +0100
committerTycho <work.tycho+git@gmail.com>2014-01-22 18:13:12 +0100
commitc832fbeb8e3f06849adc6bf02f2310c3f0331bc8 (patch)
treeb990d233e6d63ecc398f77354975a01bf47466c5 /src/Protocol/Protocol15x.cpp
parentActually implemented interfaces (diff)
parentMerge pull request #574 from tonibm19/patch-1 (diff)
downloadcuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar.gz
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar.bz2
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar.lz
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar.xz
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.tar.zst
cuberite-c832fbeb8e3f06849adc6bf02f2310c3f0331bc8.zip
Diffstat (limited to 'src/Protocol/Protocol15x.cpp')
-rw-r--r--src/Protocol/Protocol15x.cpp54
1 files changed, 52 insertions, 2 deletions
diff --git a/src/Protocol/Protocol15x.cpp b/src/Protocol/Protocol15x.cpp
index 0f1e59f10..c33aec7d5 100644
--- a/src/Protocol/Protocol15x.cpp
+++ b/src/Protocol/Protocol15x.cpp
@@ -35,8 +35,11 @@ Implements the 1.5.x protocol classes:
enum
{
- PACKET_WINDOW_OPEN = 0x64,
- PACKET_PARTICLE_EFFECT = 0x3F,
+ PACKET_WINDOW_OPEN = 0x64,
+ PACKET_PARTICLE_EFFECT = 0x3F,
+ PACKET_SCOREBOARD_OBJECTIVE = 0x3B,
+ PACKET_SCORE_UPDATE = 0x3C,
+ PACKET_DISPLAY_OBJECTIVE = 0x3D
} ;
@@ -97,6 +100,53 @@ void cProtocol150::SendParticleEffect(const AString & a_ParticleName, float a_Sr
+void cProtocol150::SendScoreboardObjective(const AString & a_Name, const AString & a_DisplayName, Byte a_Mode)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte(PACKET_SCOREBOARD_OBJECTIVE);
+ WriteString(a_Name);
+ WriteString(a_DisplayName);
+ WriteByte(a_Mode);
+ Flush();
+}
+
+
+
+
+
+void cProtocol150::SendScoreUpdate(const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte(PACKET_SCORE_UPDATE);
+ WriteString(a_Player);
+ WriteByte(a_Mode);
+
+ if (a_Mode != 1)
+ {
+ WriteString(a_Objective);
+ WriteInt((int) a_Score);
+ }
+
+ Flush();
+}
+
+
+
+
+
+void cProtocol150::SendDisplayObjective(const AString & a_Objective, cScoreboard::eDisplaySlot a_Display)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte(PACKET_DISPLAY_OBJECTIVE);
+ WriteByte((int) a_Display);
+ WriteString(a_Objective);
+ Flush();
+}
+
+
+
+
+
int cProtocol150::ParseWindowClick(void)
{
HANDLE_PACKET_READ(ReadChar, char, WindowID);