1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-30 09:06:43 +00:00

[Server] Use clearer log messages for ID_GAME_PREINIT

This commit is contained in:
David Cernat 2020-06-18 17:18:22 +02:00
parent 74ac59fed2
commit 7caaec1aea

View file

@ -241,7 +241,7 @@ bool Networking::preInit(RakNet::Packet *packet, RakNet::BitStream &bsIn)
peer->CloseConnection(packet->systemAddress, true); peer->CloseConnection(packet->systemAddress, true);
} }
DEBUG_PRINTF("ID_GAME_PREINIT"); LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "Received ID_GAME_PREINIT from %s", packet->systemAddress.ToString());
PacketPreInit::PluginContainer dataFiles; PacketPreInit::PluginContainer dataFiles;
PacketPreInit packetPreInit(peer); PacketPreInit packetPreInit(peer);
@ -251,7 +251,7 @@ bool Networking::preInit(RakNet::Packet *packet, RakNet::BitStream &bsIn)
if (!packetPreInit.isPacketValid() || dataFiles.empty()) if (!packetPreInit.isPacketValid() || dataFiles.empty())
{ {
LOG_APPEND(TimedLog::LOG_ERROR, "Invalid packetPreInit"); LOG_APPEND(TimedLog::LOG_ERROR, "- Packet was invalid");
peer->CloseConnection(packet->systemAddress, false); // close connection without notification peer->CloseConnection(packet->systemAddress, false); // close connection without notification
return false; return false;
} }
@ -261,7 +261,7 @@ bool Networking::preInit(RakNet::Packet *packet, RakNet::BitStream &bsIn)
{ {
for (int i = 0; dataFile != dataFiles.end(); dataFile++, i++) for (int i = 0; dataFile != dataFiles.end(); dataFile++, i++)
{ {
LOG_APPEND(TimedLog::LOG_VERBOSE, "- %X\t%s", dataFile->second[0], dataFile->first.c_str()); LOG_APPEND(TimedLog::LOG_INFO, "- idx: %i\tchecksum: %X\tfile: %s", i, dataFile->second[0], dataFile->first.c_str());
// Check if the filenames match, ignoring case // Check if the filenames match, ignoring case
if (Misc::StringUtils::ciEqual(samples[i].first, dataFile->first)) if (Misc::StringUtils::ciEqual(samples[i].first, dataFile->first))
{ {
@ -285,14 +285,14 @@ bool Networking::preInit(RakNet::Packet *packet, RakNet::BitStream &bsIn)
// If the loop above was broken, then the client's data files do not match the server's // If the loop above was broken, then the client's data files do not match the server's
if (dataFileEnforcementState && dataFile != dataFiles.end()) if (dataFileEnforcementState && dataFile != dataFiles.end())
{ {
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "%s was not allowed to connect due to incompatible data files", packet->systemAddress.ToString()); LOG_APPEND(TimedLog::LOG_INFO, "- Client was not allowed to connect due to incompatible data files");
packetPreInit.setChecksums(&samples); packetPreInit.setChecksums(&samples);
packetPreInit.Send(packet->systemAddress); packetPreInit.Send(packet->systemAddress);
peer->CloseConnection(packet->systemAddress, true); peer->CloseConnection(packet->systemAddress, true);
} }
else else
{ {
LOG_MESSAGE_SIMPLE(TimedLog::LOG_INFO, "%s was allowed to connect", packet->systemAddress.ToString()); LOG_APPEND(TimedLog::LOG_INFO, "- Client was allowed to connect");
PacketPreInit::PluginContainer tmp; PacketPreInit::PluginContainer tmp;
packetPreInit.setChecksums(&tmp); packetPreInit.setChecksums(&tmp);
packetPreInit.Send(packet->systemAddress); packetPreInit.Send(packet->systemAddress);