summaryrefslogtreecommitdiffstats
path: root/converter/cNBTData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'converter/cNBTData.cpp')
-rw-r--r--converter/cNBTData.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/converter/cNBTData.cpp b/converter/cNBTData.cpp
index 9bc25b789..03e88b3ce 100644
--- a/converter/cNBTData.cpp
+++ b/converter/cNBTData.cpp
@@ -27,12 +27,13 @@ cNBTData::cNBTData( char* a_Buffer, unsigned int a_BufferSize )
{
m_ParseFunctions[i] = 0;
}
- m_ParseFunctions[TAG_Byte] = &cNBTData::ParseByte;
- m_ParseFunctions[TAG_Short] = &cNBTData::ParseShort;
- m_ParseFunctions[TAG_Int] = &cNBTData::ParseInt;
+ m_ParseFunctions[TAG_Byte] = &cNBTData::ParseByte;
+ m_ParseFunctions[TAG_Short] = &cNBTData::ParseShort;
+ m_ParseFunctions[TAG_Int] = &cNBTData::ParseInt;
m_ParseFunctions[TAG_String] = &cNBTData::ParseString;
- m_ParseFunctions[TAG_List] = &cNBTData::ParseList;
- m_ParseFunctions[TAG_Compound] = &cNBTData::ParseCompound;
+ m_ParseFunctions[TAG_List] = &cNBTData::ParseList;
+ m_ParseFunctions[TAG_Compound] = &cNBTData::ParseCompound;
+ m_ParseFunctions[TAG_ByteArray] = &cNBTData::ParseByteArray;
m_Buffer = a_Buffer;
@@ -41,7 +42,7 @@ cNBTData::cNBTData( char* a_Buffer, unsigned int a_BufferSize )
m_CurrentCompound = this;
- m_bDecompressed = false;
+ m_bDecompressed = true;
}
bool cNBTData::OpenCompound( std::string a_Name )
@@ -102,7 +103,7 @@ bool cNBTData::CloseList()
void cNBTData::Compress()
{
//printf("Before Compress size: %i\n", m_BufferSize );
- const int MAXNBTSIZE = 1024 * 2;
+ const int MAXNBTSIZE = 1024 * 1024 * 120;
int ret;
unsigned have;
@@ -180,7 +181,7 @@ bool cNBTData::Decompress()
//printf("Before Decompress size: %i\n", m_BufferSize );
- const int MAXNBTSIZE = 1024 * 2;
+ const int MAXNBTSIZE = 1024 * 1024 * 120 ;
int ret;
z_stream strm;
@@ -518,6 +519,17 @@ void cNBTData::ParseString( bool a_bNamed )
//printf("STRING: %s (%s)\n", Name.c_str(), String.c_str() );
}
+void cNBTData::ParseByteArray( bool a_bNamed )
+{
+ std::string Name;
+ if( a_bNamed ) Name = ReadName();
+ std::string String = ReadName();
+
+ PutString( Name, String );
+
+ //printf("STRING: %s (%s)\n", Name.c_str(), String.c_str() );
+}
+
std::string cNBTData::ReadName()
{
short Length = ReadShort();