mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
feat: Abstract Logger and simplify code (#1207)
* Logger: Rename logger to Logger from dLogger * Logger: Add compile time filename Fix include issues Add writers Add macros Add macro to force compilation * Logger: Replace calls with macros Allows for filename and line number to be logged * Logger: Add comments and remove extra define Logger: Replace with unique_ptr also flush console at exit. regular file writer should be flushed on file close. Logger: Remove constexpr on variable * Logger: Simplify code * Update Logger.cpp
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "Database.h"
|
||||
#include "Character.h"
|
||||
#include "dServer.h"
|
||||
#include "dLogger.h"
|
||||
#include "Logger.h"
|
||||
#include "Game.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "eServerDisconnectIdentifiers.h"
|
||||
@@ -52,7 +52,7 @@ User::User(const SystemAddress& sysAddr, const std::string& username, const std:
|
||||
LWOOBJID objID = res->getUInt64(1);
|
||||
Character* character = new Character(uint32_t(objID), this);
|
||||
m_Characters.push_back(character);
|
||||
Game::logger->Log("User", "Loaded %llu as it is the last used char", objID);
|
||||
LOG("Loaded %llu as it is the last used char", objID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ void User::UserOutOfSync() {
|
||||
m_AmountOfTimesOutOfSync++;
|
||||
if (m_AmountOfTimesOutOfSync > m_MaxDesyncAllowed) {
|
||||
//YEET
|
||||
Game::logger->Log("User", "User %s was out of sync %i times out of %i, disconnecting for suspected speedhacking.", m_Username.c_str(), m_AmountOfTimesOutOfSync, m_MaxDesyncAllowed);
|
||||
LOG("User %s was out of sync %i times out of %i, disconnecting for suspected speedhacking.", m_Username.c_str(), m_AmountOfTimesOutOfSync, m_MaxDesyncAllowed);
|
||||
Game::server->Disconnect(this->m_SystemAddress, eServerDisconnectIdentifiers::PLAY_SCHEDULE_TIME_DONE);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user