diff options
-rw-r--r-- | Tools/ProtoProxy/Server.cpp | 34 | ||||
-rw-r--r-- | src/Blocks/BlockFire.h | 3 | ||||
-rw-r--r-- | src/Generating/BioGen.cpp | 14 | ||||
-rw-r--r-- | src/Generating/EndGen.cpp | 4 | ||||
-rw-r--r-- | src/Generating/Noise3DGenerator.cpp | 11 | ||||
-rw-r--r-- | src/LineBlockTracer.cpp | 18 | ||||
-rw-r--r-- | src/World.cpp | 5 | ||||
-rw-r--r-- | src/WorldStorage/SchematicFileSerializer.cpp | 4 |
8 files changed, 86 insertions, 7 deletions
diff --git a/Tools/ProtoProxy/Server.cpp b/Tools/ProtoProxy/Server.cpp index bb042b259..9545af852 100644 --- a/Tools/ProtoProxy/Server.cpp +++ b/Tools/ProtoProxy/Server.cpp @@ -38,13 +38,41 @@ int cServer::Init(short a_ListenPort, short a_ConnectPort) m_PublicKeyDER = m_PrivateKey.GetPubKeyDER(); m_ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (m_ListenSocket < 0) + { + #ifdef _WIN32 + int err = WSAGetLastError(); + #else + int err = errno; + #endif + printf("Failed to create listener socket: %d\n", err); + return err; + } sockaddr_in local; memset(&local, 0, sizeof(local)); local.sin_family = AF_INET; - local.sin_addr.s_addr = 0; // All interfaces + local.sin_addr.s_addr = 130; // INADDR_ANY; // All interfaces local.sin_port = htons(a_ListenPort); - bind(m_ListenSocket, (sockaddr *)&local, sizeof(local)); - listen(m_ListenSocket, 1); + if (!bind(m_ListenSocket, (sockaddr *)&local, sizeof(local))) + { + #ifdef _WIN32 + int err = WSAGetLastError(); + #else + int err = errno; + #endif + printf("Failed to bind listener socket: %d\n", err); + return err; + } + if (listen(m_ListenSocket, 1) != 0) + { + #ifdef _WIN32 + int err = WSAGetLastError(); + #else + int err = errno; + #endif + printf("Failed to listen on socket: %d\n", err); + return err; + } printf("Listening on port %d, connecting to localhost:%d\n", a_ListenPort, a_ConnectPort); diff --git a/src/Blocks/BlockFire.h b/src/Blocks/BlockFire.h index 07fcefe16..bafd385ab 100644 --- a/src/Blocks/BlockFire.h +++ b/src/Blocks/BlockFire.h @@ -12,7 +12,8 @@ class cBlockFireHandler : { public: cBlockFireHandler(BLOCKTYPE a_BlockType) - : cBlockHandler(a_BlockType) + : cBlockHandler(a_BlockType), + XZP(0), XZM(0), Dir(0) { } diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp index 2a4dbe794..2cc810d3b 100644 --- a/src/Generating/BioGen.cpp +++ b/src/Generating/BioGen.cpp @@ -733,7 +733,19 @@ cBioGenTwoLevel::cBioGenTwoLevel(int a_Seed) : m_Noise3(a_Seed + 5003), m_Noise4(a_Seed + 5004), m_Noise5(a_Seed + 5005), - m_Noise6(a_Seed + 5006) + m_Noise6(a_Seed + 5006), + m_FreqX1(0.0), + m_AmpX1(0.0), + m_FreqX2(0.0), + m_AmpX2(0.0), + m_FreqX3(0.0), + m_AmpX3(0.0), + m_FreqZ1(0.0), + m_AmpZ1(0.0), + m_FreqZ2(0.0), + m_AmpZ2(0.0), + m_FreqZ3(0.0), + m_AmpZ3(0.0) { } diff --git a/src/Generating/EndGen.cpp b/src/Generating/EndGen.cpp index bc26edb20..c559e765f 100644 --- a/src/Generating/EndGen.cpp +++ b/src/Generating/EndGen.cpp @@ -40,6 +40,10 @@ cEndGen::cEndGen(int a_Seed) : m_FrequencyX(80), m_FrequencyY(80), m_FrequencyZ(80), + m_MinChunkX(0), + m_MaxChunkX(0), + m_MinChunkZ(0), + m_MaxChunkZ(0), m_LastChunkX(0x7fffffff), // Use dummy coords that won't ever be used by real chunks m_LastChunkZ(0x7fffffff) { diff --git a/src/Generating/Noise3DGenerator.cpp b/src/Generating/Noise3DGenerator.cpp index 29471f936..eadc66a4e 100644 --- a/src/Generating/Noise3DGenerator.cpp +++ b/src/Generating/Noise3DGenerator.cpp @@ -380,6 +380,17 @@ cNoise3DComposable::cNoise3DComposable(int a_Seed) : m_DensityNoiseA(a_Seed + 1), m_DensityNoiseB(a_Seed + 2), m_BaseNoise(a_Seed + 3), + m_HeightAmplification(0.0), + m_MidPoint(0.0), + m_FrequencyX(0.0), + m_FrequencyY(0.0), + m_FrequencyZ(0.0), + m_BaseFrequencyX(0.0), + m_BaseFrequencyZ(0.0), + m_ChoiceFrequencyX(0.0), + m_ChoiceFrequencyY(0.0), + m_ChoiceFrequencyZ(0.0), + m_AirThreshold(0.0), m_LastChunkX(0x7fffffff), // Use dummy coords that won't ever be used by real chunks m_LastChunkZ(0x7fffffff) { diff --git a/src/LineBlockTracer.cpp b/src/LineBlockTracer.cpp index 90f97cd23..e43a79566 100644 --- a/src/LineBlockTracer.cpp +++ b/src/LineBlockTracer.cpp @@ -15,7 +15,23 @@ cLineBlockTracer::cLineBlockTracer(cWorld & a_World, cCallbacks & a_Callbacks) : - super(a_World, a_Callbacks) + super(a_World, a_Callbacks), + m_StartX(0.0), + m_StartY(0.0), + m_StartZ(0.0), + m_EndX(0.0), + m_EndY(0.0), + m_EndZ(0.0), + m_DiffX(0.0), + m_DiffY(0.0), + m_DiffZ(0.0), + m_DirX(0), + m_DirY(0), + m_DirZ(0), + m_CurrentX(0), + m_CurrentY(0), + m_CurrentZ(0), + m_CurrentFace(0) { } diff --git a/src/World.cpp b/src/World.cpp index eb76abc2c..24b1a9b40 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -271,6 +271,11 @@ cWorld::cWorld(const AString & a_WorldName, eDimension a_Dimension, const AStrin #endif m_Dimension(a_Dimension), m_IsSpawnExplicitlySet(false), + m_SpawnX(0), + m_SpawnY(0), + m_SpawnZ(0), + m_BroadcastDeathMessages(true), + m_BroadcastAchievementMessages(true), m_IsDaylightCycleEnabled(true), m_WorldAge(0), m_TimeOfDay(0), diff --git a/src/WorldStorage/SchematicFileSerializer.cpp b/src/WorldStorage/SchematicFileSerializer.cpp index 64f4cb00d..fb881e290 100644 --- a/src/WorldStorage/SchematicFileSerializer.cpp +++ b/src/WorldStorage/SchematicFileSerializer.cpp @@ -184,7 +184,9 @@ bool cSchematicFileSerializer::LoadFromSchematicNBT(cBlockArea & a_BlockArea, cP { LOG("Dimensions are missing from the schematic file (%d, %d, %d), (%d, %d, %d)", TSizeX, TSizeY, TSizeZ, - a_NBT.GetType(TSizeX), a_NBT.GetType(TSizeY), a_NBT.GetType(TSizeZ) + (TSizeX >= 0) ? a_NBT.GetType(TSizeX) : -1, + (TSizeY >= 0) ? a_NBT.GetType(TSizeY) : -1, + (TSizeZ >= 0) ? a_NBT.GetType(TSizeZ) : -1 ); return false; } |