Cosmetic touchups.
Removed trailing whitespace, added cast to remove warning, added file seeking in case of corrupt files.
This commit is contained in:
parent
1b1f971752
commit
33c6ff872e
@ -280,8 +280,8 @@ public:
|
|||||||
void HandleEntityLeaveBed (int a_EntityID);
|
void HandleEntityLeaveBed (int a_EntityID);
|
||||||
void HandleEntitySprinting (int a_EntityID, bool a_IsSprinting);
|
void HandleEntitySprinting (int a_EntityID, bool a_IsSprinting);
|
||||||
|
|
||||||
/** Kicks the current player if the same username is already logged in.
|
/** Kicks the client if the same username is already logged in.
|
||||||
Returns false if a player has been kicked, true otherwise. */
|
Returns false if the client has been kicked, true otherwise. */
|
||||||
bool CheckMultiLogin(const AString & a_Username);
|
bool CheckMultiLogin(const AString & a_Username);
|
||||||
|
|
||||||
/** Called when the protocol handshake has been received (for protocol versions that support it;
|
/** Called when the protocol handshake has been received (for protocol versions that support it;
|
||||||
|
@ -63,7 +63,7 @@ bool cEvent::Wait(unsigned a_TimeoutMSec)
|
|||||||
} // switch (wait_until())
|
} // switch (wait_until())
|
||||||
} // while (m_ShouldWait && not timeout)
|
} // while (m_ShouldWait && not timeout)
|
||||||
|
|
||||||
// The wait timed out in the while() condition:
|
// The wait timed out in the while condition:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2966,6 +2966,7 @@ bool cWSSAnvil::cMCAFile::OpenFile(bool a_IsForReading)
|
|||||||
|
|
||||||
if (writeOutNeeded)
|
if (writeOutNeeded)
|
||||||
{
|
{
|
||||||
|
m_File.Seek(0);
|
||||||
if (
|
if (
|
||||||
(m_File.Write(m_Header, sizeof(m_Header)) != sizeof(m_Header)) || // Write chunk offsets
|
(m_File.Write(m_Header, sizeof(m_Header)) != sizeof(m_Header)) || // Write chunk offsets
|
||||||
(m_File.Write(m_TimeStamps, sizeof(m_TimeStamps)) != sizeof(m_TimeStamps)) // Write chunk timestamps
|
(m_File.Write(m_TimeStamps, sizeof(m_TimeStamps)) != sizeof(m_TimeStamps)) // Write chunk timestamps
|
||||||
@ -3104,7 +3105,7 @@ bool cWSSAnvil::cMCAFile::SetChunkData(const cChunkCoords & a_Chunk, const AStri
|
|||||||
m_Header[LocalX + 32 * LocalZ] = htonl((ChunkSector << 8) | ChunkSize);
|
m_Header[LocalX + 32 * LocalZ] = htonl((ChunkSector << 8) | ChunkSize);
|
||||||
|
|
||||||
// Set the modification time
|
// Set the modification time
|
||||||
m_TimeStamps[LocalX + 32 * LocalZ] = htonl(time(nullptr));
|
m_TimeStamps[LocalX + 32 * LocalZ] = htonl(static_cast<u_long>(time(nullptr)));
|
||||||
|
|
||||||
if (m_File.Seek(0) < 0)
|
if (m_File.Seek(0) < 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user