summaryrefslogtreecommitdiffstats
path: root/Tools/ProtoProxy/Connection.cpp
diff options
context:
space:
mode:
authorjfhumann <j.f.humann@gmail.com>2014-04-18 21:44:58 +0200
committerjfhumann <j.f.humann@gmail.com>2014-04-18 21:44:58 +0200
commit67344a378210b1f9c21a50f02e1ff2459be66d5f (patch)
treed775281489827d49139ee3e23fba87a1d079cf89 /Tools/ProtoProxy/Connection.cpp
parentDid some static analysis, fixed some bugs and optimized a lot of code (diff)
parentAdded performance test of the nether fort generator. (diff)
downloadcuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar.gz
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar.bz2
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar.lz
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar.xz
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.tar.zst
cuberite-67344a378210b1f9c21a50f02e1ff2459be66d5f.zip
Diffstat (limited to 'Tools/ProtoProxy/Connection.cpp')
-rw-r--r--Tools/ProtoProxy/Connection.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp
index 8dc82157a..b21d2ae59 100644
--- a/Tools/ProtoProxy/Connection.cpp
+++ b/Tools/ProtoProxy/Connection.cpp
@@ -2197,32 +2197,38 @@ bool cConnection::HandleServerSpawnMob(void)
+struct sSpawnData
+{
+ AString m_Name;
+ AString m_Value;
+ AString m_Signature;
+ sSpawnData(const AString & a_Name, const AString & a_Value, const AString & a_Signature) :
+ m_Name(a_Name),
+ m_Value(a_Value),
+ m_Signature(a_Signature)
+ {
+ }
+};
+
+typedef std::vector<sSpawnData> sSpawnDatas;
+
+
+
+
+
bool cConnection::HandleServerSpawnNamedEntity(void)
{
HANDLE_SERVER_PACKET_READ(ReadVarInt, UInt32, EntityID);
HANDLE_SERVER_PACKET_READ(ReadVarUTF8String, AString, EntityUUID);
HANDLE_SERVER_PACKET_READ(ReadVarUTF8String, AString, EntityName);
HANDLE_SERVER_PACKET_READ(ReadVarInt, UInt32, DataCount);
- struct sData
- {
- AString m_Name;
- AString m_Value;
- AString m_Signature;
- sData(const AString & a_Name, const AString & a_Value, const AString & a_Signature) :
- m_Name(a_Name),
- m_Value(a_Value),
- m_Signature(a_Signature)
- {
- }
- };
- typedef std::vector<sData> sDataVec;
- sDataVec Data;
+ sSpawnDatas Data;
for (UInt32 i = 0; i < DataCount; i++)
{
HANDLE_SERVER_PACKET_READ(ReadVarUTF8String, AString, Name)
HANDLE_SERVER_PACKET_READ(ReadVarUTF8String, AString, Value)
HANDLE_SERVER_PACKET_READ(ReadVarUTF8String, AString, Signature)
- Data.push_back(sData(Name, Value, Signature));
+ Data.push_back(sSpawnData(Name, Value, Signature));
}
HANDLE_SERVER_PACKET_READ(ReadBEInt, int, PosX);
HANDLE_SERVER_PACKET_READ(ReadBEInt, int, PosY);
@@ -2242,7 +2248,7 @@ bool cConnection::HandleServerSpawnNamedEntity(void)
Log(" UUID = \"%s\"", EntityUUID.c_str());
Log(" Name = \"%s\"", EntityName.c_str());
Log(" NumData = %u", DataCount);
- for (sDataVec::const_iterator itr = Data.begin(), end = Data.end(); itr != end; ++itr)
+ for (sSpawnDatas::const_iterator itr = Data.begin(), end = Data.end(); itr != end; ++itr)
{
Log(" Name = \"%s\", Value = \"%s\", Signature = \"%s\"",
itr->m_Name.c_str(), itr->m_Value.c_str(), itr->m_Signature.c_str()