summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-13 21:48:16 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-13 21:48:16 +0200
commit94d562502dd7abf65fa471666c46568609db1e7e (patch)
tree05d56e663dd7fd6395f607ef2a2d7737a2babaa3 /src/Protocol/Protocol18x.cpp
parentMoved chat json creating to the CompositeChat class. (diff)
downloadcuberite-94d562502dd7abf65fa471666c46568609db1e7e.tar
cuberite-94d562502dd7abf65fa471666c46568609db1e7e.tar.gz
cuberite-94d562502dd7abf65fa471666c46568609db1e7e.tar.bz2
cuberite-94d562502dd7abf65fa471666c46568609db1e7e.tar.lz
cuberite-94d562502dd7abf65fa471666c46568609db1e7e.tar.xz
cuberite-94d562502dd7abf65fa471666c46568609db1e7e.tar.zst
cuberite-94d562502dd7abf65fa471666c46568609db1e7e.zip
Diffstat (limited to 'src/Protocol/Protocol18x.cpp')
-rw-r--r--src/Protocol/Protocol18x.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 5023acf2d..54dea049b 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -1035,8 +1035,12 @@ void cProtocol180::SendScoreboardObjective(const AString & a_Name, const AString
cPacketizer Pkt(*this, 0x3b);
Pkt.WriteString(a_Name);
- Pkt.WriteString(a_DisplayName);
Pkt.WriteByte(a_Mode);
+ if ((a_Mode == 0) || (a_Mode == 2))
+ {
+ Pkt.WriteString(a_DisplayName);
+ Pkt.WriteString("integer");
+ }
}
@@ -1050,11 +1054,11 @@ void cProtocol180::SendScoreUpdate(const AString & a_Objective, const AString &
cPacketizer Pkt(*this, 0x3c);
Pkt.WriteString(a_Player);
Pkt.WriteByte(a_Mode);
+ Pkt.WriteString(a_Objective);
if (a_Mode != 1)
{
- Pkt.WriteString(a_Objective);
- Pkt.WriteInt((int) a_Score);
+ Pkt.WriteVarInt((UInt32) a_Score);
}
}