diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-16 01:03:47 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-16 01:03:47 +0200 |
commit | 1f6854792cdd6792b27c4f9f3d7d857df9dd64bf (patch) | |
tree | 4a45fccb4c6dbf7794d8f5e9d4b0bd5c68a0ec0a /src/Protocol/Protocol17x.cpp | |
parent | Player properties are now retrieved (diff) | |
download | cuberite-1f6854792cdd6792b27c4f9f3d7d857df9dd64bf.tar cuberite-1f6854792cdd6792b27c4f9f3d7d857df9dd64bf.tar.gz cuberite-1f6854792cdd6792b27c4f9f3d7d857df9dd64bf.tar.bz2 cuberite-1f6854792cdd6792b27c4f9f3d7d857df9dd64bf.tar.lz cuberite-1f6854792cdd6792b27c4f9f3d7d857df9dd64bf.tar.xz cuberite-1f6854792cdd6792b27c4f9f3d7d857df9dd64bf.tar.zst cuberite-1f6854792cdd6792b27c4f9f3d7d857df9dd64bf.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index ae800e9cf..d3b1cf946 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -3016,12 +3016,8 @@ void cProtocol176::SendPlayerSpawn(const cPlayer & a_Player) Pkt.WriteString(a_Player.GetClientHandle()->GetUUID()); Pkt.WriteString(a_Player.GetName()); - Json::Value root; - Json::Reader reader; - reader.parse(m_Client->GetProperties(), root); - - Pkt.WriteVarInt(root.size()); - for (Json::Value::iterator itr = root.begin(); itr != root.end(); ++itr) + Pkt.WriteVarInt(m_Client->GetProperties().size()); + for (Json::Value::iterator itr = m_Client->GetProperties().begin(); itr != m_Client->GetProperties().end(); ++itr) { Pkt.WriteString(((Json::Value)*itr).get("name", "").toStyledString()); Pkt.WriteString(((Json::Value)*itr).get("value", "").toStyledString()); |