Skip to content

Commit 7593929

Browse files
typo2
1 parent bad0589 commit 7593929

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Server/mods/deathmatch/logic/CGame.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,21 +1782,23 @@ void CGame::Packet_PlayerJoinData(CPlayerJoinDataPacket& Packet)
17821782
}
17831783
#endif
17841784

1785+
SString strIP = pPlayer->GetSourceIP();
1786+
SString strIPAndSerial("IP: %s Serial: %s Version: %s", strIP.c_str(), strSerial.c_str(), strPlayerVersion.c_str());
1787+
17851788
// Prevent player from connecting if serial is invalid
17861789
std::regex serialRegex("^[A-F0-9]{32}$");
17871790
if (!std::regex_match(strSerial, serialRegex))
17881791
{
17891792
// Tell the console
1790-
CLogger::LogPrintf("CONNECT: %s failed to connect (Invalid serial) (%s)\n", szNick, pPlayer->GetSourceIP());
1793+
CLogger::LogPrintf("CONNECT: %s failed to connect (Invalid serial) (%s)\n", szNick, strIPAndSerial.c_str());
17911794

17921795
// Tell the player the problem
17931796
DisconnectPlayer(this, *pPlayer, CPlayerDisconnectedPacket::INVALID_SERIAL);
17941797
return;
17951798
}
17961799

1797-
SString strIP = pPlayer->GetSourceIP();
1798-
SString strIPAndSerial("IP: %s Serial: %s Version: %s", strIP.c_str(), strSerial.c_str(), strPlayerVersion.c_str());
1799-
if (!CheckNickProvided(szNick)) // check the nick is valid
1800+
// Check the nick is valid
1801+
if (!CheckNickProvided(szNick))
18001802
{
18011803
// Tell the console
18021804
CLogger::LogPrintf("CONNECT: %s failed to connect (Invalid nickname) (%s)\n", szNick, strIPAndSerial.c_str());

0 commit comments

Comments
 (0)