summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol125.cpp
diff options
context:
space:
mode:
authorandrew <xdotftw@gmail.com>2014-05-11 13:57:06 +0200
committerandrew <xdotftw@gmail.com>2014-05-11 13:57:06 +0200
commitc7c3724a3ee0e7a77fe9924ad25c36b6ec8fdd14 (patch)
treee26a406f738328936caf2a0b361ff5745510d113 /src/Protocol/Protocol125.cpp
parentMerge pull request #992 from mc-server/coverity_fixes (diff)
downloadcuberite-c7c3724a3ee0e7a77fe9924ad25c36b6ec8fdd14.tar
cuberite-c7c3724a3ee0e7a77fe9924ad25c36b6ec8fdd14.tar.gz
cuberite-c7c3724a3ee0e7a77fe9924ad25c36b6ec8fdd14.tar.bz2
cuberite-c7c3724a3ee0e7a77fe9924ad25c36b6ec8fdd14.tar.lz
cuberite-c7c3724a3ee0e7a77fe9924ad25c36b6ec8fdd14.tar.xz
cuberite-c7c3724a3ee0e7a77fe9924ad25c36b6ec8fdd14.tar.zst
cuberite-c7c3724a3ee0e7a77fe9924ad25c36b6ec8fdd14.zip
Diffstat (limited to 'src/Protocol/Protocol125.cpp')
-rw-r--r--src/Protocol/Protocol125.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp
index e7873cf7a..f3bdae3ac 100644
--- a/src/Protocol/Protocol125.cpp
+++ b/src/Protocol/Protocol125.cpp
@@ -99,6 +99,7 @@ enum
PACKET_ENCHANT_ITEM = 0x6C,
PACKET_UPDATE_SIGN = 0x82,
PACKET_ITEM_DATA = 0x83,
+ PACKET_INCREMENT_STATISTIC = 0xC8,
PACKET_PLAYER_LIST_ITEM = 0xC9,
PACKET_PLAYER_ABILITIES = 0xca,
PACKET_PLUGIN_MESSAGE = 0xfa,
@@ -992,6 +993,33 @@ void cProtocol125::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleTyp
+void cProtocol125::SendStatistics(const cStatManager & a_Manager)
+{
+ /* NOTE:
+ * Versions prior to minecraft 1.7 use an incremental statistic sync
+ * method. The current setup does not allow us to implement that, because
+ * of performance considerations.
+ */
+#if 0
+ for (unsigned int i = 0; i < (unsigned int)statCount; ++i)
+ {
+ StatValue Value = m_Manager->GetValue((eStatistic) i);
+
+ unsigned int StatID = cStatInfo::GetID((eStatistic) i);
+
+ cCSLock Lock(m_CSPacket);
+ WriteByte(PACKET_INCREMENT_STATISTIC);
+ WriteInt(StatID);
+ WriteByte(Value); /* Can overflow! */
+ Flush();
+ }
+#endif
+}
+
+
+
+
+
void cProtocol125::SendTabCompletionResults(const AStringVector & a_Results)
{
// This protocol version doesn't support tab completion