Skip to content

Commit

Permalink
Cosmetic touchups.
Browse files Browse the repository at this point in the history
Removed trailing whitespace, added cast to remove warning, added file seeking in case of corrupt files.
  • Loading branch information
madmaxoft committed Dec 11, 2014
1 parent 1b1f971 commit 33c6ff8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/ClientHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ bool cClientHandle::CheckMultiLogin(const AString & a_Username)
{
return true;
}
} Callback;
} Callback;

// Check if the player is in any World.
if (cRoot::Get()->DoWithPlayer(a_Username, Callback))
Expand Down
4 changes: 2 additions & 2 deletions src/ClientHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ class cClientHandle : // tolua_export
void HandleEntityLeaveBed (int a_EntityID);
void HandleEntitySprinting (int a_EntityID, bool a_IsSprinting);

/** Kicks the current player if the same username is already logged in.
Returns false if a player has been kicked, true otherwise. */
/** Kicks the client if the same username is already logged in.
Returns false if the client has been kicked, true otherwise. */
bool CheckMultiLogin(const AString & a_Username);

/** Called when the protocol handshake has been received (for protocol versions that support it;
Expand Down
2 changes: 1 addition & 1 deletion src/OSSupport/Event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ bool cEvent::Wait(unsigned a_TimeoutMSec)
} // switch (wait_until())
} // while (m_ShouldWait && not timeout)

// The wait timed out in the while() condition:
// The wait timed out in the while condition:
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class cServer // tolua_export
Returns true is Player is found in queue. */
bool IsPlayerInQueue(AString a_Username);

/** Can login more than once with same username.
/** Can login more than once with same username.
Returns false if it is not allowed, true otherwise. */
bool DoesAllowMultiLogin(void) { return m_bAllowMultiLogin; }

Expand Down Expand Up @@ -225,7 +225,7 @@ class cServer // tolua_export
bool m_bIsHardcore;

/** True - allow same username to login more than once False - only once */
bool m_bAllowMultiLogin;
bool m_bAllowMultiLogin;

cTickThread m_TickThread;
cEvent m_RestartEvent;
Expand Down
9 changes: 5 additions & 4 deletions src/WorldStorage/WSSAnvil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2966,10 +2966,11 @@ bool cWSSAnvil::cMCAFile::OpenFile(bool a_IsForReading)

if (writeOutNeeded)
{
m_File.Seek(0);
if (
(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_Header, sizeof(m_Header)) != sizeof(m_Header)) || // Write chunk offsets
(m_File.Write(m_TimeStamps, sizeof(m_TimeStamps)) != sizeof(m_TimeStamps)) // Write chunk timestamps
)
{
LOGWARNING("Cannot process MCA header in file \"%s\", chunks in that file will be lost", m_FileName.c_str());
m_File.Close();
Expand Down Expand Up @@ -3104,7 +3105,7 @@ bool cWSSAnvil::cMCAFile::SetChunkData(const cChunkCoords & a_Chunk, const AStri
m_Header[LocalX + 32 * LocalZ] = htonl((ChunkSector << 8) | ChunkSize);

// 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)
{
Expand Down

0 comments on commit 33c6ff8

Please sign in to comment.