diff --git a/source/client/network/ClientSideNetworkHandler.cpp b/source/client/network/ClientSideNetworkHandler.cpp index 603847af5..910e47666 100644 --- a/source/client/network/ClientSideNetworkHandler.cpp +++ b/source/client/network/ClientSideNetworkHandler.cpp @@ -823,7 +823,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& guid, ContainerS void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& guid, LevelDataPacket* packet) { - if (!m_pLevel) return; + /*if (!m_pLevel) return; const int uncompMagic = 12847812, compMagic = 58712758, chunkSepMagic = 284787658; RakNet::BitStream* bs = &packet->m_data, bs2; @@ -840,7 +840,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& guid, LevelDataP if (magicNum == compMagic) { // Decompress it before we handle it. - int uncompSize = 0, compSize = 0; + uint32_t uncompSize = 0, compSize = 0; bs->Read(uncompSize); bs->Read(compSize); @@ -873,7 +873,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& guid, LevelDataP bs->Read(magicNum); } - int chunksX = 0, chunksZ = 0; + uint32_t chunksX = 0, chunksZ = 0; bs->Read(chunksX); bs->Read(chunksZ); @@ -899,7 +899,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& guid, LevelDataP uint8_t ptype = 0; // read the data size. This'll let us know how much to read. - int dataSize = 0; + uint32_t dataSize = 0; bs->Read(dataSize); LevelChunk* pChunk = m_pLevel->getChunk(cp); @@ -932,7 +932,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& guid, LevelDataP // All chunks are loaded. Also flush all the updates we've buffered. m_chunksRequested = C_MAX_CHUNKS; - flushAllBufferedUpdates(); + flushAllBufferedUpdates();*/ } bool ClientSideNetworkHandler::areAllChunksLoaded() diff --git a/source/network/packets/LevelDataPacket.cpp b/source/network/packets/LevelDataPacket.cpp index 23c944e08..95ba56029 100644 --- a/source/network/packets/LevelDataPacket.cpp +++ b/source/network/packets/LevelDataPacket.cpp @@ -30,8 +30,8 @@ void LevelDataPacket::write(RakNet::BitStream& bs) int uncompMagic = 12847812, compMagic = 58712758, chunkSepMagic = 284787658; bs2.Write(uncompMagic); - bs2.Write(chunksX); - bs2.Write(chunksZ); + bs2.Write(chunksX); + bs2.Write(chunksZ); ChunkPos chunkPos(0, 0); for (chunkPos.x = 0; chunkPos.x < chunksX; chunkPos.x++) { @@ -44,7 +44,7 @@ void LevelDataPacket::write(RakNet::BitStream& bs) ChunkDataPacket cdp(chunkPos, pChunk); cdp.write(bs3); - int dataSize = int(bs3.GetNumberOfBytesUsed()); + uint32_t dataSize = bs3.GetNumberOfBytesUsed(); bs2.Write(dataSize); bs2.Write((const char*)bs3.GetData(), dataSize); } @@ -67,7 +67,7 @@ void LevelDataPacket::write(RakNet::BitStream& bs) //float ratio = 100.0f * float(compSize) / float(uncompSize); //LOG_I("Compression ratio: %.2f (%d comp, %d uncomp)", ratio, int(compSize), int(uncompSize)); - int cs2 = int(compSize), us2 = int(uncompSize); + uint32_t cs2 = compSize, us2 = uncompSize; bs2.Reset(); bs2.Write(compMagic); bs2.Write(us2);