Make logger automatically put a newline (#675)

at the end of the line
remove all the newlines in log calls
This commit is contained in:
Aaron Kimbrell 2022-07-24 21:26:51 -05:00 committed by GitHub
parent a7fb6eb3f3
commit e97ae92624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
86 changed files with 1249 additions and 1252 deletions

View File

@ -37,9 +37,9 @@ int main(int argc, char** argv) {
//Create all the objects we need to run our service:
Game::logger = SetupLogger();
if (!Game::logger) return 0;
Game::logger->Log("AuthServer", "Starting Auth server...\n");
Game::logger->Log("AuthServer", "Version: %i.%i\n", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR);
Game::logger->Log("AuthServer", "Compiled on: %s\n", __TIMESTAMP__);
Game::logger->Log("AuthServer", "Starting Auth server...");
Game::logger->Log("AuthServer", "Version: %i.%i", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR);
Game::logger->Log("AuthServer", "Compiled on: %s", __TIMESTAMP__);
//Read our config:
dConfig config("authconfig.ini");
@ -56,7 +56,7 @@ int main(int argc, char** argv) {
try {
Database::Connect(mysql_host, mysql_database, mysql_username, mysql_password);
} catch (sql::SQLException& ex) {
Game::logger->Log("AuthServer", "Got an error while connecting to the database: %s\n", ex.what());
Game::logger->Log("AuthServer", "Got an error while connecting to the database: %s", ex.what());
Database::Destroy("AuthServer");
delete Game::server;
delete Game::logger;

View File

@ -393,7 +393,7 @@ void ChatPacketHandler::HandleChatMessage(Packet* packet)
std::string message = PacketUtils::ReadString(0x66, packet, true);
Game::logger->Log("ChatPacketHandler", "Got a message from (%s) [%d]: %s\n", senderName.c_str(), channel, message.c_str());
Game::logger->Log("ChatPacketHandler", "Got a message from (%s) [%d]: %s", senderName.c_str(), channel, message.c_str());
if (channel != 8) return;
@ -530,13 +530,13 @@ void ChatPacketHandler::HandleTeamInvite(Packet* packet)
if (team->memberIDs.size() > 3) {
// no more teams greater than 4
Game::logger->Log("ChatPacketHandler", "Someone tried to invite a 5th player to a team\n");
Game::logger->Log("ChatPacketHandler", "Someone tried to invite a 5th player to a team");
return;
}
SendTeamInvite(other, player);
Game::logger->Log("ChatPacketHandler", "Got team invite: %llu -> %s\n", playerID, invitedPlayer.c_str());
Game::logger->Log("ChatPacketHandler", "Got team invite: %llu -> %s", playerID, invitedPlayer.c_str());
}
void ChatPacketHandler::HandleTeamInviteResponse(Packet* packet)
@ -552,7 +552,7 @@ void ChatPacketHandler::HandleTeamInviteResponse(Packet* packet)
LWOOBJID leaderID = LWOOBJID_EMPTY;
inStream.Read(leaderID);
Game::logger->Log("ChatPacketHandler", "Accepted invite: %llu -> %llu (%d)\n", playerID, leaderID, declined);
Game::logger->Log("ChatPacketHandler", "Accepted invite: %llu -> %llu (%d)", playerID, leaderID, declined);
if (declined)
{
@ -563,14 +563,14 @@ void ChatPacketHandler::HandleTeamInviteResponse(Packet* packet)
if (team == nullptr)
{
Game::logger->Log("ChatPacketHandler", "Failed to find team for leader (%llu)\n", leaderID);
Game::logger->Log("ChatPacketHandler", "Failed to find team for leader (%llu)", leaderID);
team = playerContainer.GetTeam(playerID);
}
if (team == nullptr)
{
Game::logger->Log("ChatPacketHandler", "Failed to find team for player (%llu)\n", playerID);
Game::logger->Log("ChatPacketHandler", "Failed to find team for player (%llu)", playerID);
return;
}
@ -588,7 +588,7 @@ void ChatPacketHandler::HandleTeamLeave(Packet* packet)
auto* team = playerContainer.GetTeam(playerID);
Game::logger->Log("ChatPacketHandler", "(%llu) leaving team\n", playerID);
Game::logger->Log("ChatPacketHandler", "(%llu) leaving team", playerID);
if (team != nullptr)
{
@ -605,7 +605,7 @@ void ChatPacketHandler::HandleTeamKick(Packet* packet)
std::string kickedPlayer = PacketUtils::ReadString(0x14, packet, true);
Game::logger->Log("ChatPacketHandler", "(%llu) kicking (%s) from team\n", playerID, kickedPlayer.c_str());
Game::logger->Log("ChatPacketHandler", "(%llu) kicking (%s) from team", playerID, kickedPlayer.c_str());
auto* kicked = playerContainer.GetPlayerData(kickedPlayer);
@ -641,7 +641,7 @@ void ChatPacketHandler::HandleTeamPromote(Packet* packet)
std::string promotedPlayer = PacketUtils::ReadString(0x14, packet, true);
Game::logger->Log("ChatPacketHandler", "(%llu) promoting (%s) to team leader\n", playerID, promotedPlayer.c_str());
Game::logger->Log("ChatPacketHandler", "(%llu) promoting (%s) to team leader", playerID, promotedPlayer.c_str());
auto* promoted = playerContainer.GetPlayerData(promotedPlayer);

View File

@ -40,9 +40,9 @@ int main(int argc, char** argv) {
//Create all the objects we need to run our service:
Game::logger = SetupLogger();
if (!Game::logger) return 0;
Game::logger->Log("ChatServer", "Starting Chat server...\n");
Game::logger->Log("ChatServer", "Version: %i.%i\n", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR);
Game::logger->Log("ChatServer", "Compiled on: %s\n", __TIMESTAMP__);
Game::logger->Log("ChatServer", "Starting Chat server...");
Game::logger->Log("ChatServer", "Version: %i.%i", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR);
Game::logger->Log("ChatServer", "Compiled on: %s", __TIMESTAMP__);
//Read our config:
dConfig config("chatconfig.ini");
@ -60,7 +60,7 @@ int main(int argc, char** argv) {
Database::Connect(mysql_host, mysql_database, mysql_username, mysql_password);
}
catch (sql::SQLException& ex) {
Game::logger->Log("ChatServer", "Got an error while connecting to the database: %s\n", ex.what());
Game::logger->Log("ChatServer", "Got an error while connecting to the database: %s", ex.what());
Database::Destroy("ChatServer");
delete Game::server;
delete Game::logger;
@ -172,11 +172,11 @@ dLogger * SetupLogger() {
void HandlePacket(Packet* packet) {
if (packet->data[0] == ID_DISCONNECTION_NOTIFICATION || packet->data[0] == ID_CONNECTION_LOST) {
Game::logger->Log("ChatServer", "A server has disconnected, erasing their connected players from the list.\n");
Game::logger->Log("ChatServer", "A server has disconnected, erasing their connected players from the list.");
}
if (packet->data[0] == ID_NEW_INCOMING_CONNECTION) {
Game::logger->Log("ChatServer", "A server is connecting, awaiting user list.\n");
Game::logger->Log("ChatServer", "A server is connecting, awaiting user list.");
}
if (packet->data[1] == CHAT_INTERNAL) {
@ -205,7 +205,7 @@ void HandlePacket(Packet* packet) {
}
default:
Game::logger->Log("ChatServer", "Unknown CHAT_INTERNAL id: %i\n", int(packet->data[3]));
Game::logger->Log("ChatServer", "Unknown CHAT_INTERNAL id: %i", int(packet->data[3]));
}
}
@ -216,7 +216,7 @@ void HandlePacket(Packet* packet) {
break;
case MSG_CHAT_GET_IGNORE_LIST:
Game::logger->Log("ChatServer", "Asked for ignore list, but is unimplemented right now.\n");
Game::logger->Log("ChatServer", "Asked for ignore list, but is unimplemented right now.");
break;
case MSG_CHAT_TEAM_GET_STATUS:
@ -274,19 +274,19 @@ void HandlePacket(Packet* packet) {
break;
default:
Game::logger->Log("ChatServer", "Unknown CHAT id: %i\n", int(packet->data[3]));
Game::logger->Log("ChatServer", "Unknown CHAT id: %i", int(packet->data[3]));
}
}
if (packet->data[1] == WORLD) {
switch (packet->data[3]) {
case MSG_WORLD_CLIENT_ROUTE_PACKET: {
printf("routing packet from world\n");
Game::logger->Log("ChatServer", "Routing packet from world");
break;
}
default:
Game::logger->Log("ChatServer", "Unknown World id: %i\n", int(packet->data[3]));
Game::logger->Log("ChatServer", "Unknown World id: %i", int(packet->data[3]));
}
}
}

View File

@ -38,7 +38,7 @@ void PlayerContainer::InsertPlayer(Packet* packet) {
mNames[data->playerID] = GeneralUtils::ASCIIToUTF16(std::string(data->playerName.c_str()));
mPlayers.insert(std::make_pair(data->playerID, data));
Game::logger->Log("PlayerContainer", "Added user: %s (%llu), zone: %i\n", data->playerName.c_str(), data->playerID, data->zoneID.GetMapID());
Game::logger->Log("PlayerContainer", "Added user: %s (%llu), zone: %i", data->playerName.c_str(), data->playerID, data->zoneID.GetMapID());
auto* insertLog = Database::CreatePreppedStmt("INSERT INTO activity_log (character_id, activity, time, map_id) VALUES (?, ?, ?, ?);");
@ -84,7 +84,7 @@ void PlayerContainer::RemovePlayer(Packet* packet) {
}
}
Game::logger->Log("PlayerContainer", "Removed user: %llu\n", playerID);
Game::logger->Log("PlayerContainer", "Removed user: %llu", playerID);
mPlayers.erase(playerID);
auto* insertLog = Database::CreatePreppedStmt("INSERT INTO activity_log (character_id, activity, time, map_id) VALUES (?, ?, ?, ?);");
@ -110,7 +110,7 @@ void PlayerContainer::MuteUpdate(Packet* packet)
if (player == nullptr)
{
Game::logger->Log("PlayerContainer", "Failed to find user: %llu\n", playerID);
Game::logger->Log("PlayerContainer", "Failed to find user: %llu", playerID);
return;
}

View File

@ -76,7 +76,7 @@ void dLogger::LogBasic(const std::string & message) {
void dLogger::Log(const char * className, const char * format, ...) {
va_list args;
std::string log = "[" + std::string(className) + "] " + std::string(format);
std::string log = "[" + std::string(className) + "] " + std::string(format) + "\n";
va_start(args, format);
vLog(log.c_str(), args);
va_end(args);

View File

@ -43,8 +43,8 @@ void Database::Destroy(std::string source, bool log) {
if (!con) return;
if (log) {
if (source != "") Game::logger->Log("Database", "Destroying MySQL connection from %s!\n", source.c_str());
else Game::logger->Log("Database", "Destroying MySQL connection!\n");
if (source != "") Game::logger->Log("Database", "Destroying MySQL connection from %s!", source.c_str());
else Game::logger->Log("Database", "Destroying MySQL connection!");
}
con->close();
@ -63,7 +63,7 @@ sql::PreparedStatement* Database::CreatePreppedStmt(const std::string& query) {
if (!con) {
Connect();
Game::logger->Log("Database", "Trying to reconnect to MySQL\n");
Game::logger->Log("Database", "Trying to reconnect to MySQL");
}
if (!con->isValid() || con->isClosed())
@ -73,7 +73,7 @@ sql::PreparedStatement* Database::CreatePreppedStmt(const std::string& query) {
con = nullptr;
Connect();
Game::logger->Log("Database", "Trying to reconnect to MySQL from invalid or closed connection\n");
Game::logger->Log("Database", "Trying to reconnect to MySQL from invalid or closed connection");
}
auto* stmt = con->prepareStatement(str);

View File

@ -31,7 +31,7 @@ void MigrationRunner::RunMigrations() {
delete stmt;
if (doExit) continue;
Game::logger->Log("MigrationRunner", "Running migration: " + migration.name + "\n");
Game::logger->Log("MigrationRunner", "Running migration: " + migration.name + "");
finalSQL.append(migration.data);
finalSQL.append('\n');
@ -49,7 +49,7 @@ void MigrationRunner::RunMigrations() {
delete simpleStatement;
}
catch (sql::SQLException e) {
Game::logger->Log("MigrationRunner", std::string("Encountered error running migration: ") + e.what() + "\n");
Game::logger->Log("MigrationRunner", std::string("Encountered error running migration: ") + e.what() + "");
}
}
}

View File

@ -68,7 +68,7 @@ std::vector<CDSkillBehavior> CDSkillBehaviorTable::Query(std::function<bool(CDSk
return data;*/
//Logger::LogDebug("CDSkillBehaviorTable", "The 'Query' function is no longer working! Please use GetSkillByID instead!\n");
//Logger::LogDebug("CDSkillBehaviorTable", "The 'Query' function is no longer working! Please use GetSkillByID instead!");
std::vector<CDSkillBehavior> data; //So MSVC shuts up
return data;
}

View File

@ -140,16 +140,16 @@ void Character::DoQuickXMLDataParse() {
if (!m_Doc) return;
if (m_Doc->Parse(m_XMLData.c_str(), m_XMLData.size()) == 0) {
Game::logger->Log("Character", "Loaded xmlData for character %s (%i)!\n", m_Name.c_str(), m_ID);
Game::logger->Log("Character", "Loaded xmlData for character %s (%i)!", m_Name.c_str(), m_ID);
} else {
Game::logger->Log("Character", "Failed to load xmlData!\n");
Game::logger->Log("Character", "Failed to load xmlData!");
//Server::rakServer->CloseConnection(m_ParentUser->GetSystemAddress(), true);
return;
}
tinyxml2::XMLElement* mf = m_Doc->FirstChildElement("obj")->FirstChildElement("mf");
if (!mf) {
Game::logger->Log("Character", "Failed to find mf tag!\n");
Game::logger->Log("Character", "Failed to find mf tag!");
return;
}
@ -168,14 +168,14 @@ void Character::DoQuickXMLDataParse() {
tinyxml2::XMLElement* inv = m_Doc->FirstChildElement("obj")->FirstChildElement("inv");
if (!inv) {
Game::logger->Log("Character", "Char has no inv!\n");
Game::logger->Log("Character", "Char has no inv!");
return;
}
tinyxml2::XMLElement* bag = inv->FirstChildElement("items")->FirstChildElement("in");
if (!bag) {
Game::logger->Log("Character", "Couldn't find bag0!\n");
Game::logger->Log("Character", "Couldn't find bag0!");
return;
}
@ -359,7 +359,7 @@ void Character::SaveXMLToDatabase() {
//Call upon the entity to update our xmlDoc:
if (!m_OurEntity) {
Game::logger->Log("Character", "We didn't have an entity set while saving! CHARACTER WILL NOT BE SAVED!\n");
Game::logger->Log("Character", "We didn't have an entity set while saving! CHARACTER WILL NOT BE SAVED!");
return;
}
@ -380,7 +380,7 @@ void Character::SaveXMLToDatabase() {
//For metrics, log the time it took to save:
auto end = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed = end - start;
Game::logger->Log("Character", "Saved character to Database in: %fs\n", elapsed.count());
Game::logger->Log("Character", "Saved character to Database in: %fs", elapsed.count());
delete printer;
}

View File

@ -302,7 +302,7 @@ void Player::SetDroppedCoins(uint64_t value) {
Player::~Player()
{
Game::logger->Log("Player", "Deleted player\n");
Game::logger->Log("Player", "Deleted player");
for (int32_t i = 0; i < m_ObservedEntitiesUsed; i++)
{

View File

@ -84,7 +84,7 @@ void Trade::SetAccepted(LWOOBJID participant, bool value)
{
m_AcceptedA = !value;
Game::logger->Log("Trade", "Accepted from A (%d), B: (%d)\n", value, m_AcceptedB);
Game::logger->Log("Trade", "Accepted from A (%d), B: (%d)", value, m_AcceptedB);
auto* entityB = GetParticipantBEntity();
@ -97,7 +97,7 @@ void Trade::SetAccepted(LWOOBJID participant, bool value)
{
m_AcceptedB = !value;
Game::logger->Log("Trade", "Accepted from B (%d), A: (%d)\n", value, m_AcceptedA);
Game::logger->Log("Trade", "Accepted from B (%d), A: (%d)", value, m_AcceptedA);
auto* entityA = GetParticipantAEntity();
@ -202,7 +202,7 @@ void Trade::SendUpdateToOther(LWOOBJID participant)
uint64_t coins;
std::vector<TradeItem> itemIds;
Game::logger->Log("Trade", "Attempting to send trade update\n");
Game::logger->Log("Trade", "Attempting to send trade update");
if (participant == m_ParticipantA)
{
@ -242,7 +242,7 @@ void Trade::SendUpdateToOther(LWOOBJID participant)
items.push_back(tradeItem);
}
Game::logger->Log("Trade", "Sending trade update\n");
Game::logger->Log("Trade", "Sending trade update");
GameMessages::SendServerTradeUpdate(other->GetObjectID(), coins, items, other->GetSystemAddress());
}
@ -302,7 +302,7 @@ Trade* TradingManager::NewTrade(LWOOBJID participantA, LWOOBJID participantB)
trades[tradeId] = trade;
Game::logger->Log("TradingManager", "Created new trade between (%llu) <-> (%llu)\n", participantA, participantB);
Game::logger->Log("TradingManager", "Created new trade between (%llu) <-> (%llu)", participantA, participantB);
return trade;
}

View File

@ -50,7 +50,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\n", objID);
Game::logger->Log("User", "Loaded %llu as it is the last used char", objID);
}
}
@ -128,7 +128,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.\n", m_Username.c_str(), m_AmountOfTimesOutOfSync, m_MaxDesyncAllowed);
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);
Game::server->Disconnect(this->m_SystemAddress, SERVER_DISCON_KICK);
}
}

View File

@ -127,7 +127,7 @@ void UserManager::DeletePendingRemovals()
{
for (auto* user : m_UsersToDelete)
{
Game::logger->Log("UserManager", "Deleted user %i\n", user->GetAccountID());
Game::logger->Log("UserManager", "Deleted user %i", user->GetAccountID());
delete user;
}
@ -251,22 +251,22 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet)
LOT pantsLOT = FindCharPantsID(pantsColor);
if (name != "" && !UserManager::IsNameAvailable(name)) {
Game::logger->Log("UserManager", "AccountID: %i chose unavailable name: %s\n", u->GetAccountID(), name.c_str());
Game::logger->Log("UserManager", "AccountID: %i chose unavailable name: %s", u->GetAccountID(), name.c_str());
WorldPackets::SendCharacterCreationResponse(sysAddr, CREATION_RESPONSE_CUSTOM_NAME_IN_USE);
return;
}
if (!IsNameAvailable(predefinedName)) {
Game::logger->Log("UserManager", "AccountID: %i chose unavailable predefined name: %s\n", u->GetAccountID(), predefinedName.c_str());
Game::logger->Log("UserManager", "AccountID: %i chose unavailable predefined name: %s", u->GetAccountID(), predefinedName.c_str());
WorldPackets::SendCharacterCreationResponse(sysAddr, CREATION_RESPONSE_PREDEFINED_NAME_IN_USE);
return;
}
if (name == "") {
Game::logger->Log("UserManager", "AccountID: %i is creating a character with predefined name: %s\n", u->GetAccountID(), predefinedName.c_str());
Game::logger->Log("UserManager", "AccountID: %i is creating a character with predefined name: %s", u->GetAccountID(), predefinedName.c_str());
}
else {
Game::logger->Log("UserManager", "AccountID: %i is creating a character with name: %s (temporary: %s)\n", u->GetAccountID(), name.c_str(), predefinedName.c_str());
Game::logger->Log("UserManager", "AccountID: %i is creating a character with name: %s (temporary: %s)", u->GetAccountID(), name.c_str(), predefinedName.c_str());
}
//Now that the name is ok, we can get an objectID from Master:
@ -277,7 +277,7 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet)
auto* overlapResult = overlapStmt->executeQuery();
if (overlapResult->next()) {
Game::logger->Log("UserManager", "Character object id unavailable, check objectidtracker!\n");
Game::logger->Log("UserManager", "Character object id unavailable, check objectidtracker!");
WorldPackets::SendCharacterCreationResponse(sysAddr, CREATION_RESPONSE_OBJECT_ID_UNAVAILABLE);
return;
}
@ -364,14 +364,14 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet)
void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet) {
User* u = GetUser(sysAddr);
if (!u) {
Game::logger->Log("UserManager", "Couldn't get user to delete character\n");
Game::logger->Log("UserManager", "Couldn't get user to delete character");
return;
}
LWOOBJID objectID = PacketUtils::ReadPacketS64(8, packet);
uint32_t charID = static_cast<uint32_t>(objectID);
Game::logger->Log("UserManager", "Received char delete req for ID: %llu (%u)\n", objectID, charID);
Game::logger->Log("UserManager", "Received char delete req for ID: %llu (%u)", objectID, charID);
//Check if this user has this character:
bool hasCharacter = false;
@ -381,11 +381,11 @@ void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet)
}
if (!hasCharacter) {
Game::logger->Log("UserManager", "User %i tried to delete a character that it does not own!\n", u->GetAccountID());
Game::logger->Log("UserManager", "User %i tried to delete a character that it does not own!", u->GetAccountID());
WorldPackets::SendCharacterDeleteResponse(sysAddr, false);
}
else {
Game::logger->Log("UserManager", "Deleting character %i\n", charID);
Game::logger->Log("UserManager", "Deleting character %i", charID);
{
sql::PreparedStatement* stmt = Database::CreatePreppedStmt("DELETE FROM charxml WHERE id=? LIMIT 1;");
stmt->setUInt64(1, charID);
@ -461,7 +461,7 @@ void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet)
void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet) {
User* u = GetUser(sysAddr);
if (!u) {
Game::logger->Log("UserManager", "Couldn't get user to delete character\n");
Game::logger->Log("UserManager", "Couldn't get user to delete character");
return;
}
@ -470,7 +470,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
objectID = GeneralUtils::ClearBit(objectID, OBJECT_BIT_PERSISTENT);
uint32_t charID = static_cast<uint32_t>(objectID);
Game::logger->Log("UserManager", "Received char rename request for ID: %llu (%u)\n", objectID, charID);
Game::logger->Log("UserManager", "Received char rename request for ID: %llu (%u)", objectID, charID);
std::string newName = PacketUtils::ReadString(16, packet, true);
@ -484,7 +484,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
}
if (!hasCharacter || !character) {
Game::logger->Log("UserManager", "User %i tried to rename a character that it does not own!\n", u->GetAccountID());
Game::logger->Log("UserManager", "User %i tried to rename a character that it does not own!", u->GetAccountID());
WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_UNKNOWN_ERROR);
} else if (hasCharacter && character) {
if (newName == character->GetName()) {
@ -501,7 +501,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
stmt->execute();
delete stmt;
Game::logger->Log("UserManager", "Character %s now known as %s\n", character->GetName().c_str(), newName.c_str());
Game::logger->Log("UserManager", "Character %s now known as %s", character->GetName().c_str(), newName.c_str());
WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_SUCCESS);
UserManager::RequestCharacterList(sysAddr);
} else {
@ -512,7 +512,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
stmt->execute();
delete stmt;
Game::logger->Log("UserManager", "Character %s has been renamed to %s and is pending approval by a moderator.\n", character->GetName().c_str(), newName.c_str());
Game::logger->Log("UserManager", "Character %s has been renamed to %s and is pending approval by a moderator.", character->GetName().c_str(), newName.c_str());
WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_SUCCESS);
UserManager::RequestCharacterList(sysAddr);
}
@ -520,7 +520,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_NAME_IN_USE);
}
} else {
Game::logger->Log("UserManager", "Unknown error occurred when renaming character, either hasCharacter or character variable != true.\n");
Game::logger->Log("UserManager", "Unknown error occurred when renaming character, either hasCharacter or character variable != true.");
WorldPackets::SendCharacterRenameResponse(sysAddr, RENAME_RESPONSE_UNKNOWN_ERROR);
}
}
@ -528,7 +528,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
void UserManager::LoginCharacter(const SystemAddress& sysAddr, uint32_t playerID) {
User* u = GetUser(sysAddr);
if (!u) {
Game::logger->Log("UserManager", "Couldn't get user to log in character\n");
Game::logger->Log("UserManager", "Couldn't get user to log in character");
return;
}
@ -551,7 +551,7 @@ void UserManager::LoginCharacter(const SystemAddress& sysAddr, uint32_t playerID
if (zoneID == LWOZONEID_INVALID) zoneID = 1000; //Send char to VE
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, zoneID, character->GetZoneClone(), false, [=](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i\n", character->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", character->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (character) {
character->SetZoneID(zoneID);
character->SetZoneInstance(zoneInstance);
@ -561,7 +561,7 @@ void UserManager::LoginCharacter(const SystemAddress& sysAddr, uint32_t playerID
return;
});
} else {
Game::logger->Log("UserManager", "Unknown error occurred when logging in a character, either hasCharacter or character variable != true.\n");
Game::logger->Log("UserManager", "Unknown error occurred when logging in a character, either hasCharacter or character variable != true.");
}
}

View File

@ -48,7 +48,7 @@ void AreaOfEffectBehavior::Calculate(BehaviorContext* context, RakNet::BitStream
if (self == nullptr)
{
Game::logger->Log("TacArcBehavior", "Invalid self for (%llu)!\n", context->originator);
Game::logger->Log("TacArcBehavior", "Invalid self for (%llu)!", context->originator);
return;
}
@ -81,7 +81,7 @@ void AreaOfEffectBehavior::Calculate(BehaviorContext* context, RakNet::BitStream
if (entity == nullptr)
{
Game::logger->Log("TacArcBehavior", "Invalid target (%llu) for (%llu)!\n", validTarget, context->originator);
Game::logger->Log("TacArcBehavior", "Invalid target (%llu) for (%llu)!", validTarget, context->originator);
continue;
}

View File

@ -69,7 +69,7 @@ void BasicAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bi
this->m_onSuccess->Handle(context, bitStream, branch);
break;
default:
Game::logger->Log("BasicAttackBehavior", "Unknown success state (%i)!\n", successState);
Game::logger->Log("BasicAttackBehavior", "Unknown success state (%i)!", successState);
break;
}
@ -79,7 +79,7 @@ void BasicAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bi
void BasicAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStream, BehaviorBranchContext branch) {
auto* self = EntityManager::Instance()->GetEntity(context->originator);
if (self == nullptr) {
Game::logger->Log("BasicAttackBehavior", "Invalid self entity (%llu)!\n", context->originator);
Game::logger->Log("BasicAttackBehavior", "Invalid self entity (%llu)!", context->originator);
return;
}
@ -127,7 +127,7 @@ void BasicAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitStream*
this->m_onSuccess->Calculate(context, bitStream, branch);
break;
default:
Game::logger->Log("BasicAttackBehavior", "Unknown success state (%i)!\n", successState);
Game::logger->Log("BasicAttackBehavior", "Unknown success state (%i)!", successState);
break;
}

View File

@ -269,13 +269,13 @@ Behavior* Behavior::CreateBehavior(const uint32_t behaviorId)
case BehaviorTemplates::BEHAVIOR_MOUNT: break;
case BehaviorTemplates::BEHAVIOR_SKILL_SET: break;
default:
//Game::logger->Log("Behavior", "Failed to load behavior with invalid template id (%i)!\n", templateId);
//Game::logger->Log("Behavior", "Failed to load behavior with invalid template id (%i)!", templateId);
break;
}
if (behavior == nullptr)
{
//Game::logger->Log("Behavior", "Failed to load unimplemented template id (%i)!\n", templateId);
//Game::logger->Log("Behavior", "Failed to load unimplemented template id (%i)!", templateId);
behavior = new EmptyBehavior(behaviorId);
}
@ -298,7 +298,7 @@ BehaviorTemplates Behavior::GetBehaviorTemplate(const uint32_t behaviorId) {
}
if (templateID == BehaviorTemplates::BEHAVIOR_EMPTY && behaviorId != 0) {
Game::logger->Log("Behavior", "Failed to load behavior template with id (%i)!\n", behaviorId);
Game::logger->Log("Behavior", "Failed to load behavior template with id (%i)!", behaviorId);
}
return templateID;
@ -432,7 +432,7 @@ Behavior::Behavior(const uint32_t behaviorId)
// Make sure we do not proceed if we are trying to load an invalid behavior
if (templateInDatabase.behaviorID == 0)
{
Game::logger->Log("Behavior", "Failed to load behavior with id (%i)!\n", behaviorId);
Game::logger->Log("Behavior", "Failed to load behavior with id (%i)!", behaviorId);
this->m_effectId = 0;
this->m_effectHandle = nullptr;

View File

@ -33,7 +33,7 @@ uint32_t BehaviorContext::GetUniqueSkillId() const
if (entity == nullptr)
{
Game::logger->Log("BehaviorContext", "Invalid entity for (%llu)!\n", this->originator);
Game::logger->Log("BehaviorContext", "Invalid entity for (%llu)!", this->originator);
return 0;
}
@ -42,7 +42,7 @@ uint32_t BehaviorContext::GetUniqueSkillId() const
if (component == nullptr)
{
Game::logger->Log("BehaviorContext", "No skill component attached to (%llu)!\n", this->originator);;
Game::logger->Log("BehaviorContext", "No skill component attached to (%llu)!", this->originator);;
return 0;
}
@ -135,7 +135,7 @@ void BehaviorContext::SyncBehavior(const uint32_t syncId, RakNet::BitStream* bit
if (!found)
{
Game::logger->Log("BehaviorContext", "Failed to find behavior sync entry with sync id (%i)!\n", syncId);
Game::logger->Log("BehaviorContext", "Failed to find behavior sync entry with sync id (%i)!", syncId);
return;
}
@ -145,7 +145,7 @@ void BehaviorContext::SyncBehavior(const uint32_t syncId, RakNet::BitStream* bit
if (behavior == nullptr)
{
Game::logger->Log("BehaviorContext", "Invalid behavior for sync id (%i)!\n", syncId);
Game::logger->Log("BehaviorContext", "Invalid behavior for sync id (%i)!", syncId);
return;
}
@ -333,7 +333,7 @@ std::vector<LWOOBJID> BehaviorContext::GetValidTargets(int32_t ignoreFaction, in
if (entity == nullptr)
{
Game::logger->Log("BehaviorContext", "Invalid entity for (%llu)!\n", this->originator);
Game::logger->Log("BehaviorContext", "Invalid entity for (%llu)!", this->originator);
return targets;
}

View File

@ -15,7 +15,7 @@ void BlockBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStrea
if (entity == nullptr)
{
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!\n", branch.target);
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", branch.target);
return;
}
@ -52,7 +52,7 @@ void BlockBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branc
if (entity == nullptr)
{
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!\n", branch.target);
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", branch.target);
return;
}

View File

@ -15,7 +15,7 @@ void BuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream
if (entity == nullptr)
{
Game::logger->Log("BuffBehavior", "Invalid target (%llu)!\n", target);
Game::logger->Log("BuffBehavior", "Invalid target (%llu)!", target);
return;
}
@ -24,7 +24,7 @@ void BuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream
if (component == nullptr)
{
Game::logger->Log("BuffBehavior", "Invalid target, no destroyable component (%llu)!\n", target);
Game::logger->Log("BuffBehavior", "Invalid target, no destroyable component (%llu)!", target);
return;
}
@ -56,7 +56,7 @@ void BuffBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch
if (entity == nullptr)
{
Game::logger->Log("BuffBehavior", "Invalid target (%llu)!\n", target);
Game::logger->Log("BuffBehavior", "Invalid target (%llu)!", target);
return;
}
@ -65,7 +65,7 @@ void BuffBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch
if (component == nullptr)
{
Game::logger->Log("BuffBehavior", "Invalid target, no destroyable component (%llu)!\n", target);
Game::logger->Log("BuffBehavior", "Invalid target, no destroyable component (%llu)!", target);
return;
}

View File

@ -19,7 +19,7 @@ void CarBoostBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitSt
return;
}
Game::logger->Log("Car boost", "Activating car boost!\n");
Game::logger->Log("Car boost", "Activating car boost!");
auto* possessableComponent = entity->GetComponent<PossessableComponent>();
if (possessableComponent != nullptr) {
@ -29,7 +29,7 @@ void CarBoostBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitSt
auto* characterComponent = possessor->GetComponent<CharacterComponent>();
if (characterComponent != nullptr) {
Game::logger->Log("Car boost", "Tracking car boost!\n");
Game::logger->Log("Car boost", "Tracking car boost!");
characterComponent->UpdatePlayerStatistic(RacingCarBoostsActivated);
}
}

View File

@ -13,7 +13,7 @@ void DamageAbsorptionBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
if (target == nullptr)
{
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!\n", branch.target);
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", branch.target);
return;
}
@ -43,7 +43,7 @@ void DamageAbsorptionBehavior::Timer(BehaviorContext* context, BehaviorBranchCon
if (target == nullptr)
{
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!\n", second);
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", second);
return;
}

View File

@ -13,7 +13,7 @@ void DamageReductionBehavior::Handle(BehaviorContext* context, RakNet::BitStream
if (target == nullptr)
{
Game::logger->Log("DamageReductionBehavior", "Failed to find target (%llu)!\n", branch.target);
Game::logger->Log("DamageReductionBehavior", "Failed to find target (%llu)!", branch.target);
return;
}
@ -41,7 +41,7 @@ void DamageReductionBehavior::Timer(BehaviorContext* context, BehaviorBranchCont
if (target == nullptr)
{
Game::logger->Log("DamageReductionBehavior", "Failed to find target (%llu)!\n", second);
Game::logger->Log("DamageReductionBehavior", "Failed to find target (%llu)!", second);
return;
}

View File

@ -12,7 +12,7 @@ void HealBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_strea
if (entity == nullptr)
{
Game::logger->Log("HealBehavior", "Failed to find entity for (%llu)!\n", branch.target);
Game::logger->Log("HealBehavior", "Failed to find entity for (%llu)!", branch.target);
return;
}
@ -21,7 +21,7 @@ void HealBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_strea
if (destroyable == nullptr)
{
Game::logger->Log("HealBehavior", "Failed to find destroyable component for %(llu)!\n", branch.target);
Game::logger->Log("HealBehavior", "Failed to find destroyable component for %(llu)!", branch.target);
return;
}

View File

@ -13,7 +13,7 @@ void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitSt
if (target == nullptr)
{
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!\n", branch.target);
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", branch.target);
return;
}
@ -46,7 +46,7 @@ void ImmunityBehavior::Timer(BehaviorContext* context, BehaviorBranchContext bra
if (target == nullptr)
{
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!\n", second);
Game::logger->Log("DamageAbsorptionBehavior", "Failed to find target (%llu)!", second);
return;
}

View File

@ -40,7 +40,7 @@ void MovementSwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream*
this->m_jetpackAction->Handle(context, bitStream, branch);
break;
default:
Game::logger->Log("MovementSwitchBehavior", "Invalid movement behavior type (%i)!\n", movementType);
Game::logger->Log("MovementSwitchBehavior", "Invalid movement behavior type (%i)!", movementType);
break;
}
}

View File

@ -17,7 +17,7 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
if (entity == nullptr)
{
Game::logger->Log("ProjectileAttackBehavior", "Failed to find originator (%llu)!\n", context->originator);
Game::logger->Log("ProjectileAttackBehavior", "Failed to find originator (%llu)!", context->originator);
return;
}
@ -26,7 +26,7 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
if (skillComponent == nullptr)
{
Game::logger->Log("ProjectileAttackBehavior", "Failed to find skill component for (%llu)!\n", -context->originator);
Game::logger->Log("ProjectileAttackBehavior", "Failed to find skill component for (%llu)!", -context->originator);
return;
}
@ -61,7 +61,7 @@ void ProjectileAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitSt
if (entity == nullptr)
{
Game::logger->Log("ProjectileAttackBehavior", "Failed to find originator (%llu)!\n", context->originator);
Game::logger->Log("ProjectileAttackBehavior", "Failed to find originator (%llu)!", context->originator);
return;
}
@ -70,7 +70,7 @@ void ProjectileAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitSt
if (skillComponent == nullptr)
{
Game::logger->Log("ProjectileAttackBehavior", "Failed to find skill component for (%llu)!\n", context->originator);
Game::logger->Log("ProjectileAttackBehavior", "Failed to find skill component for (%llu)!", context->originator);
return;
@ -80,7 +80,7 @@ void ProjectileAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitSt
if (other == nullptr)
{
Game::logger->Log("ProjectileAttackBehavior", "Invalid projectile target (%llu)!\n", branch.target);
Game::logger->Log("ProjectileAttackBehavior", "Invalid projectile target (%llu)!", branch.target);
return;
}

View File

@ -12,7 +12,7 @@ void RepairBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_str
if (entity == nullptr)
{
Game::logger->Log("RepairBehavior", "Failed to find entity for (%llu)!\n", branch.target);
Game::logger->Log("RepairBehavior", "Failed to find entity for (%llu)!", branch.target);
return;
}
@ -21,7 +21,7 @@ void RepairBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_str
if (destroyable == nullptr)
{
Game::logger->Log("RepairBehavior", "Failed to find destroyable component for %(llu)!\n", branch.target);
Game::logger->Log("RepairBehavior", "Failed to find destroyable component for %(llu)!", branch.target);
return;
}

View File

@ -14,7 +14,7 @@ void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStrea
if (origin == nullptr)
{
Game::logger->Log("SpawnBehavior", "Failed to find self entity (%llu)!\n", context->originator);
Game::logger->Log("SpawnBehavior", "Failed to find self entity (%llu)!", context->originator);
return;
}
@ -47,7 +47,7 @@ void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStrea
if (entity == nullptr)
{
Game::logger->Log("SpawnBehavior", "Failed to spawn entity (%i)!\n", this->m_lot);
Game::logger->Log("SpawnBehavior", "Failed to spawn entity (%i)!", this->m_lot);
return;
}
@ -90,7 +90,7 @@ void SpawnBehavior::Timer(BehaviorContext* context, const BehaviorBranchContext
if (entity == nullptr)
{
Game::logger->Log("SpawnBehavior", "Failed to find spawned entity (%llu)!\n", second);
Game::logger->Log("SpawnBehavior", "Failed to find spawned entity (%llu)!", second);
return;
}

View File

@ -22,7 +22,7 @@ void StunBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStream
if (target == nullptr)
{
Game::logger->Log("StunBehavior", "Failed to find target (%llu)!\n", branch.target);
Game::logger->Log("StunBehavior", "Failed to find target (%llu)!", branch.target);
return;
}
@ -49,7 +49,7 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStr
if (self == nullptr)
{
Game::logger->Log("StunBehavior", "Invalid self entity (%llu)!\n", context->originator);
Game::logger->Log("StunBehavior", "Invalid self entity (%llu)!", context->originator);
return;
}
@ -88,7 +88,7 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitStr
if (target == nullptr)
{
Game::logger->Log("StunBehavior", "Failed to find target (%llu)!\n", branch.target);
Game::logger->Log("StunBehavior", "Failed to find target (%llu)!", branch.target);
return;
}

View File

@ -29,7 +29,7 @@ void SwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStre
return;
}
Game::logger->Log("SwitchBehavior", "[%i] State: (%d), imagination: (%i) / (%f)\n", entity->GetLOT(), state, destroyableComponent->GetImagination(), destroyableComponent->GetMaxImagination());
Game::logger->Log("SwitchBehavior", "[%i] State: (%d), imagination: (%i) / (%f)", entity->GetLOT(), state, destroyableComponent->GetImagination(), destroyableComponent->GetMaxImagination());
if (state || (entity->GetLOT() == 8092 && destroyableComponent->GetImagination() >= m_imagination))
{

View File

@ -77,7 +77,7 @@ void TacArcBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitS
{
auto* self = EntityManager::Instance()->GetEntity(context->originator);
if (self == nullptr) {
Game::logger->Log("TacArcBehavior", "Invalid self for (%llu)!\n", context->originator);
Game::logger->Log("TacArcBehavior", "Invalid self for (%llu)!", context->originator);
return;
}
@ -144,7 +144,7 @@ void TacArcBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitS
if (entity == nullptr)
{
Game::logger->Log("TacArcBehavior", "Invalid target (%llu) for (%llu)!\n", validTarget, context->originator);
Game::logger->Log("TacArcBehavior", "Invalid target (%llu) for (%llu)!", validTarget, context->originator);
continue;
}

View File

@ -12,7 +12,7 @@ void TauntBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStrea
if (target == nullptr)
{
Game::logger->Log("TauntBehavior", "Failed to find target (%llu)!\n", branch.target);
Game::logger->Log("TauntBehavior", "Failed to find target (%llu)!", branch.target);
return;
}
@ -31,7 +31,7 @@ void TauntBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitSt
if (target == nullptr)
{
Game::logger->Log("TauntBehavior", "Failed to find target (%llu)!\n", branch.target);
Game::logger->Log("TauntBehavior", "Failed to find target (%llu)!", branch.target);
return;
}

View File

@ -23,7 +23,7 @@ void VerifyBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bitS
if (self == nullptr)
{
Game::logger->Log("VerifyBehavior", "Invalid self for (%llu)\n", context->originator);
Game::logger->Log("VerifyBehavior", "Invalid self for (%llu)", context->originator);
return;
}

View File

@ -577,7 +577,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
auto* entity = EntityManager::Instance()->GetEntity(target);
if (entity == nullptr) {
Game::logger->Log("BaseCombatAIComponent", "Invalid entity for checking validity (%llu)!\n", target);
Game::logger->Log("BaseCombatAIComponent", "Invalid entity for checking validity (%llu)!", target);
return false;
}
@ -591,7 +591,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
auto* referenceDestroyable = m_Parent->GetComponent<DestroyableComponent>();
if (referenceDestroyable == nullptr) {
Game::logger->Log("BaseCombatAIComponent", "Invalid reference destroyable component on (%llu)!\n", m_Parent->GetObjectID());
Game::logger->Log("BaseCombatAIComponent", "Invalid reference destroyable component on (%llu)!", m_Parent->GetObjectID());
return false;
}

View File

@ -91,14 +91,14 @@ void BouncerComponent::LookupPetSwitch()
EntityManager::Instance()->SerializeEntity(m_Parent);
Game::logger->Log("BouncerComponent", "Loaded pet bouncer\n");
Game::logger->Log("BouncerComponent", "Loaded pet bouncer");
}
}
}
if (!m_PetSwitchLoaded)
{
Game::logger->Log("BouncerComponent", "Failed to load pet bouncer\n");
Game::logger->Log("BouncerComponent", "Failed to load pet bouncer");
m_Parent->AddCallbackTimer(0.5f, [this]() {
LookupPetSwitch();

View File

@ -402,7 +402,7 @@ const std::vector<BuffParameter>& BuffComponent::GetBuffParameters(int32_t buffI
}
catch (std::invalid_argument& exception)
{
Game::logger->Log("BuffComponent", "Failed to parse value (%s): (%s)!\n", token.c_str(), exception.what());
Game::logger->Log("BuffComponent", "Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
}
}
}

View File

@ -27,7 +27,7 @@ void BuildBorderComponent::OnUse(Entity* originator) {
{
buildArea = entities[0]->GetObjectID();
Game::logger->Log("BuildBorderComponent", "Using PropertyPlaque\n");
Game::logger->Log("BuildBorderComponent", "Using PropertyPlaque");
}
auto* inventoryComponent = originator->GetComponent<InventoryComponent>();
@ -44,7 +44,7 @@ void BuildBorderComponent::OnUse(Entity* originator) {
inventoryComponent->PushEquippedItems();
Game::logger->Log("BuildBorderComponent", "Starting with %llu\n", buildArea);
Game::logger->Log("BuildBorderComponent", "Starting with %llu", buildArea);
if (PropertyManagementComponent::Instance() != nullptr) {
GameMessages::SendStartArrangingWithItem(

View File

@ -183,9 +183,10 @@ void CharacterComponent::SetGMLevel(int gmlevel) {
}
void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("CharacterComponent", "Failed to find char tag while loading XML!\n");
Game::logger->Log("CharacterComponent", "Failed to find char tag while loading XML!");
return;
}
if (character->QueryAttribute("rpt", &m_Reputation) == tinyxml2::XML_NO_ATTRIBUTE) {
@ -280,7 +281,7 @@ void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* minifig = doc->FirstChildElement("obj")->FirstChildElement("mf");
if (!minifig) {
Game::logger->Log("CharacterComponent", "Failed to find mf tag while updating XML!\n");
Game::logger->Log("CharacterComponent", "Failed to find mf tag while updating XML!");
return;
}
@ -300,7 +301,7 @@ void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("CharacterComponent", "Failed to find char tag while updating XML!\n");
Game::logger->Log("CharacterComponent", "Failed to find char tag while updating XML!");
return;
}
@ -350,7 +351,7 @@ void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
//
auto newUpdateTimestamp = std::time(nullptr);
Game::logger->Log("TotalTimePlayed", "Time since last save: %d\n", newUpdateTimestamp - m_LastUpdateTimestamp);
Game::logger->Log("TotalTimePlayed", "Time since last save: %d", newUpdateTimestamp - m_LastUpdateTimestamp);
m_TotalTimePlayed += newUpdateTimestamp - m_LastUpdateTimestamp;
character->SetAttribute("time", m_TotalTimePlayed);
@ -380,7 +381,7 @@ Item* CharacterComponent::GetRocket(Entity* player) {
}
if (!rocket) {
Game::logger->Log("CharacterComponent", "Unable to find rocket to equip!\n");
Game::logger->Log("CharacterComponent", "Unable to find rocket to equip!");
return rocket;
}
return rocket;

View File

@ -36,7 +36,7 @@ ControllablePhysicsComponent::ControllablePhysicsComponent(Entity* entity) : Com
return;
if (entity->GetLOT() == 1) {
Game::logger->Log("ControllablePhysicsComponent", "Using patch to load minifig physics\n");
Game::logger->Log("ControllablePhysicsComponent", "Using patch to load minifig physics");
float radius = 1.5f;
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), radius, false);
@ -133,7 +133,7 @@ void ControllablePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bo
void ControllablePhysicsComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("ControllablePhysicsComponent", "Failed to find char tag!\n");
Game::logger->Log("ControllablePhysicsComponent", "Failed to find char tag!");
return;
}
@ -159,7 +159,7 @@ void ControllablePhysicsComponent::ResetFlags() {
void ControllablePhysicsComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("ControllablePhysicsComponent", "Failed to find char tag while updating XML!\n");
Game::logger->Log("ControllablePhysicsComponent", "Failed to find char tag while updating XML!");
return;
}
@ -254,7 +254,7 @@ void ControllablePhysicsComponent::RemovePickupRadiusScale(float value) {
if (pos != m_ActivePickupRadiusScales.end()) {
m_ActivePickupRadiusScales.erase(pos);
} else {
Game::logger->Log("ControllablePhysicsComponent", "Warning: Could not find pickup radius %f in list of active radii. List has %i active radii.\n", value, m_ActivePickupRadiusScales.size());
Game::logger->Log("ControllablePhysicsComponent", "Warning: Could not find pickup radius %f in list of active radii. List has %i active radii.", value, m_ActivePickupRadiusScales.size());
return;
}

View File

@ -162,7 +162,7 @@ void DestroyableComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsIn
void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* dest = doc->FirstChildElement("obj")->FirstChildElement("dest");
if (!dest) {
Game::logger->Log("DestroyableComponent", "Failed to find dest tag!\n");
Game::logger->Log("DestroyableComponent", "Failed to find dest tag!");
return;
}
@ -184,7 +184,7 @@ void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
void DestroyableComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* dest = doc->FirstChildElement("obj")->FirstChildElement("dest");
if (!dest) {
Game::logger->Log("DestroyableComponent", "Failed to find dest tag!\n");
Game::logger->Log("DestroyableComponent", "Failed to find dest tag!");
return;
}
@ -499,7 +499,7 @@ bool DestroyableComponent::CheckValidity(const LWOOBJID target, const bool ignor
if (targetEntity == nullptr)
{
Game::logger->Log("DestroyableComponent", "Invalid entity for checking validity (%llu)!\n", target);
Game::logger->Log("DestroyableComponent", "Invalid entity for checking validity (%llu)!", target);
return false;
}

View File

@ -157,7 +157,7 @@ void InventoryComponent::AddItem(
{
if (count == 0)
{
Game::logger->Log("InventoryComponent", "Attempted to add 0 of item (%i) to the inventory!\n", lot);
Game::logger->Log("InventoryComponent", "Attempted to add 0 of item (%i) to the inventory!", lot);
return;
}
@ -166,7 +166,7 @@ void InventoryComponent::AddItem(
{
if (lot > 0)
{
Game::logger->Log("InventoryComponent", "Attempted to add invalid item (%i) to the inventory!\n", lot);
Game::logger->Log("InventoryComponent", "Attempted to add invalid item (%i) to the inventory!", lot);
}
return;
@ -187,7 +187,7 @@ void InventoryComponent::AddItem(
if (slot == -1)
{
Game::logger->Log("InventoryComponent", "Failed to find empty slot for inventory (%i)!\n", inventoryType);
Game::logger->Log("InventoryComponent", "Failed to find empty slot for inventory (%i)!", inventoryType);
return;
}
@ -303,7 +303,7 @@ void InventoryComponent::RemoveItem(const LOT lot, const uint32_t count, eInvent
{
if (count == 0)
{
Game::logger->Log("InventoryComponent", "Attempted to remove 0 of item (%i) from the inventory!\n", lot);
Game::logger->Log("InventoryComponent", "Attempted to remove 0 of item (%i) from the inventory!", lot);
return;
}
@ -532,7 +532,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document)
if (inventoryElement == nullptr)
{
Game::logger->Log("InventoryComponent", "Failed to find 'inv' xml element!\n");
Game::logger->Log("InventoryComponent", "Failed to find 'inv' xml element!");
return;
}
@ -541,7 +541,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document)
if (bags == nullptr)
{
Game::logger->Log("InventoryComponent", "Failed to find 'bags' xml element!\n");
Game::logger->Log("InventoryComponent", "Failed to find 'bags' xml element!");
return;
}
@ -569,7 +569,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document)
if (items == nullptr)
{
Game::logger->Log("InventoryComponent", "Failed to find 'items' xml element!\n");
Game::logger->Log("InventoryComponent", "Failed to find 'items' xml element!");
return;
}
@ -586,7 +586,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document)
if (inventory == nullptr)
{
Game::logger->Log("InventoryComponent", "Failed to find inventory (%i)!\n", type);
Game::logger->Log("InventoryComponent", "Failed to find inventory (%i)!", type);
return;
}
@ -666,7 +666,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document)
if (inventoryElement == nullptr)
{
Game::logger->Log("InventoryComponent", "Failed to find 'inv' xml element!\n");
Game::logger->Log("InventoryComponent", "Failed to find 'inv' xml element!");
return;
}
@ -691,7 +691,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document)
if (bags == nullptr)
{
Game::logger->Log("InventoryComponent", "Failed to find 'bags' xml element!\n");
Game::logger->Log("InventoryComponent", "Failed to find 'bags' xml element!");
return;
}
@ -712,7 +712,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document)
if (items == nullptr)
{
Game::logger->Log("InventoryComponent", "Failed to find 'items' xml element!\n");
Game::logger->Log("InventoryComponent", "Failed to find 'items' xml element!");
return;
}
@ -1474,7 +1474,7 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
if (entry.skillID == 0)
{
Game::logger->Log("InventoryComponent", "Failed to find buff behavior for skill (%i)!\n", result.skillID);
Game::logger->Log("InventoryComponent", "Failed to find buff behavior for skill (%i)!", result.skillID);
continue;
}
@ -1553,7 +1553,7 @@ std::vector<Item*> InventoryComponent::GenerateProxies(Item* parent)
}
catch (std::invalid_argument& exception)
{
Game::logger->Log("InventoryComponent", "Failed to parse proxy (%s): (%s)!\n", segment.c_str(), exception.what());
Game::logger->Log("InventoryComponent", "Failed to parse proxy (%s): (%s)!", segment.c_str(), exception.what());
}
}

View File

@ -12,7 +12,7 @@ LevelProgressionComponent::LevelProgressionComponent(Entity* parent) : Component
void LevelProgressionComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* level = doc->FirstChildElement("obj")->FirstChildElement("lvl");
if (!level) {
Game::logger->Log("LevelProgressionComponent", "Failed to find lvl tag while updating XML!\n");
Game::logger->Log("LevelProgressionComponent", "Failed to find lvl tag while updating XML!");
return;
}
level->SetAttribute("l", m_Level);
@ -22,7 +22,7 @@ void LevelProgressionComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
void LevelProgressionComponent::LoadFromXml(tinyxml2::XMLDocument* doc){
tinyxml2::XMLElement* level = doc->FirstChildElement("obj")->FirstChildElement("lvl");
if (!level) {
Game::logger->Log("LevelProgressionComponent", "Failed to find lvl tag while loading XML!\n");
Game::logger->Log("LevelProgressionComponent", "Failed to find lvl tag while loading XML!");
return;
}
level->QueryAttribute("l", &m_Level);

View File

@ -357,7 +357,7 @@ bool MissionComponent::LookForAchievements(MissionTaskType type, int32_t value,
}
}
catch (std::invalid_argument& exception) {
Game::logger->Log("MissionComponent", "Failed to parse target (%s): (%s)!\n", token.c_str(), exception.what());
Game::logger->Log("MissionComponent", "Failed to parse target (%s): (%s)!", token.c_str(), exception.what());
}
}

View File

@ -88,7 +88,7 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
auto* missionComponent = static_cast<MissionComponent*>(entity->GetComponent(COMPONENT_TYPE_MISSION));
if (!missionComponent) {
Game::logger->Log("MissionOfferComponent", "Unable to get mission component for Entity %llu\n", entity->GetObjectID());
Game::logger->Log("MissionOfferComponent", "Unable to get mission component for Entity %llu", entity->GetObjectID());
return;
}
@ -174,7 +174,7 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
}
catch (std::invalid_argument& exception)
{
Game::logger->Log("MissionOfferComponent", "Failed to parse value (%s): (%s)!\n", token.c_str(), exception.what());
Game::logger->Log("MissionOfferComponent", "Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
}
}

View File

@ -62,7 +62,7 @@ MovingPlatformComponent::MovingPlatformComponent(Entity* parent, const std::stri
m_NoAutoStart = false;
if (m_Path == nullptr) {
Game::logger->Log("MovingPlatformComponent", "Path not found: %s\n", pathName.c_str());
Game::logger->Log("MovingPlatformComponent", "Path not found: %s", pathName.c_str());
}
}

View File

@ -263,7 +263,7 @@ void PetComponent::OnUse(Entity* originator)
if (bricks.empty())
{
ChatPackets::SendSystemMessage(originator->GetSystemAddress(), u"Failed to load the puzzle minigame for this pet.");
Game::logger->Log("PetComponent", "Couldn't find %s for minigame!\n", buildFile.c_str());
Game::logger->Log("PetComponent", "Couldn't find %s for minigame!", buildFile.c_str());
return;
}
@ -717,7 +717,7 @@ void PetComponent::RequestSetPetName(std::u16string name)
return;
}
Game::logger->Log("PetComponent", "Got set pet name (%s)\n", GeneralUtils::UTF16ToWTF8(name).c_str());
Game::logger->Log("PetComponent", "Got set pet name (%s)", GeneralUtils::UTF16ToWTF8(name).c_str());
auto* inventoryComponent = tamer->GetComponent<InventoryComponent>();
@ -1006,7 +1006,7 @@ void PetComponent::AddDrainImaginationTimer(Item* item, bool fromTaming) {
// Set this to a variable so when this is called back from the player the timer doesn't fire off.
m_Parent->AddCallbackTimer(imaginationDrainRate, [playerDestroyableComponent, this, item](){
if (!playerDestroyableComponent) {
Game::logger->Log("PetComponent", "No petComponent and/or no playerDestroyableComponent\n");
Game::logger->Log("PetComponent", "No petComponent and/or no playerDestroyableComponent");
return;
}

View File

@ -218,7 +218,7 @@ PhantomPhysicsComponent::PhantomPhysicsComponent(Entity* parent) : Component(par
dpWorld::Instance().AddEntity(m_dpEntity);
}
else {
//Game::logger->Log("PhantomPhysicsComponent", "This one is supposed to have %s\n", info->physicsAsset.c_str());
//Game::logger->Log("PhantomPhysicsComponent", "This one is supposed to have %s", info->physicsAsset.c_str());
//add fallback cube:
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), 2.0f, 2.0f, 2.0f);

View File

@ -230,7 +230,7 @@ void PropertyEntranceComponent::OnPropertyEntranceSync(Entity* entity, bool incl
delete nameLookup;
nameLookup = nullptr;
Game::logger->Log("PropertyEntranceComponent", "Failed to find property owner name for %llu!\n", cloneId);
Game::logger->Log("PropertyEntranceComponent", "Failed to find property owner name for %llu!", cloneId);
continue;
} else {

View File

@ -132,7 +132,7 @@ std::vector<NiPoint3> PropertyManagementComponent::GetPaths() const
}
catch (std::invalid_argument& exception)
{
Game::logger->Log("PropertyManagementComponent", "Failed to parse value (%s): (%s)!\n", token.c_str(), exception.what());
Game::logger->Log("PropertyManagementComponent", "Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
}
}
@ -241,7 +241,7 @@ bool PropertyManagementComponent::Claim(const LWOOBJID playerId)
}
catch (sql::SQLException& exception)
{
Game::logger->Log("PropertyManagementComponent", "Failed to execute query: (%s)!\n", exception.what());
Game::logger->Log("PropertyManagementComponent", "Failed to execute query: (%s)!", exception.what());
throw exception;
return false;
@ -307,7 +307,7 @@ void PropertyManagementComponent::OnFinishBuilding()
void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const NiPoint3 position, NiQuaternion rotation)
{
Game::logger->Log("PropertyManagementComponent", "Placing model <%f, %f, %f>\n", position.x, position.y, position.z);
Game::logger->Log("PropertyManagementComponent", "Placing model <%f, %f, %f>", position.x, position.y, position.z);
auto* entity = GetOwner();
@ -327,7 +327,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
if (item == nullptr)
{
Game::logger->Log("PropertyManagementComponent", "Failed to find item with id %d\n", id);
Game::logger->Log("PropertyManagementComponent", "Failed to find item with id %d", id);
return;
}
@ -429,7 +429,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int deleteReason)
{
Game::logger->Log("PropertyManagementComponent", "Delete model: (%llu) (%i)\n", id, deleteReason);
Game::logger->Log("PropertyManagementComponent", "Delete model: (%llu) (%i)", id, deleteReason);
auto* entity = GetOwner();
@ -449,7 +449,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
if (index == models.end())
{
Game::logger->Log("PropertyManagementComponent", "Failed to find model\n");
Game::logger->Log("PropertyManagementComponent", "Failed to find model");
return;
}
@ -462,21 +462,21 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
if (spawner == nullptr)
{
Game::logger->Log("PropertyManagementComponent", "Failed to find spawner\n");
Game::logger->Log("PropertyManagementComponent", "Failed to find spawner");
}
auto* model = EntityManager::Instance()->GetEntity(id);
if (model == nullptr)
{
Game::logger->Log("PropertyManagementComponent", "Failed to find model entity\n");
Game::logger->Log("PropertyManagementComponent", "Failed to find model entity");
return;
}
EntityManager::Instance()->DestructEntity(model);
Game::logger->Log("PropertyManagementComponent", "Deleting model LOT %i\n", model->GetLOT());
Game::logger->Log("PropertyManagementComponent", "Deleting model LOT %i", model->GetLOT());
if (model->GetLOT() == 14)
{
@ -572,7 +572,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
}
default:
{
Game::logger->Log("PropertyManagementComponent", "Invalid delete reason\n");
Game::logger->Log("PropertyManagementComponent", "Invalid delete reason");
}
}
@ -720,7 +720,7 @@ void PropertyManagementComponent::Save()
try {
lookupResult = lookup->executeQuery();
} catch (sql::SQLException& ex) {
Game::logger->Log("PropertyManagementComponent", "lookup error %s\n", ex.what());
Game::logger->Log("PropertyManagementComponent", "lookup error %s", ex.what());
}
std::vector<LWOOBJID> present;
@ -767,7 +767,7 @@ void PropertyManagementComponent::Save()
try {
insertion->execute();
} catch (sql::SQLException& ex) {
Game::logger->Log("PropertyManagementComponent", "Error inserting into properties_contents. Error %s\n", ex.what());
Game::logger->Log("PropertyManagementComponent", "Error inserting into properties_contents. Error %s", ex.what());
}
}
else
@ -784,7 +784,7 @@ void PropertyManagementComponent::Save()
try {
update->executeUpdate();
} catch (sql::SQLException& ex) {
Game::logger->Log("PropertyManagementComponent", "Error updating properties_contents. Error: %s\n", ex.what());
Game::logger->Log("PropertyManagementComponent", "Error updating properties_contents. Error: %s", ex.what());
}
}
}
@ -800,7 +800,7 @@ void PropertyManagementComponent::Save()
try {
remove->execute();
} catch (sql::SQLException& ex) {
Game::logger->Log("PropertyManagementComponent", "Error removing from properties_contents. Error %s\n", ex.what());
Game::logger->Log("PropertyManagementComponent", "Error removing from properties_contents. Error %s", ex.what());
}
}
@ -834,7 +834,7 @@ void PropertyManagementComponent::OnQueryPropertyData(Entity* originator, const
const auto& worldId = dZoneManager::Instance()->GetZone()->GetZoneID();
const auto zoneId = worldId.GetMapID();
Game::logger->Log("Properties", "Getting property info for %d\n", zoneId);
Game::logger->Log("Properties", "Getting property info for %d", zoneId);
GameMessages::PropertyDataMessage message = GameMessages::PropertyDataMessage(zoneId);
const auto isClaimed = GetOwnerId() != LWOOBJID_EMPTY;

View File

@ -22,7 +22,7 @@ void PropertyVendorComponent::OnUse(Entity* originator)
if (PropertyManagementComponent::Instance()->GetOwnerId() == LWOOBJID_EMPTY)
{
Game::logger->Log("PropertyVendorComponent", "Property vendor opening!\n");
Game::logger->Log("PropertyVendorComponent", "Property vendor opening!");
GameMessages::SendOpenPropertyVendor(m_Parent->GetObjectID(), originator->GetSystemAddress());
@ -42,7 +42,7 @@ void PropertyVendorComponent::OnBuyFromVendor(Entity* originator, const bool con
if (PropertyManagementComponent::Instance() == nullptr) return;
if (PropertyManagementComponent::Instance()->Claim(originator->GetObjectID()) == false) {
Game::logger->Log("PropertyVendorComponent", "FAILED TO CLAIM PROPERTY. PLAYER ID IS %llu\n", originator->GetObjectID());
Game::logger->Log("PropertyVendorComponent", "FAILED TO CLAIM PROPERTY. PLAYER ID IS %llu", originator->GetObjectID());
return;
}
@ -56,6 +56,6 @@ void PropertyVendorComponent::OnBuyFromVendor(Entity* originator, const bool con
PropertyManagementComponent::Instance()->OnQueryPropertyData(originator, originator->GetSystemAddress());
Game::logger->Log("PropertyVendorComponent", "Fired event; (%d) (%i) (%i)\n", confirmed, lot, count);
Game::logger->Log("PropertyVendorComponent", "Fired event; (%d) (%i) (%i)", confirmed, lot, count);
}

View File

@ -91,7 +91,7 @@ void RacingControlComponent::OnPlayerLoaded(Entity *player) {
m_LoadedPlayers++;
Game::logger->Log("RacingControlComponent", "Loading player %i\n",
Game::logger->Log("RacingControlComponent", "Loading player %i",
m_LoadedPlayers);
m_LobbyPlayers.push_back(objectID);
@ -116,7 +116,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity *player,
auto *item = inventoryComponent->FindItemByLot(8092);
if (item == nullptr) {
Game::logger->Log("RacingControlComponent", "Failed to find item\n");
Game::logger->Log("RacingControlComponent", "Failed to find item");
return;
}
@ -149,7 +149,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity *player,
startRotation = NiQuaternion::FromEulerAngles(angles);
Game::logger->Log("RacingControlComponent",
"Start position <%f, %f, %f>, <%f, %f, %f>\n",
"Start position <%f, %f, %f>, <%f, %f, %f>",
startPosition.x, startPosition.y, startPosition.z,
angles.x * (180.0f / M_PI), angles.y * (180.0f / M_PI),
angles.z * (180.0f / M_PI));
@ -565,11 +565,11 @@ void RacingControlComponent::Update(float deltaTime) {
// to load in, can raise this if it's too low
if (m_LoadTimer >= 15) {
Game::logger->Log("RacingControlComponent",
"Loading all players...\n");
"Loading all players...");
for (size_t i = 0; i < m_LobbyPlayers.size(); i++) {
Game::logger->Log("RacingControlComponent",
"Loading player now!\n");
"Loading player now!");
auto *player =
EntityManager::Instance()->GetEntity(m_LobbyPlayers[i]);
@ -579,7 +579,7 @@ void RacingControlComponent::Update(float deltaTime) {
}
Game::logger->Log("RacingControlComponent",
"Loading player now NOW!\n");
"Loading player now NOW!");
LoadPlayerVehicle(player, true);
@ -729,7 +729,7 @@ void RacingControlComponent::Update(float deltaTime) {
m_Started = true;
Game::logger->Log("RacingControlComponent", "Starting race\n");
Game::logger->Log("RacingControlComponent", "Starting race");
EntityManager::Instance()->SerializeEntity(m_Parent);
@ -833,7 +833,7 @@ void RacingControlComponent::Update(float deltaTime) {
player.bestLapTime = lapTime;
Game::logger->Log("RacingControlComponent",
"Best lap time (%llu)\n", lapTime);
"Best lap time (%llu)", lapTime);
}
auto *missionComponent =
@ -854,7 +854,7 @@ void RacingControlComponent::Update(float deltaTime) {
player.raceTime = raceTime;
Game::logger->Log("RacingControlComponent",
"Completed time %llu, %llu\n",
"Completed time %llu, %llu",
raceTime, raceTime * 1000);
// Entire race time
@ -870,12 +870,12 @@ void RacingControlComponent::Update(float deltaTime) {
}
Game::logger->Log("RacingControlComponent",
"Lapped (%i) in (%llu)\n", player.lap,
"Lapped (%i) in (%llu)", player.lap,
lapTime);
}
Game::logger->Log("RacingControlComponent",
"Reached point (%i)/(%i)\n", player.respawnIndex,
"Reached point (%i)/(%i)", player.respawnIndex,
path->pathWaypoints.size());
break;

View File

@ -33,7 +33,7 @@ RebuildComponent::RebuildComponent(Entity* entity) : Component(entity) {
GeneralUtils::TryParse(positionAsVector[1], m_ActivatorPosition.y) &&
GeneralUtils::TryParse(positionAsVector[2], m_ActivatorPosition.z)) {
} else {
Game::logger->Log("RebuildComponent", "Failed to find activator position for lot %i. Defaulting to parents position.\n", m_Parent->GetLOT());
Game::logger->Log("RebuildComponent", "Failed to find activator position for lot %i. Defaulting to parents position.", m_Parent->GetLOT());
m_ActivatorPosition = m_Parent->GetPosition();
}
@ -437,7 +437,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
characterComponent->SetCurrentActivity(eGameActivities::ACTIVITY_NONE);
characterComponent->TrackRebuildComplete();
} else {
Game::logger->Log("RebuildComponent", "Some user tried to finish the rebuild but they didn't have a character somehow.\n");
Game::logger->Log("RebuildComponent", "Some user tried to finish the rebuild but they didn't have a character somehow.");
return;
}

View File

@ -57,7 +57,7 @@ void RocketLaunchpadControlComponent::Launch(Entity* originator, LWOMAPID mapId,
auto* rocket = characterComponent->GetRocket(originator);
if (!rocket) {
Game::logger->Log("RocketLaunchpadControlComponent", "Unable to find rocket!\n");
Game::logger->Log("RocketLaunchpadControlComponent", "Unable to find rocket!");
return;
}

View File

@ -246,7 +246,7 @@ void ScriptedActivityComponent::Update(float deltaTime) {
// The timer has elapsed, start the instance
if (lobby->timer <= 0.0f) {
Game::logger->Log("ScriptedActivityComponent", "Setting up instance.\n");
Game::logger->Log("ScriptedActivityComponent", "Setting up instance.");
ActivityInstance* instance = NewInstance();
LoadPlayersIntoInstance(instance, lobby->players);
@ -515,7 +515,7 @@ void ActivityInstance::StartZone() {
if (player == nullptr)
return;
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i\n", player->GetCharacter()->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", player->GetCharacter()->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (player->GetCharacter()) {
player->GetCharacter()->SetZoneID(zoneID);
player->GetCharacter()->SetZoneInstance(zoneInstance);

View File

@ -52,7 +52,7 @@ void SkillComponent::SyncPlayerSkill(const uint32_t skillUid, const uint32_t syn
if (index == this->m_managedBehaviors.end())
{
Game::logger->Log("SkillComponent", "Failed to find skill with uid (%i)!\n", skillUid, syncId);
Game::logger->Log("SkillComponent", "Failed to find skill with uid (%i)!", skillUid, syncId);
return;
}
@ -81,7 +81,7 @@ void SkillComponent::SyncPlayerProjectile(const LWOOBJID projectileId, RakNet::B
if (index == -1)
{
Game::logger->Log("SkillComponent", "Failed to find projectile id (%llu)!\n", projectileId);
Game::logger->Log("SkillComponent", "Failed to find projectile id (%llu)!", projectileId);
return;
}
@ -95,7 +95,7 @@ void SkillComponent::SyncPlayerProjectile(const LWOOBJID projectileId, RakNet::B
auto result = query.execQuery();
if (result.eof()) {
Game::logger->Log("SkillComponent", "Failed to find skill id for (%i)!\n", sync_entry.lot);
Game::logger->Log("SkillComponent", "Failed to find skill id for (%i)!", sync_entry.lot);
return;
}
@ -432,7 +432,7 @@ void SkillComponent::SyncProjectileCalculation(const ProjectileSyncEntry& entry)
if (other == nullptr) {
if (entry.branchContext.target != LWOOBJID_EMPTY)
{
Game::logger->Log("SkillComponent", "Invalid projectile target (%llu)!\n", entry.branchContext.target);
Game::logger->Log("SkillComponent", "Invalid projectile target (%llu)!", entry.branchContext.target);
}
return;
@ -444,7 +444,7 @@ void SkillComponent::SyncProjectileCalculation(const ProjectileSyncEntry& entry)
auto result = query.execQuery();
if (result.eof()) {
Game::logger->Log("SkillComponent", "Failed to find skill id for (%i)!\n", entry.lot);
Game::logger->Log("SkillComponent", "Failed to find skill id for (%i)!", entry.lot);
return;
}

View File

@ -40,7 +40,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
if (!entity)
{
Game::logger->Log("GameMessageHandler", "Failed to find associated entity (%llu), aborting GM (%X)!\n", objectID, messageID);
Game::logger->Log("GameMessageHandler", "Failed to find associated entity (%llu), aborting GM (%X)!", objectID, messageID);
return;
}
@ -157,7 +157,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
character->OnZoneLoad();
}
Game::logger->Log("GameMessageHandler", "Player %s (%llu) loaded.\n", entity->GetCharacter()->GetName().c_str(), entity->GetObjectID());
Game::logger->Log("GameMessageHandler", "Player %s (%llu) loaded.", entity->GetCharacter()->GetName().c_str(), entity->GetObjectID());
// After we've done our thing, tell the client they're ready
GameMessages::SendPlayerReady(dZoneManager::Instance()->GetZoneControlObject(), sysAddr);
@ -658,7 +658,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
break;
default:
//Game::logger->Log("GameMessageHandler", "Unknown game message ID: %X\n", messageID);
//Game::logger->Log("GameMessageHandler", "Unknown game message ID: %X", messageID);
break;
}
}

View File

@ -126,7 +126,7 @@ void GameMessages::SendTeleport(const LWOOBJID& objectID, const NiPoint3& pos, c
void GameMessages::SendPlayAnimation(Entity* entity, const std::u16string& animationName, float fPriority, float fScale) {
if (!entity) {
Game::logger->Log("SendPlayAnimation", "Trying to play animation, but entity var is nullptr!\n");
Game::logger->Log("SendPlayAnimation", "Trying to play animation, but entity var is nullptr!");
return;
}
@ -1613,7 +1613,7 @@ void GameMessages::HandleUpdateShootingGalleryRotation(RakNet::BitStream* inStre
void GameMessages::HandleActivitySummaryLeaderboardData(RakNet::BitStream* instream, Entity* entity,
const SystemAddress& sysAddr) {
Game::logger->Log("AGS", "We got mail!\n");
Game::logger->Log("AGS", "We got mail!");
}
void GameMessages::SendActivitySummaryLeaderboardData(const LWOOBJID& objectID, const Leaderboard* leaderboard, const SystemAddress& sysAddr) {
@ -1685,7 +1685,7 @@ void GameMessages::HandleActivityStateChangeRequest(RakNet::BitStream *inStream,
auto* assosiate = EntityManager::Instance()->GetEntity(objectID);
Game::logger->Log("Activity State Change", "%s [%i, %i] from %i to %i\n", GeneralUtils::UTF16ToWTF8(stringValue).c_str(), value1, value2, entity->GetLOT(), assosiate != nullptr ? assosiate->GetLOT() : 0);
Game::logger->Log("Activity State Change", "%s [%i, %i] from %i to %i", GeneralUtils::UTF16ToWTF8(stringValue).c_str(), value1, value2, entity->GetLOT(), assosiate != nullptr ? assosiate->GetLOT() : 0);
std::vector<Entity*> scriptedActs = EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_SHOOTING_GALLERY);
for (Entity* scriptEntity : scriptedActs) {
@ -1985,7 +1985,7 @@ void GameMessages::SendDownloadPropertyData(const LWOOBJID objectId, const Prope
data.Serialize(bitStream);
Game::logger->Log("SendDownloadPropertyData", "(%llu) sending property data (%d)\n", objectId, sysAddr == UNASSIGNED_SYSTEM_ADDRESS);
Game::logger->Log("SendDownloadPropertyData", "(%llu) sending property data (%d)", objectId, sysAddr == UNASSIGNED_SYSTEM_ADDRESS);
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST;
SEND_PACKET;
@ -2060,7 +2060,7 @@ void GameMessages::SendGetModelsOnProperty(LWOOBJID objectId, std::map<LWOOBJID,
bitStream.Write(pair.second);
}
Game::logger->Log("SendGetModelsOnProperty", "Sending property models to (%llu) (%d)\n", objectId, sysAddr == UNASSIGNED_SYSTEM_ADDRESS);
Game::logger->Log("SendGetModelsOnProperty", "Sending property models to (%llu) (%d)", objectId, sysAddr == UNASSIGNED_SYSTEM_ADDRESS);
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST;
SEND_PACKET;
@ -2167,7 +2167,7 @@ void GameMessages::HandleSetPropertyAccess(RakNet::BitStream* inStream, Entity*
inStream->Read(renewIsDefault);
if (renewIsDefault != 0) inStream->Read(renew);
Game::logger->Log("GameMessages", "Set privacy option to: %i\n", accessType);
Game::logger->Log("GameMessages", "Set privacy option to: %i", accessType);
if (PropertyManagementComponent::Instance() == nullptr) return;
@ -2211,7 +2211,7 @@ void GameMessages::HandleUpdatePropertyOrModelForFilterCheck(RakNet::BitStream*
void GameMessages::HandleQueryPropertyData(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr)
{
Game::logger->Log("HandleQueryPropertyData", "Entity (%i) requesting data\n", entity->GetLOT());
Game::logger->Log("HandleQueryPropertyData", "Entity (%i) requesting data", entity->GetLOT());
/*
auto entites = EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_PROPERTY_VENDOR);
@ -2270,7 +2270,7 @@ void GameMessages::HandleSetBuildMode(RakNet::BitStream* inStream, Entity* entit
player->GetCharacter()->SetBuildMode(start);
Game::logger->Log("GameMessages", "Sending build mode confirm (%i): (%d) (%i) (%d) (%i) (%llu)\n", entity->GetLOT(), start, distanceType, modePaused, modeValue, playerId);
Game::logger->Log("GameMessages", "Sending build mode confirm (%i): (%d) (%i) (%d) (%i) (%llu)", entity->GetLOT(), start, distanceType, modePaused, modeValue, playerId);
SendSetBuildModeConfirmed(entity->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS, start, false, modePaused, modeValue, playerId, startPosition);
}
@ -2308,7 +2308,7 @@ void GameMessages::HandleStartBuildingWithItem(RakNet::BitStream* inStream, Enti
sourceType = 4;
}
Game::logger->Log("GameMessages", "Handling start building with item (%i): (%d) (%d) (%i) (%llu) (%i) (%i) (%llu) (%i) (%i)\n", entity->GetLOT(), firstTime, success, sourceBag, sourceId, sourceLot, sourceType, targetId, targetLot, targetType);
Game::logger->Log("GameMessages", "Handling start building with item (%i): (%d) (%d) (%i) (%llu) (%i) (%i) (%llu) (%i) (%i)", entity->GetLOT(), firstTime, success, sourceBag, sourceId, sourceLot, sourceType, targetId, targetLot, targetType);
auto* user = UserManager::Instance()->GetUser(sysAddr);
@ -2408,7 +2408,7 @@ void GameMessages::HandleBBBLoadItemRequest(RakNet::BitStream* inStream, Entity*
LWOOBJID itemID = LWOOBJID_EMPTY;
inStream->Read(itemID);
Game::logger->Log("BBB", "Load item request for: " + std::to_string(itemID) + "\n");
Game::logger->Log("BBB", "Load item request for: " + std::to_string(itemID) + "");
CBITSTREAM;
PacketUtils::WriteHeader(bitStream, CLIENT, MSG_CLIENT_BLUEPRINT_LOAD_RESPONSE_ITEMID);
@ -2451,7 +2451,7 @@ void GameMessages::SendUnSmash(Entity* entity, LWOOBJID builderID, float duratio
void GameMessages::HandleControlBehaviors(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
// TODO
Game::logger->Log("GameMessages", "Recieved Control Behavior GameMessage, but property behaviors are unimplemented.\n");
Game::logger->Log("GameMessages", "Recieved Control Behavior GameMessage, but property behaviors are unimplemented.");
}
void GameMessages::HandleBBBSaveRequest(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
@ -2531,7 +2531,7 @@ void GameMessages::HandleBBBSaveRequest(RakNet::BitStream* inStream, Entity* ent
//int32_t size = ZCompression::Decompress(inData, lxfmlSize, outData, 327680, error);
//if (size == -1) {
// Game::logger->Log("GameMessages", "Failed to decompress LXFML: (%i)\n", error);
// Game::logger->Log("GameMessages", "Failed to decompress LXFML: (%i)", error);
// return;
//}
//
@ -3259,7 +3259,7 @@ void GameMessages::HandleClientTradeRequest(RakNet::BitStream* inStream, Entity*
return;
}
Game::logger->Log("GameMessages", "Trade request to (%llu)\n", i64Invitee);
Game::logger->Log("GameMessages", "Trade request to (%llu)", i64Invitee);
auto* trade = TradingManager::Instance()->GetPlayerTrade(entity->GetObjectID());
@ -3293,7 +3293,7 @@ void GameMessages::HandleClientTradeCancel(RakNet::BitStream* inStream, Entity*
if (trade == nullptr) return;
Game::logger->Log("GameMessages", "Trade canceled from (%llu)\n", entity->GetObjectID());
Game::logger->Log("GameMessages", "Trade canceled from (%llu)", entity->GetObjectID());
TradingManager::Instance()->CancelTrade(trade->GetTradeId());
}
@ -3302,7 +3302,7 @@ void GameMessages::HandleClientTradeAccept(RakNet::BitStream* inStream, Entity*
{
bool bFirst = inStream->ReadBit();
Game::logger->Log("GameMessages", "Trade accepted from (%llu) -> (%d)\n", entity->GetObjectID(), bFirst);
Game::logger->Log("GameMessages", "Trade accepted from (%llu) -> (%d)", entity->GetObjectID(), bFirst);
auto* trade = TradingManager::Instance()->GetPlayerTrade(entity->GetObjectID());
@ -3319,7 +3319,7 @@ void GameMessages::HandleClientTradeUpdate(RakNet::BitStream* inStream, Entity*
inStream->Read(currency);
inStream->Read(itemCount);
Game::logger->Log("GameMessages", "Trade update from (%llu) -> (%llu), (%i)\n", entity->GetObjectID(), currency, itemCount);
Game::logger->Log("GameMessages", "Trade update from (%llu) -> (%llu), (%i)", entity->GetObjectID(), currency, itemCount);
std::vector<TradeItem> items {};
@ -3375,7 +3375,7 @@ void GameMessages::HandleClientTradeUpdate(RakNet::BitStream* inStream, Entity*
items.push_back({itemId, lot, unknown2});
Game::logger->Log("GameMessages", "Trade item from (%llu) -> (%llu)/(%llu), (%i), (%llu), (%i), (%i)\n", entity->GetObjectID(), itemId, itemId2, lot, unknown1, unknown2, unknown3);
Game::logger->Log("GameMessages", "Trade item from (%llu) -> (%llu)/(%llu), (%i), (%llu), (%i), (%i)", entity->GetObjectID(), itemId, itemId2, lot, unknown1, unknown2, unknown3);
}
auto* trade = TradingManager::Instance()->GetPlayerTrade(entity->GetObjectID());
@ -3848,7 +3848,7 @@ void GameMessages::HandleMessageBoxResponse(RakNet::BitStream* inStream, Entity*
userData.push_back(character);
}
Game::logger->Log("HandleMessageBoxResponse", "Button: " + std::to_string(iButton) + "; LOT: " + std::to_string(entity->GetLOT()) + " identifier: " + GeneralUtils::UTF16ToWTF8(identifier) + "; userData: " + GeneralUtils::UTF16ToWTF8(userData) + "\n");
Game::logger->Log("HandleMessageBoxResponse", "Button: " + std::to_string(iButton) + "; LOT: " + std::to_string(entity->GetLOT()) + " identifier: " + GeneralUtils::UTF16ToWTF8(identifier) + "; userData: " + GeneralUtils::UTF16ToWTF8(userData));
auto* user = UserManager::Instance()->GetUser(sysAddr);
@ -3912,7 +3912,7 @@ void GameMessages::HandleChoiceBoxRespond(RakNet::BitStream* inStream, Entity* e
identifier.push_back(character);
}
Game::logger->Log("HandleChoiceBoxRespond", "Button: " + std::to_string(iButton) + "; LOT: " + std::to_string(entity->GetLOT()) + " buttonIdentifier: " + GeneralUtils::UTF16ToWTF8(buttonIdentifier) + "; userData: " + GeneralUtils::UTF16ToWTF8(identifier) + "\n");
Game::logger->Log("HandleChoiceBoxRespond", "Button: " + std::to_string(iButton) + "; LOT: " + std::to_string(entity->GetLOT()) + " buttonIdentifier: " + GeneralUtils::UTF16ToWTF8(buttonIdentifier) + "; userData: " + GeneralUtils::UTF16ToWTF8(identifier));
auto* user = UserManager::Instance()->GetUser(sysAddr);
@ -4057,7 +4057,7 @@ void GameMessages::HandleDismountComplete(RakNet::BitStream* inStream, Entity* e
void GameMessages::HandleAcknowledgePossession(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
Game::logger->Log("HandleAcknowledgePossession", "Got AcknowledgePossession from %i\n", entity->GetLOT());
Game::logger->Log("HandleAcknowledgePossession", "Got AcknowledgePossession from %i", entity->GetLOT());
EntityManager::Instance()->SerializeEntity(entity);
}
@ -4067,11 +4067,11 @@ void GameMessages::HandleModuleAssemblyQueryData(RakNet::BitStream* inStream, En
{
auto* moduleAssemblyComponent = entity->GetComponent<ModuleAssemblyComponent>();
Game::logger->Log("HandleModuleAssemblyQueryData", "Got Query from %i\n", entity->GetLOT());
Game::logger->Log("HandleModuleAssemblyQueryData", "Got Query from %i", entity->GetLOT());
if (moduleAssemblyComponent != nullptr)
{
Game::logger->Log("HandleModuleAssemblyQueryData", "Returning assembly %s\n", GeneralUtils::UTF16ToWTF8(moduleAssemblyComponent->GetAssemblyPartsLOTs()).c_str());
Game::logger->Log("HandleModuleAssemblyQueryData", "Returning assembly %s", GeneralUtils::UTF16ToWTF8(moduleAssemblyComponent->GetAssemblyPartsLOTs()).c_str());
SendModuleAssemblyDBDataForClient(entity->GetObjectID(), moduleAssemblyComponent->GetSubKey(), moduleAssemblyComponent->GetAssemblyPartsLOTs(), UNASSIGNED_SYSTEM_ADDRESS);
}
@ -4163,7 +4163,7 @@ void GameMessages::HandleRequestDie(RakNet::BitStream* inStream, Entity* entity,
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
Game::logger->Log("HandleRequestDie", "Got die request: %i\n", entity->GetLOT());
Game::logger->Log("HandleRequestDie", "Got die request: %i", entity->GetLOT());
if (racingControlComponent != nullptr)
{
@ -4213,7 +4213,7 @@ void GameMessages::HandleRacingPlayerInfoResetFinished(RakNet::BitStream* inStre
auto* racingControlComponent = zoneController->GetComponent<RacingControlComponent>();
Game::logger->Log("HandleRacingPlayerInfoResetFinished", "Got finished: %i\n", entity->GetLOT());
Game::logger->Log("HandleRacingPlayerInfoResetFinished", "Got finished: %i", entity->GetLOT());
if (racingControlComponent != nullptr)
{
@ -5011,7 +5011,7 @@ void GameMessages::HandleFireEventServerSide(RakNet::BitStream* inStream, Entity
mapId = dZoneManager::Instance()->GetZoneID().GetMapID(); // Fallback to sending the player back to the same zone.
}
Game::logger->Log("FireEventServerSide", "Player %llu has requested zone transfer to (%i, %i).\n", sender->GetObjectID(), (int) mapId, (int) cloneId);
Game::logger->Log("FireEventServerSide", "Player %llu has requested zone transfer to (%i, %i).", sender->GetObjectID(), (int) mapId, (int) cloneId);
auto* character = player->GetCharacter();
@ -5020,7 +5020,7 @@ void GameMessages::HandleFireEventServerSide(RakNet::BitStream* inStream, Entity
}
ZoneInstanceManager::Instance()->RequestZoneTransfer(Game::server, mapId, cloneId, false, [=](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i\n", character->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", character->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (character) {
character->SetZoneID(zoneID);
@ -5071,7 +5071,7 @@ void GameMessages::HandleRequestUse(RakNet::BitStream* inStream, Entity* entity,
if (interactedObject == nullptr)
{
Game::logger->Log("GameMessages", "Object %llu tried to interact, but doesn't exist!\n", objectID);
Game::logger->Log("GameMessages", "Object %llu tried to interact, but doesn't exist!", objectID);
return;
}
@ -5117,7 +5117,7 @@ void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity)
inStream->Read(emoteID);
inStream->Read(targetID);
Game::logger->Log("GameMessages", "Emote (%i) (%llu)\n", emoteID, targetID);
Game::logger->Log("GameMessages", "Emote (%i) (%llu)", emoteID, targetID);
//TODO: If targetID != 0, and we have one of the "perform emote" missions, complete them.
@ -5133,7 +5133,7 @@ void GameMessages::HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity)
{
auto* targetEntity = EntityManager::Instance()->GetEntity(targetID);
Game::logger->Log("GameMessages", "Emote target found (%d)\n", targetEntity != nullptr);
Game::logger->Log("GameMessages", "Emote target found (%d)", targetEntity != nullptr);
if (targetEntity != nullptr)
{
@ -5218,7 +5218,7 @@ void GameMessages::HandleRespondToMission(RakNet::BitStream* inStream, Entity* e
MissionComponent* missionComponent = static_cast<MissionComponent*>(entity->GetComponent(COMPONENT_TYPE_MISSION));
if (!missionComponent) {
Game::logger->Log("GameMessages", "Unable to get mission component for entity %llu to handle RespondToMission\n", playerID);
Game::logger->Log("GameMessages", "Unable to get mission component for entity %llu to handle RespondToMission", playerID);
return;
}
@ -5227,13 +5227,13 @@ void GameMessages::HandleRespondToMission(RakNet::BitStream* inStream, Entity* e
mission->SetReward(reward);
}
else {
Game::logger->Log("GameMessages", "Unable to get mission %i for entity %llu to update reward in RespondToMission\n", missionID, playerID);
Game::logger->Log("GameMessages", "Unable to get mission %i for entity %llu to update reward in RespondToMission", missionID, playerID);
}
Entity* offerer = EntityManager::Instance()->GetEntity(receiverID);
if (offerer == nullptr) {
Game::logger->Log("GameMessages", "Unable to get receiver entity %llu for RespondToMission\n", receiverID);
Game::logger->Log("GameMessages", "Unable to get receiver entity %llu for RespondToMission", receiverID);
return;
}
@ -5262,7 +5262,7 @@ void GameMessages::HandleMissionDialogOK(RakNet::BitStream* inStream, Entity* en
// Get the player's mission component
MissionComponent* missionComponent = static_cast<MissionComponent*>(player->GetComponent(COMPONENT_TYPE_MISSION));
if (!missionComponent) {
Game::logger->Log("GameMessages", "Unable to get mission component for entity %llu to handle MissionDialogueOK\n", player->GetObjectID());
Game::logger->Log("GameMessages", "Unable to get mission component for entity %llu to handle MissionDialogueOK", player->GetObjectID());
return;
}
@ -5608,7 +5608,7 @@ void GameMessages::HandleBuildModeSet(RakNet::BitStream* inStream, Entity* entit
inStream->Read(bStart);
// there's more here but we don't need it (for now?)
Game::logger->Log("GameMessages", "Set build mode to (%d) for (%llu)\n", bStart, entity->GetObjectID());
Game::logger->Log("GameMessages", "Set build mode to (%d) for (%llu)", bStart, entity->GetObjectID());
if (entity->GetCharacter()) {
entity->GetCharacter()->SetBuildMode(bStart);
@ -5623,7 +5623,7 @@ void GameMessages::HandleModularBuildFinish(RakNet::BitStream* inStream, Entity*
InventoryComponent* inv = static_cast<InventoryComponent*>(character->GetComponent(COMPONENT_TYPE_INVENTORY));
if (!inv) return;
Game::logger->Log("GameMessages", "Build finished\n");
Game::logger->Log("GameMessages", "Build finished");
GameMessages::SendFinishArrangingWithItem(character, entity->GetObjectID()); // kick them from modular build
GameMessages::SendModularBuildEnd(character); // i dont know if this does anything but DLUv2 did it
@ -5753,7 +5753,7 @@ void GameMessages::HandleDoneArrangingWithItem(RakNet::BitStream* inStream, Enti
/*
Game::logger->Log("GameMessages",
"\nnewSourceBAG: %d\nnewSourceID: %llu\nnewSourceLOT: %d\nnewSourceTYPE: %d\nnewTargetID: %llu\nnewTargetLOT: %d\nnewTargetTYPE: %d\nnewTargetPOS: %f, %f, %f\noldItemBAG: %d\noldItemID: %llu\noldItemLOT: %d\noldItemTYPE: %d\n",
"\nnewSourceBAG: %d\nnewSourceID: %llu\nnewSourceLOT: %d\nnewSourceTYPE: %d\nnewTargetID: %llu\nnewTargetLOT: %d\nnewTargetTYPE: %d\nnewTargetPOS: %f, %f, %f\noldItemBAG: %d\noldItemID: %llu\noldItemLOT: %d\noldItemTYPE: %d",
newSourceBAG, newSourceID, newSourceLOT, newSourceTYPE, newTargetID, newTargetLOT, newTargetTYPE, newTargetPOS.x, newTargetPOS.y, newTargetPOS.z, oldItemBAG, oldItemID, oldItemLOT, oldItemTYPE
);
*/
@ -5771,15 +5771,15 @@ void GameMessages::HandleDoneArrangingWithItem(RakNet::BitStream* inStream, Enti
else if (!entities.empty()) {
buildArea = entities[0];
Game::logger->Log("BuildBorderComponent", "Using PropertyPlaque\n");
Game::logger->Log("BuildBorderComponent", "Using PropertyPlaque");
}
else {
Game::logger->Log("BuildBorderComponent", "No build area found\n");
Game::logger->Log("BuildBorderComponent", "No build area found");
return;
}
Game::logger->Log("GameMessages", "Build area found: %llu\n", buildArea->GetObjectID());
Game::logger->Log("GameMessages", "Build area found: %llu", buildArea->GetObjectID());
GameMessages::SendStartArrangingWithItem(
character,
@ -5798,7 +5798,7 @@ void GameMessages::HandleDoneArrangingWithItem(RakNet::BitStream* inStream, Enti
);
}
Game::logger->Log("GameMessages", "Done Arranging\n");
Game::logger->Log("GameMessages", "Done Arranging");
//GenericInventory* models = inv->GetGenericInventory(MODELS);
//GenericInventory* tempModels = inv->GetGenericInventory(TEMP_MODELS);
@ -5824,7 +5824,7 @@ void GameMessages::HandleModularBuildMoveAndEquip(RakNet::BitStream* inStream, E
Entity* character = EntityManager::Instance()->GetEntity(user->GetLoggedInChar());
if (!character) return;
Game::logger->Log("GameMessages", "Build and move\n");
Game::logger->Log("GameMessages", "Build and move");
LOT templateID;
@ -6099,7 +6099,7 @@ void GameMessages::HandleReportBug(RakNet::BitStream* inStream, Entity* entity)
delete insertBug;
}
catch (sql::SQLException& e) {
Game::logger->Log("HandleReportBug", "Couldn't save bug report! (%s)\n", e.what());
Game::logger->Log("HandleReportBug", "Couldn't save bug report! (%s)", e.what());
}
}

View File

@ -231,7 +231,7 @@ void Inventory::AddManagedItem(Item* item)
if (items.find(id) != items.end())
{
Game::logger->Log("Inventory", "Attempting to add an item with an already present id (%llu)!\n", id);
Game::logger->Log("Inventory", "Attempting to add an item with an already present id (%llu)!", id);
return;
}
@ -242,7 +242,7 @@ void Inventory::AddManagedItem(Item* item)
if (slots.find(slot) != slots.end())
{
Game::logger->Log("Inventory", "Attempting to add an item with an already present slot (%i)!\n", slot);
Game::logger->Log("Inventory", "Attempting to add an item with an already present slot (%i)!", slot);
return;
}
@ -258,7 +258,7 @@ void Inventory::RemoveManagedItem(Item* item)
if (items.find(id) == items.end())
{
Game::logger->Log("Inventory", "Attempting to remove an item with an invalid id (%llu), lot (%i)!\n", id, item->GetLot());
Game::logger->Log("Inventory", "Attempting to remove an item with an invalid id (%llu), lot (%i)!", id, item->GetLot());
return;
}
@ -325,7 +325,7 @@ const CDItemComponent& Inventory::FindItemComponent(const LOT lot)
if (componentId == 0)
{
Game::logger->Log("Inventory", "Failed to find item component for (%i)!\n", lot);
Game::logger->Log("Inventory", "Failed to find item component for (%i)!", lot);
return CDItemComponentTable::Default;
}

View File

@ -87,7 +87,7 @@ Item::Item(
{
Equip();
Game::logger->Log("Item", "Move and equipped (%i) from (%i)\n", this->lot, this->inventory->GetType());
Game::logger->Log("Item", "Move and equipped (%i) from (%i)", this->lot, this->inventory->GetType());
EntityManager::Instance()->SerializeEntity(inventory->GetComponent()->GetParent());
}
@ -287,7 +287,7 @@ bool Item::Consume()
}
}
Game::logger->Log("Item", "Consumed (%i) / (%llu) with (%d)\n", lot, id, success);
Game::logger->Log("Item", "Consumed (%i) / (%llu) with (%d)", lot, id, success);
GameMessages::SendUseItemResult(inventory->GetComponent()->GetParent(), lot, success);
@ -343,7 +343,7 @@ bool Item::UseNonEquip()
LootGenerator::Instance().GiveLoot(inventory->GetComponent()->GetParent(), result, eLootSourceType::LOOT_SOURCE_CONSUMPTION);
}
Game::logger->Log("Item", "Used (%i)\n", lot);
Game::logger->Log("Item", "Used (%i)", lot);
inventory->GetComponent()->RemoveItem(lot, 1);
}

View File

@ -35,7 +35,7 @@ Mission::Mission(MissionComponent* missionComponent, const uint32_t missionId) {
info = missionsTable->GetPtrByMissionID(missionId);
if (info == &CDMissionsTable::Default) {
Game::logger->Log("Missions", "Failed to find mission (%i)!\n", missionId);
Game::logger->Log("Missions", "Failed to find mission (%i)!", missionId);
return;
}

View File

@ -265,7 +265,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
entity = EntityManager::Instance()->GetEntity(associate);
if (entity == nullptr) {
if (associate != LWOOBJID_EMPTY) {
Game::logger->Log("MissionTask", "Failed to find associated entity (%llu)!\n", associate);
Game::logger->Log("MissionTask", "Failed to find associated entity (%llu)!", associate);
}
break;
}
@ -310,7 +310,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
if (entity == nullptr)
{
Game::logger->Log("MissionTask", "Failed to find associated entity (%llu)!\n", associate);
Game::logger->Log("MissionTask", "Failed to find associated entity (%llu)!", associate);
break;
}
@ -385,7 +385,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
if (entity == nullptr)
{
Game::logger->Log("MissionTask", "Failed to find associated entity (%llu)!\n", associate);
Game::logger->Log("MissionTask", "Failed to find associated entity (%llu)!", associate);
break;
}
@ -495,7 +495,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
break;
}
default:
Game::logger->Log("MissionTask", "Invalid mission task type (%i)!\n", static_cast<int>(type));
Game::logger->Log("MissionTask", "Invalid mission task type (%i)!", static_cast<int>(type));
return;
}

View File

@ -152,7 +152,7 @@ void Mail::HandleMailStuff(RakNet::BitStream* packet, const SystemAddress& sysAd
Mail::HandleSendMail(packet, sysAddr, entity);
break;
default:
Game::logger->Log("Mail", "Unhandled and possibly undefined MailStuffID: %i\n", int(stuffID));
Game::logger->Log("Mail", "Unhandled and possibly undefined MailStuffID: %i", int(stuffID));
}
});
}
@ -264,10 +264,10 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd
Mail::SendSendResponse(sysAddr, Mail::MailSendResponse::Success);
entity->GetCharacter()->SetCoins(entity->GetCharacter()->GetCoins() - mailCost, eLootSourceType::LOOT_SOURCE_MAIL);
Game::logger->Log("Mail", "Seeing if we need to remove item with ID/count/LOT: %i %i %i\n", itemID, attachmentCount, itemLOT);
Game::logger->Log("Mail", "Seeing if we need to remove item with ID/count/LOT: %i %i %i", itemID, attachmentCount, itemLOT);
if (inv && itemLOT != 0 && attachmentCount > 0 && item) {
Game::logger->Log("Mail", "Trying to remove item with ID/count/LOT: %i %i %i\n", itemID, attachmentCount, itemLOT);
Game::logger->Log("Mail", "Trying to remove item with ID/count/LOT: %i %i %i", itemID, attachmentCount, itemLOT);
inv->RemoveItem(itemLOT, attachmentCount, INVALID, true);
auto* missionCompoent = entity->GetComponent<MissionComponent>();

View File

@ -29,7 +29,7 @@ Precondition::Precondition(const uint32_t condition) {
this->count = 1;
this->values = { 0 };
Game::logger->Log("Precondition", "Failed to find precondition of id (%i)!\n", condition);
Game::logger->Log("Precondition", "Failed to find precondition of id (%i)!", condition);
return;
}

View File

@ -102,7 +102,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
break;
}
//Game::logger->Log("SlashCommandHandler", "Received chat command \"%s\"\n", GeneralUtils::UTF16ToWTF8(command).c_str());
//Game::logger->Log("SlashCommandHandler", "Received chat command \"%s\"", GeneralUtils::UTF16ToWTF8(command).c_str());
User* user = UserManager::Instance()->GetUser(sysAddr);
if ((chatCommand == "setgmlevel" || chatCommand == "makegm" || chatCommand == "gmlevel") && user->GetMaxGMLevel() > GAME_MASTER_LEVEL_CIVILIAN) {
@ -145,7 +145,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
WorldPackets::SendGMLevelChange(sysAddr, success, user->GetMaxGMLevel(), entity->GetGMLevel(), level);
GameMessages::SendChatModeUpdate(entity->GetObjectID(), level);
entity->SetGMLevel(level);
Game::logger->Log("SlashCommandHandler", "User %s (%i) has changed their GM level to %i for charID %llu\n", user->GetUsername().c_str(), user->GetAccountID(), level, entity->GetObjectID());
Game::logger->Log("SlashCommandHandler", "User %s (%i) has changed their GM level to %i for charID %llu", user->GetUsername().c_str(), user->GetAccountID(), level, entity->GetObjectID());
}
}
@ -170,7 +170,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
auto* character = entity->GetComponent<CharacterComponent>();
if (character == nullptr) {
Game::logger->Log("SlashCommandHandler", "Failed to find character component!\n");
Game::logger->Log("SlashCommandHandler", "Failed to find character component!");
return;
}
@ -289,7 +289,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
args.InsertValue("visible", new AMFTrueValue());
args.InsertValue("text", text);
Game::logger->Log("SlashCommandHandler", "Sending \n%s\n", customText.c_str());
Game::logger->Log("SlashCommandHandler", "Sending %s", customText.c_str());
GameMessages::SendUIMessageServerToSingleClient(entity, entity->GetSystemAddress(), "ToggleStoryBox", &args);
});
@ -324,7 +324,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
const auto sysAddr = entity->GetSystemAddress();
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i\n", entity->GetCharacter()->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", entity->GetCharacter()->GetName().c_str(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (entity->GetCharacter()) {
entity->GetCharacter()->SetZoneID(zoneID);
@ -344,7 +344,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
ZoneInstanceManager::Instance()->RequestPrivateZone(Game::server, false, password, [=](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort)
{
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i\n", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (entity->GetCharacter()) {
entity->GetCharacter()->SetZoneID(zoneID);
@ -920,7 +920,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
pos.SetY(y);
pos.SetZ(z);
Game::logger->Log("SlashCommandHandler", "Teleporting objectID: %llu to %f, %f, %f\n", entity->GetObjectID(), pos.x, pos.y, pos.z);
Game::logger->Log("SlashCommandHandler", "Teleporting objectID: %llu to %f, %f, %f", entity->GetObjectID(), pos.x, pos.y, pos.z);
GameMessages::SendTeleport(entity->GetObjectID(), pos, NiQuaternion(), sysAddr);
} else if (args.size() == 2) {
@ -942,7 +942,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
pos.SetY(0.0f);
pos.SetZ(z);
Game::logger->Log("SlashCommandHandler", "Teleporting objectID: %llu to X: %f, Z: %f\n", entity->GetObjectID(), pos.x, pos.z);
Game::logger->Log("SlashCommandHandler", "Teleporting objectID: %llu to X: %f, Z: %f", entity->GetObjectID(), pos.x, pos.z);
GameMessages::SendTeleport(entity->GetObjectID(), pos, NiQuaternion(), sysAddr);
} else {
ChatPackets::SendSystemMessage(sysAddr, u"Correct usage: /teleport <x> (<y>) <z> - if no Y given, will teleport to the height of the terrain (or any physics object).");
@ -964,7 +964,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
EntityManager::Instance()->SerializeEntity(possassableEntity);
Game::logger->Log("ClientPackets", "Forced updated vehicle position\n");
Game::logger->Log("ClientPackets", "Forced updated vehicle position");
}
}
}
@ -1522,7 +1522,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
ChatPackets::SendSystemMessage(sysAddr, u"Transfering map...");
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i\n", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
Game::logger->Log("UserManager", "Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP.c_str(), serverPort);
if (entity->GetCharacter()) {
entity->GetCharacter()->SetZoneID(zoneID);
entity->GetCharacter()->SetZoneInstance(zoneInstance);

View File

@ -48,7 +48,7 @@ void VanityUtilities::SpawnVanity()
std::vector<VanityNPC> npcList = m_NPCs;
std::vector<uint32_t> taken = {};
Game::logger->Log("VanityUtilities", "Spawning party with %i locations\n", party.m_Locations.size());
Game::logger->Log("VanityUtilities", "Spawning party with %i locations", party.m_Locations.size());
// Loop through all locations
for (const auto& location : party.m_Locations) {
@ -187,7 +187,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* npcs = doc.FirstChildElement("npcs");
if (npcs == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPCs\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPCs");
return;
}
@ -211,7 +211,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* locations = party->FirstChildElement("locations");
if (locations == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse party locations\n");
Game::logger->Log("VanityUtilities", "Failed to parse party locations");
continue;
}
@ -228,7 +228,7 @@ void VanityUtilities::ParseXML(const std::string& file)
if (x == nullptr || y == nullptr || z == nullptr || rw == nullptr || rx == nullptr || ry == nullptr
|| rz == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse party location data\n");
Game::logger->Log("VanityUtilities", "Failed to parse party location data");
continue;
}
@ -246,7 +246,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* partyPhrases = npcs->FirstChildElement("partyphrases");
if (partyPhrases == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse party phrases\n");
Game::logger->Log("VanityUtilities", "Failed to parse party phrases");
return;
}
@ -256,7 +256,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* text = phrase->GetText();
if (text == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse party phrase\n");
Game::logger->Log("VanityUtilities", "Failed to parse party phrase");
continue;
}
@ -268,7 +268,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* name = npc->Attribute("name");
if (name == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC name\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC name");
continue;
}
@ -276,7 +276,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* lot = npc->Attribute("lot");
if (lot == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC lot\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC lot");
continue;
}
@ -284,7 +284,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* equipment = npc->FirstChildElement("equipment");
if (equipment == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC equipment\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC equipment");
continue;
}
@ -306,7 +306,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* phrases = npc->FirstChildElement("phrases");
if (phrases == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC phrases\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC phrases");
continue;
}
@ -318,7 +318,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* text = phrase->GetText();
if (text == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC phrase\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC phrase");
continue;
}
@ -334,7 +334,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* scriptNameAttribute = scriptElement->Attribute("name");
if (scriptNameAttribute == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC script name\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC script name");
continue;
}
@ -358,7 +358,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* name = flag->Attribute("name");
if (name == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC flag name\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC flag name");
continue;
}
@ -366,7 +366,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* value = flag->Attribute("value");
if (value == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC flag value\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC flag value");
continue;
}
@ -380,7 +380,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* zoneID = zone->Attribute("id");
if (zoneID == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC zone ID\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC zone ID");
continue;
}
@ -388,7 +388,7 @@ void VanityUtilities::ParseXML(const std::string& file)
auto* locations = zone->FirstChildElement("locations");
if (locations == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC locations\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC locations");
continue;
}
@ -405,7 +405,7 @@ void VanityUtilities::ParseXML(const std::string& file)
if (x == nullptr || y == nullptr || z == nullptr || rw == nullptr || rx == nullptr || ry == nullptr
|| rz == nullptr) {
Game::logger->Log("VanityUtilities", "Failed to parse NPC location data\n");
Game::logger->Log("VanityUtilities", "Failed to parse NPC location data");
continue;
}

View File

@ -26,7 +26,7 @@ InstanceManager::~InstanceManager() {
}
Instance * InstanceManager::GetInstance(LWOMAPID mapID, bool isFriendTransfer, LWOCLONEID cloneID) {
mLogger->Log("InstanceManager", "Searching for an instance for mapID %i/%i\n", mapID, cloneID);
mLogger->Log("InstanceManager", "Searching for an instance for mapID %i/%i", mapID, cloneID);
Instance* instance = FindInstance(mapID, isFriendTransfer, cloneID);
if (instance) return instance;
@ -78,10 +78,10 @@ Instance * InstanceManager::GetInstance(LWOMAPID mapID, bool isFriendTransfer, L
m_Instances.push_back(instance);
if (instance) {
mLogger->Log("InstanceManager", "Created new instance: %i/%i/%i with min/max %i/%i\n", mapID, m_LastInstanceID, cloneID, softCap, maxPlayers);
mLogger->Log("InstanceManager", "Created new instance: %i/%i/%i with min/max %i/%i", mapID, m_LastInstanceID, cloneID, softCap, maxPlayers);
return instance;
}
else mLogger->Log("InstanceManager", "Failed to create a new instance!\n");
else mLogger->Log("InstanceManager", "Failed to create a new instance!");
return nullptr;
}
@ -174,7 +174,7 @@ void InstanceManager::ReadyInstance(Instance* instance)
{
const auto& zoneId = instance->GetZoneID();
Game::logger->Log("InstanceManager", "Responding to pending request %llu -> %i (%i)\n", request, zoneId.GetMapID(), zoneId.GetCloneID());
Game::logger->Log("InstanceManager", "Responding to pending request %llu -> %i (%i)", request, zoneId.GetMapID(), zoneId.GetCloneID());
MasterPackets::SendZoneTransferResponse(
Game::server,
@ -204,7 +204,7 @@ void InstanceManager::RequestAffirmation(Instance* instance, const PendingInstan
Game::server->Send(&bitStream, instance->GetSysAddr(), false);
Game::logger->Log("MasterServer", "Sent affirmation request %llu to %i/%i\n", request.id,
Game::logger->Log("MasterServer", "Sent affirmation request %llu to %i/%i", request.id,
static_cast<int>(instance->GetZoneID().GetMapID()),
static_cast<int>(instance->GetZoneID().GetCloneID())
);
@ -339,7 +339,7 @@ Instance* InstanceManager::CreatePrivateInstance(LWOMAPID mapID, LWOCLONEID clon
m_Instances.push_back(instance);
if (instance) return instance;
else mLogger->Log("InstanceManager", "Failed to create a new instance!\n");
else mLogger->Log("InstanceManager", "Failed to create a new instance!");
return instance;
}
@ -355,7 +355,7 @@ Instance* InstanceManager::FindPrivateInstance(const std::string& password)
continue;
}
mLogger->Log("InstanceManager", "Password: %s == %s => %d\n", password.c_str(), instance->GetPassword().c_str(), password == instance->GetPassword());
mLogger->Log("InstanceManager", "Password: %s == %s => %d", password.c_str(), instance->GetPassword().c_str(), password == instance->GetPassword());
if (instance->GetPassword() == password)
{
@ -410,5 +410,5 @@ void Instance::Shutdown()
Game::server->Send(&bitStream, this->m_SysAddr, false);
Game::logger->Log("Instance", "Triggered world shutdown\n");
Game::logger->Log("Instance", "Triggered world shutdown");
}

View File

@ -75,9 +75,9 @@ int main(int argc, char** argv) {
Game::logger = SetupLogger();
if (!Game::logger) return EXIT_FAILURE;
Game::logger->Log("MasterServer", "Starting Master server...\n");
Game::logger->Log("MasterServer", "Version: %i.%i\n", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR);
Game::logger->Log("MasterServer", "Compiled on: %s\n", __TIMESTAMP__);
Game::logger->Log("MasterServer", "Starting Master server...");
Game::logger->Log("MasterServer", "Version: %i.%i", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR);
Game::logger->Log("MasterServer", "Compiled on: %s", __TIMESTAMP__);
//Read our config:
dConfig config("masterconfig.ini");
@ -95,13 +95,13 @@ int main(int argc, char** argv) {
try {
Database::Connect(mysql_host, mysql_database, mysql_username, mysql_password);
} catch (sql::SQLException& ex) {
Game::logger->Log("MasterServer", "Got an error while connecting to the database: %s\n", ex.what());
Game::logger->Log("MigrationRunner", "Migrations not run\n");
Game::logger->Log("MasterServer", "Got an error while connecting to the database: %s", ex.what());
Game::logger->Log("MigrationRunner", "Migrations not run");
return EXIT_FAILURE;
}
MigrationRunner::RunMigrations();
Game::logger->Log("MigrationRunner", "Finished running migrations\n");
Game::logger->Log("MigrationRunner", "Finished running migrations");
return EXIT_SUCCESS;
}
@ -111,7 +111,7 @@ int main(int argc, char** argv) {
const std::string cdclient_path = "./res/CDServer.sqlite";
std::ifstream cdclient_fd(cdclient_path);
if (!cdclient_fd.good()) {
Game::logger->Log("WorldServer", "%s could not be opened\n", cdclient_path.c_str());
Game::logger->Log("WorldServer", "%s could not be opened", cdclient_path.c_str());
return EXIT_FAILURE;
}
cdclient_fd.close();
@ -120,9 +120,9 @@ int main(int argc, char** argv) {
try {
CDClientDatabase::Connect(cdclient_path);
} catch (CppSQLite3Exception& e) {
Game::logger->Log("WorldServer", "Unable to connect to CDServer SQLite Database\n");
Game::logger->Log("WorldServer", "Error: %s\n", e.errorMessage());
Game::logger->Log("WorldServer", "Error Code: %i\n", e.errorCode());
Game::logger->Log("WorldServer", "Unable to connect to CDServer SQLite Database");
Game::logger->Log("WorldServer", "Error: %s", e.errorMessage());
Game::logger->Log("WorldServer", "Error Code: %i", e.errorCode());
return EXIT_FAILURE;
}
@ -130,10 +130,10 @@ int main(int argc, char** argv) {
try {
CDClientManager::Instance()->Initialize();
} catch (CppSQLite3Exception& e) {
Game::logger->Log("WorldServer", "Failed to initialize CDServer SQLite Database\n");
Game::logger->Log("WorldServer", "May be caused by corrupted file: %s\n", cdclient_path.c_str());
Game::logger->Log("WorldServer", "Error: %s\n", e.errorMessage());
Game::logger->Log("WorldServer", "Error Code: %i\n", e.errorCode());
Game::logger->Log("WorldServer", "Failed to initialize CDServer SQLite Database");
Game::logger->Log("WorldServer", "May be caused by corrupted file: %s", cdclient_path.c_str());
Game::logger->Log("WorldServer", "Error: %s", e.errorMessage());
Game::logger->Log("WorldServer", "Error Code: %i", e.errorCode());
return EXIT_FAILURE;
}
@ -146,7 +146,7 @@ int main(int argc, char** argv) {
try {
Database::Connect(mysql_host, mysql_database, mysql_username, mysql_password);
} catch (sql::SQLException& ex) {
Game::logger->Log("MasterServer", "Got an error while connecting to the database: %s\n", ex.what());
Game::logger->Log("MasterServer", "Got an error while connecting to the database: %s", ex.what());
return EXIT_FAILURE;
}
}
@ -368,14 +368,14 @@ dLogger* SetupLogger() {
void HandlePacket(Packet* packet) {
if (packet->data[0] == ID_DISCONNECTION_NOTIFICATION) {
Game::logger->Log("MasterServer", "A server has disconnected\n");
Game::logger->Log("MasterServer", "A server has disconnected");
//Since this disconnection is intentional, we'll just delete it as
//we'll start a new one anyway if needed:
Instance* instance =
Game::im->GetInstanceBySysAddr(packet->systemAddress);
if (instance) {
Game::logger->Log("MasterServer", "Actually disconnected from zone %i clone %i instance %i port %i\n", instance->GetMapID(), instance->GetCloneID(), instance->GetInstanceID(), instance->GetPort());
Game::logger->Log("MasterServer", "Actually disconnected from zone %i clone %i instance %i port %i", instance->GetMapID(), instance->GetCloneID(), instance->GetInstanceID(), instance->GetPort());
Game::im->RemoveInstance(instance); //Delete the old
}
@ -385,7 +385,7 @@ void HandlePacket(Packet* packet) {
}
if (packet->data[0] == ID_CONNECTION_LOST) {
Game::logger->Log("MasterServer", "A server has lost the connection\n");
Game::logger->Log("MasterServer", "A server has lost the connection");
Instance* instance =
Game::im->GetInstanceBySysAddr(packet->systemAddress);
@ -403,7 +403,7 @@ void HandlePacket(Packet* packet) {
if (packet->data[1] == MASTER) {
switch (packet->data[3]) {
case MSG_MASTER_REQUEST_PERSISTENT_ID: {
Game::logger->Log("MasterServer", "A persistent ID req\n");
Game::logger->Log("MasterServer", "A persistent ID req");
RakNet::BitStream inStream(packet->data, packet->length, false);
uint64_t header = inStream.Read(header);
uint64_t requestID = 0;
@ -415,7 +415,7 @@ void HandlePacket(Packet* packet) {
}
case MSG_MASTER_REQUEST_ZONE_TRANSFER: {
Game::logger->Log("MasterServer","Received zone transfer req\n");
Game::logger->Log("MasterServer","Received zone transfer req");
RakNet::BitStream inStream(packet->data, packet->length, false);
uint64_t header = inStream.Read(header);
uint64_t requestID = 0;
@ -431,18 +431,18 @@ void HandlePacket(Packet* packet) {
Instance* in = Game::im->GetInstance(zoneID, false, zoneClone);
for (auto* instance : Game::im->GetInstances()) {
Game::logger->Log("MasterServer", "Instance: %i/%i/%i -> %i\n",instance->GetMapID(), instance->GetCloneID(),instance->GetInstanceID(), instance == in);
Game::logger->Log("MasterServer", "Instance: %i/%i/%i -> %i",instance->GetMapID(), instance->GetCloneID(),instance->GetInstanceID(), instance == in);
}
if (!in->GetIsReady()) //Instance not ready, make a pending request
{
in->GetPendingRequests().push_back({ requestID, static_cast<bool>(mythranShift), packet->systemAddress });
Game::logger->Log("MasterServer", "Server not ready, adding pending request %llu %i %i\n", requestID, zoneID, zoneClone);
Game::logger->Log("MasterServer", "Server not ready, adding pending request %llu %i %i", requestID, zoneID, zoneClone);
break;
}
//Instance is ready, transfer
Game::logger->Log("MasterServer", "Responding to transfer request %llu for zone %i %i\n", requestID, zoneID, zoneClone);
Game::logger->Log("MasterServer", "Responding to transfer request %llu for zone %i %i", requestID, zoneID, zoneClone);
Game::im->RequestAffirmation(in, { requestID, static_cast<bool>(mythranShift), packet->systemAddress });
break;
}
@ -494,7 +494,7 @@ void HandlePacket(Packet* packet) {
chatServerMasterPeerSysAddr = copy;
}
Game::logger->Log("MasterServer", "Received server info, instance: %i port: %i\n", theirInstanceID, theirPort);
Game::logger->Log("MasterServer", "Received server info, instance: %i port: %i", theirInstanceID, theirPort);
break;
}
@ -526,7 +526,7 @@ void HandlePacket(Packet* packet) {
}
activeSessions.insert(std::make_pair(sessionKey, username));
Game::logger->Log("MasterServer", "Got sessionKey %i for user %s\n", sessionKey, username.c_str());
Game::logger->Log("MasterServer", "Got sessionKey %i for user %s", sessionKey, username.c_str());
break;
}
@ -564,7 +564,7 @@ void HandlePacket(Packet* packet) {
instance->AddPlayer(Player());
}
else {
printf("Instance missing? What?\n");
printf("Instance missing? What?");
}
break;
}
@ -633,7 +633,7 @@ void HandlePacket(Packet* packet) {
auto* instance = Game::im->FindPrivateInstance(password.c_str());
Game::logger->Log( "MasterServer", "Join private zone: %llu %d %s %p\n", requestID, mythranShift, password.c_str(), instance);
Game::logger->Log( "MasterServer", "Join private zone: %llu %d %s %p", requestID, mythranShift, password.c_str(), instance);
if (instance == nullptr) {
return;
@ -656,16 +656,16 @@ void HandlePacket(Packet* packet) {
inStream.Read(zoneID);
inStream.Read(instanceID);
Game::logger->Log("MasterServer", "Got world ready %i %i\n",zoneID, instanceID);
Game::logger->Log("MasterServer", "Got world ready %i %i",zoneID, instanceID);
auto* instance = Game::im->FindInstance(zoneID, instanceID);
if (instance == nullptr) {
Game::logger->Log("MasterServer","Failed to find zone to ready\n");
Game::logger->Log("MasterServer","Failed to find zone to ready");
return;
}
Game::logger->Log("MasterServer", "Ready zone %i\n", zoneID);
Game::logger->Log("MasterServer", "Ready zone %i", zoneID);
Game::im->ReadyInstance(instance);
break;
}
@ -677,7 +677,7 @@ void HandlePacket(Packet* packet) {
int zoneID;
inStream.Read(zoneID);
Game::logger->Log("MasterServer", "Prepping zone %i\n", zoneID);
Game::logger->Log("MasterServer", "Prepping zone %i", zoneID);
Game::im->GetInstance(zoneID, false, 0);
break;
}
@ -690,7 +690,7 @@ void HandlePacket(Packet* packet) {
inStream.Read(requestID);
Game::logger->Log("MasterServer","Got affirmation of transfer %llu\n",requestID);
Game::logger->Log("MasterServer","Got affirmation of transfer %llu",requestID);
auto* instance =Game::im->GetInstanceBySysAddr(packet->systemAddress);
@ -698,7 +698,7 @@ void HandlePacket(Packet* packet) {
return;
Game::im->AffirmTransfer(instance, requestID);
Game::logger->Log("MasterServer", "Affirmation complete %llu\n",requestID);
Game::logger->Log("MasterServer", "Affirmation complete %llu",requestID);
break;
}
@ -712,19 +712,19 @@ void HandlePacket(Packet* packet) {
return;
}
Game::logger->Log("MasterServer", "Got shutdown response from zone %i clone %i instance %i port %i\n", instance->GetMapID(), instance->GetCloneID(), instance->GetInstanceID(), instance->GetPort());
Game::logger->Log("MasterServer", "Got shutdown response from zone %i clone %i instance %i port %i", instance->GetMapID(), instance->GetCloneID(), instance->GetInstanceID(), instance->GetPort());
instance->SetIsShuttingDown(true);
break;
}
case MSG_MASTER_SHUTDOWN_UNIVERSE: {
Game::logger->Log("MasterServer","Received shutdown universe command, shutting down in 10 minutes.\n");
Game::logger->Log("MasterServer","Received shutdown universe command, shutting down in 10 minutes.");
shouldShutdown = true;
break;
}
default:
Game::logger->Log("MasterServer","Unknown master packet ID from server: %i\n",packet->data[3]);
Game::logger->Log("MasterServer","Unknown master packet ID from server: %i",packet->data[3]);
}
}
}
@ -780,7 +780,7 @@ void ShutdownSequence() {
auto* objIdManager = ObjectIDManager::TryInstance();
if (objIdManager != nullptr) {
objIdManager->SaveToDatabase();
Game::logger->Log("MasterServer", "Saved ObjectIDTracker to DB\n");
Game::logger->Log("MasterServer", "Saved ObjectIDTracker to DB");
}
auto t = std::chrono::high_resolution_clock::now();
@ -790,7 +790,7 @@ void ShutdownSequence() {
exit(EXIT_SUCCESS);
}
Game::logger->Log("MasterServer", "Attempting to shutdown instances, max 60 seconds...\n");
Game::logger->Log("MasterServer", "Attempting to shutdown instances, max 60 seconds...");
while (true) {
@ -814,7 +814,7 @@ void ShutdownSequence() {
}
if (done) {
Game::logger->Log("MasterServer", "Finished shutting down MasterServer!\n");
Game::logger->Log("MasterServer", "Finished shutting down MasterServer!");
break;
}
@ -824,7 +824,7 @@ void ShutdownSequence() {
ticks++;
if (ticks == 600 * 6) {
Game::logger->Log("MasterServer", "Finished shutting down by timeout!\n");
Game::logger->Log("MasterServer", "Finished shutting down by timeout!");
break;
}
}

View File

@ -40,8 +40,8 @@ void ObjectIDManager::Initialize(dLogger *logger) {
delete stmt;
} catch (sql::SQLException &e) {
mLogger->Log("ObjectIDManager", "Unable to fetch max persistent object "
"ID in use. Defaulting to 1.\n");
mLogger->Log("ObjectIDManager", "SQL error: %s\n", e.what());
"ID in use. Defaulting to 1.");
mLogger->Log("ObjectIDManager", "SQL error: %s", e.what());
this->currentPersistentID = 1;
}
}

View File

@ -28,7 +28,7 @@ void AuthPackets::HandleHandshake(dServer* server, Packet* packet) {
uint32_t clientVersion = 0;
inStream.Read(clientVersion);
server->GetLogger()->Log("AuthPackets", "Received client version: %i\n", clientVersion);
server->GetLogger()->Log("AuthPackets", "Received client version: %i", clientVersion);
SendHandshake(server, packet->systemAddress, server->GetIP(), server->GetPort());
}
@ -59,7 +59,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
sql::ResultSet* res = stmt->executeQuery();
if (res->rowsCount() == 0) {
server->GetLogger()->Log("AuthPackets", "No user found!\n");
server->GetLogger()->Log("AuthPackets", "No user found!");
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_WRONG_PASS_OR_USER, "", "", 2001, username);
return;
}
@ -92,7 +92,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
//Check to see if we have a play key:
if (sqlPlayKey == 0 && sqlGmLevel == 0) {
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_PERMISSIONS_NOT_HIGH_ENOUGH, "Your account doesn't have a play key associated with it!", "", 2001, username);
server->GetLogger()->Log("AuthPackets", "User %s tried to log in, but they don't have a play key.\n", username.c_str());
server->GetLogger()->Log("AuthPackets", "User %s tried to log in, but they don't have a play key.", username.c_str());
return;
}
@ -113,7 +113,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
if (!isKeyActive && sqlGmLevel == 0) {
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_PERMISSIONS_NOT_HIGH_ENOUGH, "Your play key has been disabled.", "", 2001, username);
server->GetLogger()->Log("AuthPackets", "User %s tried to log in, but their play key was disabled\n", username.c_str());
server->GetLogger()->Log("AuthPackets", "User %s tried to log in, but their play key was disabled", username.c_str());
return;
}
}
@ -176,7 +176,7 @@ void AuthPackets::HandleLoginRequest(dServer* server, Packet* packet) {
if (!loginSuccess) {
AuthPackets::SendLoginResponse(server, packet->systemAddress, LOGIN_RESPONSE_WRONG_PASS_OR_USER, "", "", 2001, username);
server->GetLogger()->Log("AuthPackets", "Wrong password used\n");
server->GetLogger()->Log("AuthPackets", "Wrong password used");
}
else {
SystemAddress system = packet->systemAddress; //Copy the sysAddr before the Packet gets destroyed from main
@ -265,6 +265,6 @@ void AuthPackets::SendLoginResponse(dServer* server, const SystemAddress& sysAdd
PacketUtils::WriteString(bitStream, username, 66);
server->SendToMaster(&bitStream);
server->GetLogger()->Log("AuthPackets", "Set sessionKey: %i for user %s\n", sessionKey, username.c_str());
server->GetLogger()->Log("AuthPackets", "Set sessionKey: %i for user %s", sessionKey, username.c_str());
}
}

View File

@ -37,7 +37,7 @@
void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* packet) {
User* user = UserManager::Instance()->GetUser(sysAddr);
if (!user) {
Game::logger->Log("ClientPackets", "Unable to get user to parse chat message\n");
Game::logger->Log("ClientPackets", "Unable to get user to parse chat message");
return;
}
@ -71,14 +71,14 @@ void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* pack
if (!user->GetLastChatMessageApproved() && !isMythran) return;
std::string sMessage = GeneralUtils::UTF16ToWTF8(message);
Game::logger->Log("Chat", "%s: %s\n", playerName.c_str(), sMessage.c_str());
Game::logger->Log("Chat", "%s: %s", playerName.c_str(), sMessage.c_str());
ChatPackets::SendChatMessage(sysAddr, chatChannel, playerName, user->GetLoggedInChar(), isMythran, message);
}
void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Packet* packet) {
User* user = UserManager::Instance()->GetUser(sysAddr);
if (!user) {
Game::logger->Log("ClientPackets", "Unable to get user to parse position update\n");
Game::logger->Log("ClientPackets", "Unable to get user to parse position update");
return;
}
@ -240,14 +240,14 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
void ClientPackets::HandleChatModerationRequest(const SystemAddress& sysAddr, Packet* packet) {
User* user = UserManager::Instance()->GetUser(sysAddr);
if (!user) {
Game::logger->Log("ClientPackets", "Unable to get user to parse chat moderation request\n");
Game::logger->Log("ClientPackets", "Unable to get user to parse chat moderation request");
return;
}
auto* entity = Player::GetPlayer(sysAddr);
if (entity == nullptr) {
Game::logger->Log("ClientPackets", "Unable to get player to parse chat moderation request\n");
Game::logger->Log("ClientPackets", "Unable to get player to parse chat moderation request");
return;
}

View File

@ -185,7 +185,7 @@ void WorldPackets::SendCreateCharacter(const SystemAddress& sysAddr, Entity* ent
PacketUtils::SavePacket("chardata.bin", (const char *)bitStream.GetData(), static_cast<uint32_t>(bitStream.GetNumberOfBytesUsed()));
SEND_PACKET
Game::logger->Log("WorldPackets", "Sent CreateCharacter for ID: %llu\n", entity->GetObjectID());
Game::logger->Log("WorldPackets", "Sent CreateCharacter for ID: %llu", entity->GetObjectID());
}
void WorldPackets::SendChatModerationResponse(const SystemAddress& sysAddr, bool requestAccepted, uint32_t requestID, const std::string& receiver, std::vector<std::pair<uint8_t, uint8_t>> unacceptedItems) {

View File

@ -60,11 +60,11 @@ dServer::dServer(const std::string& ip, int port, int instanceID, int maxConnect
if (mIsOkay) {
if (zoneID == 0)
mLogger->Log("dServer", "Server is listening on %s:%i with encryption: %i\n", ip.c_str(), port, int(useEncryption));
mLogger->Log("dServer", "Server is listening on %s:%i with encryption: %i", ip.c_str(), port, int(useEncryption));
else
mLogger->Log("dServer", "Server is listening on %s:%i with encryption: %i, running zone %i / %i\n", ip.c_str(), port, int(useEncryption), zoneID, instanceID);
mLogger->Log("dServer", "Server is listening on %s:%i with encryption: %i, running zone %i / %i", ip.c_str(), port, int(useEncryption), zoneID, instanceID);
}
else { mLogger->Log("dServer", "FAILED TO START SERVER ON IP/PORT: %s:%i\n", ip.c_str(), port); return; }
else { mLogger->Log("dServer", "FAILED TO START SERVER ON IP/PORT: %s:%i", ip.c_str(), port); return; }
mLogger->SetLogToConsole(prevLogSetting);
@ -104,13 +104,13 @@ Packet* dServer::ReceiveFromMaster() {
if (packet->length < 1) { mMasterPeer->DeallocatePacket(packet); return nullptr; }
if (packet->data[0] == ID_DISCONNECTION_NOTIFICATION || packet->data[0] == ID_CONNECTION_LOST) {
mLogger->Log("dServer", "Lost our connection to master, shutting DOWN!\n");
mLogger->Log("dServer", "Lost our connection to master, shutting DOWN!");
mMasterConnectionActive = false;
//ConnectToMaster(); //We'll just shut down now
}
if (packet->data[0] == ID_CONNECTION_REQUEST_ACCEPTED) {
mLogger->Log("dServer", "Established connection to master, zone (%i), instance (%i)\n",this->GetZoneID(), this->GetInstanceID());
mLogger->Log("dServer", "Established connection to master, zone (%i), instance (%i)",this->GetZoneID(), this->GetInstanceID());
mMasterConnectionActive = true;
mMasterSystemAddress = packet->systemAddress;
MasterPackets::SendServerInfo(this, packet);

View File

@ -21,11 +21,11 @@ void dpWorld::Initialize(unsigned int zoneID) {
m_Grid = new dpGrid(phys_sp_tilecount, phys_sp_tilesize);
}
Game::logger->Log("dpWorld", "Physics world initialized!\n");
Game::logger->Log("dpWorld", "Physics world initialized!");
if (ShouldLoadNavmesh(zoneID)) {
if (LoadNavmeshByZoneID(zoneID)) Game::logger->Log("dpWorld", "Loaded navmesh!\n");
else Game::logger->Log("dpWorld", "Error(s) occurred during navmesh load.\n");
if (LoadNavmeshByZoneID(zoneID)) Game::logger->Log("dpWorld", "Loaded navmesh!");
else Game::logger->Log("dpWorld", "Error(s) occurred during navmesh load.");
}
}

View File

@ -125,7 +125,7 @@ void ActivityManager::ActivityTimerStart(Entity *self, const std::string& timerN
auto* timer = new ActivityTimer { timerName, updateInterval, stopTime };
activeTimers.push_back(timer);
Game::logger->Log("ActivityManager", "Starting timer '%s', %f, %f\n", timerName.c_str(), updateInterval, stopTime);
Game::logger->Log("ActivityManager", "Starting timer '%s', %f, %f", timerName.c_str(), updateInterval, stopTime);
self->AddTimer(GetPrefixedName(timer->name), timer->updateInterval);
}
@ -208,10 +208,10 @@ void ActivityManager::OnTimerDone(Entity *self, std::string timerName) {
activeTimers.erase(std::remove(activeTimers.begin(), activeTimers.end(), timer),
activeTimers.end());
delete timer;
Game::logger->Log("ActivityManager", "Executing timer '%s'\n", activityTimerName.c_str());
Game::logger->Log("ActivityManager", "Executing timer '%s'", activityTimerName.c_str());
OnActivityTimerDone(self, activityTimerName);
} else {
Game::logger->Log("ActivityManager", "Updating timer '%s'\n", activityTimerName.c_str());
Game::logger->Log("ActivityManager", "Updating timer '%s'", activityTimerName.c_str());
OnActivityTimerUpdate(self, timer->name, timer->stopTime - timer->runTime, timer->runTime);
self->AddTimer(GetPrefixedName(timer->name), timer->updateInterval);
}

View File

@ -98,7 +98,7 @@ void AgJetEffectServer::OnTimerDone(Entity* self, std::string timerName)
auto* mortar = entities[selected];
Game::logger->Log("AgJetEffectServer", "Mortar (%i) (&d)\n", mortar->GetLOT(), mortar->HasComponent(COMPONENT_TYPE_SKILL));
Game::logger->Log("AgJetEffectServer", "Mortar (%i) (&d)", mortar->GetLOT(), mortar->HasComponent(COMPONENT_TYPE_SKILL));
mortar->SetOwnerOverride(builder);

View File

@ -41,7 +41,7 @@ void BaseRandomServer::SpawnSection(Entity* self, const std::string& sectionName
if (spawnLoad == nullptr)
{
Game::logger->Log("BaseRandomServer", "Failed to find section: %s\n", sectionName.c_str());
Game::logger->Log("BaseRandomServer", "Failed to find section: %s", sectionName.c_str());
return;
}
@ -71,7 +71,7 @@ void BaseRandomServer::SetSpawnerNetwork(Entity* self, const std::string& spawne
if (spawners.empty())
{
Game::logger->Log("BaseRandomServer", "Failed to find spawner: %s\n", spawnerName.c_str());
Game::logger->Log("BaseRandomServer", "Failed to find spawner: %s", spawnerName.c_str());
return;
}

View File

@ -60,7 +60,7 @@ void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
missionComponent->CompleteMission(instanceMissionID);
}
Game::logger->Log("BossSpiderQueenEnemyServer", "Starting timer...\n");
Game::logger->Log("BossSpiderQueenEnemyServer", "Starting timer...");
// There is suppose to be a 0.1 second delay here but that may be admitted?
auto* controller = EntityManager::Instance()->GetZoneControlEntity();
@ -176,7 +176,7 @@ void BossSpiderQueenEnemyServer::SpawnSpiderWave(Entity* self, int spiderCount)
hatchCounter = spiderCount;
hatchList = {};
Game::logger->Log("SpiderQueen", "Trying to spawn %i spiders\n", hatchCounter);
Game::logger->Log("SpiderQueen", "Trying to spawn %i spiders", hatchCounter);
// Run the wave manager
@ -246,7 +246,7 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
// Prep the selected spider egg
//randomEgg:FireEvent{s}erID=self, args="prepEgg"}
eggEntity->OnFireEventServerSide(self, "prepEgg");
Game::logger->Log("SpiderQueen", "Prepping egg %llu\n", eggEntity->GetObjectID());
Game::logger->Log("SpiderQueen", "Prepping egg %llu", eggEntity->GetObjectID());
// Add the prepped egg to our hatchList
hatchList.push_back(eggEntity->GetObjectID());
@ -280,7 +280,7 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
}
eggEntity->OnFireEventServerSide(self, "hatchEgg");
Game::logger->Log("SpiderQueen", "hatching egg %llu\n", eggEntity->GetObjectID());
Game::logger->Log("SpiderQueen", "hatching egg %llu", eggEntity->GetObjectID());
auto time = PlayAnimAndReturnTime(self, spiderWithdrawIdle);
combat->SetStunImmune(false);
@ -362,7 +362,7 @@ void BossSpiderQueenEnemyServer::RainOfFireManager(Entity* self)
if (entity == nullptr)
{
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find impact!\n");
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find impact!");
return;
}
@ -371,7 +371,7 @@ void BossSpiderQueenEnemyServer::RainOfFireManager(Entity* self)
if (skillComponent == nullptr)
{
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find impact skill component!\n");
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find impact skill component!");
return;
}
@ -429,7 +429,7 @@ void BossSpiderQueenEnemyServer::RunRapidFireShooter(Entity* self)
if (targets.empty())
{
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find RFS targets\n");
Game::logger->Log("BossSpiderQueenEnemyServer", "Failed to find RFS targets");
self->AddTimer("RFS", GeneralUtils::GenerateRandomNumber<float>(5, 10));
@ -452,7 +452,7 @@ void BossSpiderQueenEnemyServer::RunRapidFireShooter(Entity* self)
PlayAnimAndReturnTime(self, spiderSingleShot);
Game::logger->Log("BossSpiderQueenEnemyServer", "Ran RFS\n");
Game::logger->Log("BossSpiderQueenEnemyServer", "Ran RFS");
self->AddTimer("RFS", GeneralUtils::GenerateRandomNumber<float>(10, 15));
}

View File

@ -818,7 +818,7 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = invalidToReturn;
else if (script == invalidToReturn) {
if (scriptName.length() > 0)
Game::logger->LogDebug("CppScripts", "Attempted to load CppScript for '" + scriptName + "', but returned InvalidScript.\n");
Game::logger->LogDebug("CppScripts", "Attempted to load CppScript for '" + scriptName + "', but returned InvalidScript.");
// information not really needed for sys admins but is for developers
script = invalidToReturn;

View File

@ -44,7 +44,7 @@ void FlameJetServer::OnCollisionPhantom(Entity* self, Entity* target)
void FlameJetServer::OnFireEventServerSide(Entity *self, Entity *sender, std::string args, int32_t param1, int32_t param2, int32_t param3)
{
Game::logger->Log("FlameJetServer::OnFireEventServerSide", "Event: %s\n", args.c_str());
Game::logger->Log("FlameJetServer::OnFireEventServerSide", "Event: %s", args.c_str());
if (args == "OnActivated")
{

View File

@ -68,7 +68,7 @@ void FvMaelstromDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_
if (destroyableComponent != nullptr)
{
Game::logger->Log("FvMaelstromDragon", "Hit %i\n", destroyableComponent->GetArmor());
Game::logger->Log("FvMaelstromDragon", "Hit %i", destroyableComponent->GetArmor());
if (destroyableComponent->GetArmor() > 0) return;
@ -76,7 +76,7 @@ void FvMaelstromDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_
if (weakpoint == 0)
{
Game::logger->Log("FvMaelstromDragon", "Activating weakpoint\n");
Game::logger->Log("FvMaelstromDragon", "Activating weakpoint");
self->AddTimer("ReviveTimer", 12);

View File

@ -100,7 +100,7 @@ void NjMonastryBossInstance::OnPlayerExit(Entity *self, Entity *player) {
if (playerToRemove != totalPlayersLoaded.end()) {
totalPlayersLoaded.erase(playerToRemove);
} else {
Game::logger->Log("NjMonastryBossInstance", "Failed to remove player at exit.\n");
Game::logger->Log("NjMonastryBossInstance", "Failed to remove player at exit.");
}
// Set the players loaded var back

View File

@ -13,7 +13,7 @@
#include "MissionComponent.h"
void SGCannon::OnStartup(Entity *self) {
Game::logger->Log("SGCannon", "OnStartup\n");
Game::logger->Log("SGCannon", "OnStartup");
m_Waves = GetWaves();
constants = GetConstants();
@ -59,7 +59,7 @@ void SGCannon::OnStartup(Entity *self) {
}
void SGCannon::OnPlayerLoaded(Entity *self, Entity *player) {
Game::logger->Log("SGCannon", "Player loaded\n");
Game::logger->Log("SGCannon", "Player loaded");
self->SetVar<LWOOBJID>(PlayerIDVariable, player->GetObjectID());
}
@ -70,15 +70,15 @@ void SGCannon::OnFireEventServerSide(Entity *self, Entity *sender, std::string a
void SGCannon::OnActivityStateChangeRequest(Entity *self, LWOOBJID senderID, int32_t value1, int32_t value2,
const std::u16string &stringValue) {
Game::logger->Log("SGCannon", "Got activity state change request: %s\n", GeneralUtils::UTF16ToWTF8(stringValue).c_str());
Game::logger->Log("SGCannon", "Got activity state change request: %s", GeneralUtils::UTF16ToWTF8(stringValue).c_str());
if (stringValue == u"clientready") {
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
if (player != nullptr) {
Game::logger->Log("SGCannon", "Player is ready\n");
Game::logger->Log("SGCannon", "Player is ready");
/*GameMessages::SendSetStunned(player->GetObjectID(), PUSH, player->GetSystemAddress(), LWOOBJID_EMPTY,
true, true, true, true, true, true, true);*/
Game::logger->Log("SGCannon", "Sending ActivityEnter\n");
Game::logger->Log("SGCannon", "Sending ActivityEnter");
GameMessages::SendActivityEnter(self->GetObjectID(), player->GetSystemAddress());
@ -87,12 +87,12 @@ void SGCannon::OnActivityStateChangeRequest(Entity *self, LWOOBJID senderID, int
if (shootingGalleryComponent != nullptr) {
shootingGalleryComponent->SetCurrentPlayerID(player->GetObjectID());
Game::logger->Log("SGCannon", "Setting player ID\n");
Game::logger->Log("SGCannon", "Setting player ID");
EntityManager::Instance()->SerializeEntity(self);
}
else {
Game::logger->Log("SGCannon", "Shooting gallery component is null\n");
Game::logger->Log("SGCannon", "Shooting gallery component is null");
}
auto* characterComponent = player->GetComponent<CharacterComponent>();
@ -125,7 +125,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity *self, LWOOBJID senderID, int
//GameMessages::SendRequestActivityEnter(self->GetObjectID(), player->GetSystemAddress(), false, player->GetObjectID());
}
else {
Game::logger->Log("SGCannon", "Player not found\n");
Game::logger->Log("SGCannon", "Player not found");
}
}
else if (value1 == 1200) {
@ -193,7 +193,7 @@ void SGCannon::OnActivityTimerDone(Entity *self, const std::string &name) {
SpawnObject(self, enemyToSpawn, true);
}
Game::logger->Log("SGCannon", "Current wave spawn: %i/%i\n", wave, m_Waves.size());
Game::logger->Log("SGCannon", "Current wave spawn: %i/%i", wave, m_Waves.size());
// All waves completed
const auto timeLimit = (float_t) self->GetVar<uint32_t>(TimeLimitVariable);
@ -208,7 +208,7 @@ void SGCannon::OnActivityTimerDone(Entity *self, const std::string &name) {
GameMessages::SendPlayFXEffect(player->GetObjectID(), -1, u"SG-start", "");
GameMessages::SendStartActivityTime(self->GetObjectID(), timeLimit, player->GetSystemAddress());
Game::logger->Log("SGCannon", "Sending ActivityPause false\n");
Game::logger->Log("SGCannon", "Sending ActivityPause false");
GameMessages::SendActivityPause(self->GetObjectID(), false, player->GetSystemAddress());
}
@ -229,7 +229,7 @@ void SGCannon::OnActivityTimerDone(Entity *self, const std::string &name) {
self->SetNetworkVar<uint32_t>(WaveNumVariable, self->GetVar<uint32_t>(ThisWaveVariable) + 1);
self->SetNetworkVar<uint32_t>(WaveStrVariable, self->GetVar<uint32_t>(TimeLimitVariable));
Game::logger->Log("SGCannon", "Current wave: %i/%i\n", self->GetVar<uint32_t>(ThisWaveVariable), m_Waves.size());
Game::logger->Log("SGCannon", "Current wave: %i/%i", self->GetVar<uint32_t>(ThisWaveVariable), m_Waves.size());
if (self->GetVar<uint32_t>(ThisWaveVariable) >= m_Waves.size()) {
ActivityTimerStart(self, GameOverTimer, 0.1, 0.1);
@ -237,7 +237,7 @@ void SGCannon::OnActivityTimerDone(Entity *self, const std::string &name) {
ActivityTimerStart(self, SpawnWaveTimer, constants.inBetweenWavePause, constants.inBetweenWavePause);
}
Game::logger->Log("SGCannon", "Sending ActivityPause true\n");
Game::logger->Log("SGCannon", "Sending ActivityPause true");
GameMessages::SendActivityPause(self->GetObjectID(), true);
if (self->GetVar<bool>(SuperChargeActiveVariable) && !self->GetVar<bool>(SuperChargePausedVariable)) {
@ -246,7 +246,7 @@ void SGCannon::OnActivityTimerDone(Entity *self, const std::string &name) {
} else if (name == GameOverTimer) {
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
if (player != nullptr) {
Game::logger->Log("SGCannon", "Sending ActivityPause true\n");
Game::logger->Log("SGCannon", "Sending ActivityPause true");
GameMessages::SendActivityPause(self->GetObjectID(), true, player->GetSystemAddress());
@ -288,7 +288,7 @@ void SGCannon::OnActivityTimerDone(Entity *self, const std::string &name) {
new LDFData<std::u16string>(u"groupID", u"SGEnemy")
};
Game::logger->Log("SGCannon", "Spawning enemy %i on path %s\n", toSpawn.lot, path->pathName.c_str());
Game::logger->Log("SGCannon", "Spawning enemy %i on path %s", toSpawn.lot, path->pathName.c_str());
auto* enemy = EntityManager::Instance()->CreateEntity(info, nullptr, self);
EntityManager::Instance()->ConstructEntity(enemy);
@ -349,7 +349,7 @@ void SGCannon::StartGame(Entity *self) {
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
if (player != nullptr) {
GetLeaderboardData(self, player->GetObjectID(), GetActivityID(self));
Game::logger->Log("SGCannon", "Sending ActivityStart\n");
Game::logger->Log("SGCannon", "Sending ActivityStart");
GameMessages::SendActivityStart(self->GetObjectID(), player->GetSystemAddress());
GameMessages::SendPlayFXEffect(self->GetObjectID(), -1, u"start", "");
@ -634,7 +634,7 @@ void SGCannon::RegisterHit(Entity* self, Entity* target, const std::string& time
auto scScore = self->GetVar<uint32_t>(TotalScoreVariable) - lastSuperTotal;
Game::logger->Log("SGCannon", "LastSuperTotal: %i, scScore: %i, constants.chargedPoints: %i\n",
Game::logger->Log("SGCannon", "LastSuperTotal: %i, scScore: %i, constants.chargedPoints: %i",
lastSuperTotal, scScore, constants.chargedPoints
);
@ -723,7 +723,7 @@ void SGCannon::ToggleSuperCharge(Entity *self, bool enable) {
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
if (player == nullptr) {
Game::logger->Log("SGCannon", "Player not found in toggle super charge\n");
Game::logger->Log("SGCannon", "Player not found in toggle super charge");
return;
}
@ -731,7 +731,7 @@ void SGCannon::ToggleSuperCharge(Entity *self, bool enable) {
auto equippedItems = inventoryComponent->GetEquippedItems();
Game::logger->Log("SGCannon", "Player has %d equipped items\n", equippedItems.size());
Game::logger->Log("SGCannon", "Player has %d equipped items", equippedItems.size());
auto skillID = constants.cannonSkill;
auto coolDown = constants.cannonRefireRate;
@ -739,12 +739,12 @@ void SGCannon::ToggleSuperCharge(Entity *self, bool enable) {
auto* selfInventoryComponent = self->GetComponent<InventoryComponent>();
if (inventoryComponent == nullptr) {
Game::logger->Log("SGCannon", "Inventory component not found\n");
Game::logger->Log("SGCannon", "Inventory component not found");
return;
}
if (enable) {
Game::logger->Log("SGCannon", "Player is activating super charge\n");
Game::logger->Log("SGCannon", "Player is activating super charge");
selfInventoryComponent->UpdateSlot("greeble_r", { ObjectIDManager::GenerateRandomObjectID(), 6505, 1, 0 });
selfInventoryComponent->UpdateSlot("greeble_l", { ObjectIDManager::GenerateRandomObjectID(), 6506, 1, 0 });
@ -757,12 +757,12 @@ void SGCannon::ToggleSuperCharge(Entity *self, bool enable) {
self->SetNetworkVar<float>(u"SuperChargeBar", 0);
Game::logger->Log("SGCannon", "Player disables super charge\n");
Game::logger->Log("SGCannon", "Player disables super charge");
// TODO: Unequip items
for (const auto& equipped : equippedItems) {
if (equipped.first == "special_r" || equipped.first == "special_l") {
Game::logger->Log("SGCannon", "Trying to unequip a weapon, %i\n", equipped.second.lot);
Game::logger->Log("SGCannon", "Trying to unequip a weapon, %i", equipped.second.lot);
auto* item = inventoryComponent->FindItemById(equipped.second.id);
@ -770,7 +770,7 @@ void SGCannon::ToggleSuperCharge(Entity *self, bool enable) {
inventoryComponent->UnEquipItem(item);
}
else {
Game::logger->Log("SGCannon", "Item not found, %i\n", equipped.second.lot);
Game::logger->Log("SGCannon", "Item not found, %i", equipped.second.lot);
}
}
}

View File

@ -127,9 +127,9 @@ int main(int argc, char** argv) {
if (!Game::logger) return 0;
Game::logger->SetLogToConsole(true); //We want this info to always be logged.
Game::logger->Log("WorldServer", "Starting World server...\n");
Game::logger->Log("WorldServer", "Version: %i.%i\n", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR);
Game::logger->Log("WorldServer", "Compiled on: %s\n", __TIMESTAMP__);
Game::logger->Log("WorldServer", "Starting World server...");
Game::logger->Log("WorldServer", "Version: %i.%i", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR);
Game::logger->Log("WorldServer", "Compiled on: %s", __TIMESTAMP__);
#ifndef _DEBUG
Game::logger->SetLogToConsole(false); //By default, turn it back off if not in debug.
@ -146,9 +146,9 @@ int main(int argc, char** argv) {
try {
CDClientDatabase::Connect("./res/CDServer.sqlite");
} catch (CppSQLite3Exception& e) {
Game::logger->Log("WorldServer", "Unable to connect to CDServer SQLite Database\n");
Game::logger->Log("WorldServer", "Error: %s\n", e.errorMessage());
Game::logger->Log("WorldServer", "Error Code: %i\n", e.errorCode());
Game::logger->Log("WorldServer", "Unable to connect to CDServer SQLite Database");
Game::logger->Log("WorldServer", "Error: %s", e.errorMessage());
Game::logger->Log("WorldServer", "Error Code: %i", e.errorCode());
return -1;
}
@ -170,7 +170,7 @@ int main(int argc, char** argv) {
try {
Database::Connect(mysql_host, mysql_database, mysql_username, mysql_password);
} catch (sql::SQLException& ex) {
Game::logger->Log("WorldServer", "Got an error while connecting to the database: %s\n", ex.what());
Game::logger->Log("WorldServer", "Got an error while connecting to the database: %s", ex.what());
return 0;
}
@ -277,7 +277,7 @@ int main(int argc, char** argv) {
delete md5;
Game::logger->Log("WorldServer", "FDB Checksum calculated as: %s\n", databaseChecksum.c_str());
Game::logger->Log("WorldServer", "FDB Checksum calculated as: %s", databaseChecksum.c_str());
}
}
@ -304,7 +304,7 @@ int main(int argc, char** argv) {
//Warning if we ran slow
if (deltaTime > currentFramerate) {
Game::logger->Log("WorldServer", "We're running behind, dT: %f > %f (framerate)\n", deltaTime, currentFramerate);
Game::logger->Log("WorldServer", "We're running behind, dT: %f > %f (framerate)", deltaTime, currentFramerate);
}
//Check if we're still connected to master:
@ -313,7 +313,7 @@ int main(int argc, char** argv) {
int framesToWaitForMaster = ready ? 10 : 200;
if (framesSinceMasterDisconnect >= framesToWaitForMaster && !worldShutdownSequenceStarted) {
Game::logger->Log("WorldServer", "Game loop running but no connection to master for %d frames, shutting down\n", framesToWaitForMaster);
Game::logger->Log("WorldServer", "Game loop running but no connection to master for %d frames, shutting down", framesToWaitForMaster);
worldShutdownSequenceStarted = true;
}
}
@ -470,7 +470,7 @@ int main(int argc, char** argv) {
if (framesSinceMasterStatus >= 200)
{
Game::logger->Log("WorldServer", "Finished loading world with zone (%i), ready up!\n", Game::server->GetZoneID());
Game::logger->Log("WorldServer", "Finished loading world with zone (%i), ready up!", Game::server->GetZoneID());
MasterPackets::SendWorldReady(Game::server, Game::server->GetZoneID(), Game::server->GetInstanceID());
@ -504,13 +504,13 @@ dLogger * SetupLogger(int zoneID, int instanceID) {
void HandlePacketChat(Packet* packet) {
if (packet->data[0] == ID_DISCONNECTION_NOTIFICATION || packet->data[0] == ID_CONNECTION_LOST) {
Game::logger->Log("WorldServer", "Lost our connection to chat, zone(%i), instance(%i)\n", Game::server->GetZoneID(), Game::server->GetInstanceID());
Game::logger->Log("WorldServer", "Lost our connection to chat, zone(%i), instance(%i)", Game::server->GetZoneID(), Game::server->GetInstanceID());
chatConnected = false;
}
if (packet->data[0] == ID_CONNECTION_REQUEST_ACCEPTED) {
Game::logger->Log("WorldServer", "Established connection to chat, zone(%i), instance (%i)\n",Game::server -> GetZoneID(), Game::server -> GetInstanceID());
Game::logger->Log("WorldServer", "Established connection to chat, zone(%i), instance (%i)",Game::server -> GetZoneID(), Game::server -> GetInstanceID());
Game::chatSysAddr = packet->systemAddress;
chatConnected = true;
@ -617,21 +617,21 @@ void HandlePacketChat(Packet* packet) {
{
TeamManager::Instance()->DeleteTeam(teamID);
Game::logger->Log("WorldServer", "Deleting team (%llu)\n", teamID);
Game::logger->Log("WorldServer", "Deleting team (%llu)", teamID);
break;
}
inStream.Read(lootOption);
inStream.Read(memberCount);
Game::logger->Log("WorldServer", "Updating team (%llu), (%i), (%i)\n", teamID, lootOption, memberCount);
Game::logger->Log("WorldServer", "Updating team (%llu), (%i), (%i)", teamID, lootOption, memberCount);
for (char i = 0; i < memberCount; i++)
{
LWOOBJID member = LWOOBJID_EMPTY;
inStream.Read(member);
members.push_back(member);
Game::logger->Log("WorldServer", "Updating team member (%llu)\n", member);
Game::logger->Log("WorldServer", "Updating team member (%llu)", member);
}
TeamManager::Instance()->UpdateTeam(teamID, lootOption, members);
@ -640,7 +640,7 @@ void HandlePacketChat(Packet* packet) {
}
default:
Game::logger->Log("WorldServer", "Received an unknown chat internal: %i\n", int(packet->data[3]));
Game::logger->Log("WorldServer", "Received an unknown chat internal: %i", int(packet->data[3]));
}
}
}
@ -674,7 +674,7 @@ void HandlePacket(Packet* packet) {
entity->GetCharacter()->SaveXMLToDatabase();
Game::logger->Log("WorldServer", "Deleting player %llu\n", entity->GetObjectID());
Game::logger->Log("WorldServer", "Deleting player %llu", entity->GetObjectID());
EntityManager::Instance()->DestroyEntity(entity);
}
@ -741,12 +741,12 @@ void HandlePacket(Packet* packet) {
//Verify it:
if (userHash != it->second.hash) {
Game::logger->Log("WorldServer", "SOMEONE IS TRYING TO HACK? SESSION KEY MISMATCH: ours: %s != master: %s\n", userHash.c_str(), it->second.hash.c_str());
Game::logger->Log("WorldServer", "SOMEONE IS TRYING TO HACK? SESSION KEY MISMATCH: ours: %s != master: %s", userHash.c_str(), it->second.hash.c_str());
Game::server->Disconnect(it->second.sysAddr, SERVER_DISCON_INVALID_SESSION_KEY);
return;
}
else {
Game::logger->Log("WorldServer", "User %s authenticated with correct key.\n", username.c_str());
Game::logger->Log("WorldServer", "User %s authenticated with correct key.", username.c_str());
UserManager::Instance()->DeleteUser(packet->systemAddress);
@ -791,7 +791,7 @@ void HandlePacket(Packet* packet) {
case MSG_MASTER_AFFIRM_TRANSFER_REQUEST: {
const uint64_t requestID = PacketUtils::ReadPacketU64(8, packet);
Game::logger->Log("MasterServer", "Got affirmation request of transfer %llu\n", requestID);
Game::logger->Log("MasterServer", "Got affirmation request of transfer %llu", requestID);
CBITSTREAM
@ -804,7 +804,7 @@ void HandlePacket(Packet* packet) {
case MSG_MASTER_SHUTDOWN: {
worldShutdownSequenceStarted = true;
Game::logger->Log("WorldServer", "Got shutdown request from master, zone (%i), instance (%i)\n", Game::server->GetZoneID(), Game::server->GetInstanceID());
Game::logger->Log("WorldServer", "Got shutdown request from master, zone (%i), instance (%i)", Game::server->GetZoneID(), Game::server->GetInstanceID());
break;
}
@ -826,13 +826,13 @@ void HandlePacket(Packet* packet) {
//Find them:
User* user = UserManager::Instance()->GetUser(username.c_str());
if (!user) {
Game::logger->Log("WorldServer", "Got new session alert for user %s, but they're not logged in.\n", username.c_str());
Game::logger->Log("WorldServer", "Got new session alert for user %s, but they're not logged in.", username.c_str());
return;
}
//Check the key:
if (sessionKey != std::atoi(user->GetSessionKey().c_str())) {
Game::logger->Log("WorldServer", "Got new session alert for user %s, but the session key is invalid.\n", username.c_str());
Game::logger->Log("WorldServer", "Got new session alert for user %s, but the session key is invalid.", username.c_str());
Game::server->Disconnect(user->GetSystemAddress(), SERVER_DISCON_INVALID_SESSION_KEY);
return;
}
@ -840,7 +840,7 @@ void HandlePacket(Packet* packet) {
}
default:
Game::logger->Log("WorldServer", "Unknown packet ID from master %i\n", int(packet->data[3]));
Game::logger->Log("WorldServer", "Unknown packet ID from master %i", int(packet->data[3]));
}
return;
@ -873,7 +873,7 @@ void HandlePacket(Packet* packet) {
// Developers may skip this check
if (gmLevel < 8 && clientDatabaseChecksum != databaseChecksum) {
Game::logger->Log("WorldServer", "Client's database checksum does not match the server's, aborting connection.\n");
Game::logger->Log("WorldServer", "Client's database checksum does not match the server's, aborting connection.");
Game::server->Disconnect(packet->systemAddress, SERVER_DISCON_KICK);
return;
}
@ -977,7 +977,7 @@ void HandlePacket(Packet* packet) {
}
case MSG_WORLD_CLIENT_LEVEL_LOAD_COMPLETE: {
Game::logger->Log("WorldServer", "Received level load complete from user.\n");
Game::logger->Log("WorldServer", "Received level load complete from user.");
User* user = UserManager::Instance()->GetUser(packet->systemAddress);
if (user) {
Character* c = user->GetLastUsedChar();
@ -1036,7 +1036,7 @@ void HandlePacket(Packet* packet) {
auto result = query.execQuery();
if (result.eof() || result.fieldIsNull(0)) {
Game::logger->Log("WorldServer", "No property templates found for zone %d, not sending BBB\n", zoneId);
Game::logger->Log("WorldServer", "No property templates found for zone %d, not sending BBB", zoneId);
goto noBBB;
}
@ -1064,7 +1064,7 @@ void HandlePacket(Packet* packet) {
stmt->setUInt64(1, propertyId);
auto res = stmt->executeQuery();
while (res->next()) {
Game::logger->Log("UGC", "Getting lxfml ugcID: " + std::to_string(res->getUInt(1)) + "\n");
Game::logger->Log("UGC", "Getting lxfml ugcID: " + std::to_string(res->getUInt(1)));
//Get lxfml:
auto stmtL = Database::CreatePreppedStmt("SELECT lxfml from ugc where id=?");
@ -1154,11 +1154,11 @@ void HandlePacket(Packet* packet) {
}
}
else {
Game::logger->Log("WorldServer", "Couldn't find character to log in with for user %s (%i)!\n", user->GetUsername().c_str(), user->GetAccountID());
Game::logger->Log("WorldServer", "Couldn't find character to log in with for user %s (%i)!", user->GetUsername().c_str(), user->GetAccountID());
Game::server->Disconnect(packet->systemAddress, SERVER_DISCON_CHARACTER_NOT_FOUND);
}
} else {
Game::logger->Log("WorldServer", "Couldn't get user for level load complete!\n");
Game::logger->Log("WorldServer", "Couldn't get user for level load complete!");
}
break;
}
@ -1185,7 +1185,7 @@ void HandlePacket(Packet* packet) {
inStream.Read(size);
if (size > 20000) {
Game::logger->Log("WorldServer", "Tried to route a packet with a read size > 20000, so likely a false packet.\n");
Game::logger->Log("WorldServer", "Tried to route a packet with a read size > 20000, so likely a false packet.");
return;
}
@ -1248,38 +1248,36 @@ void HandlePacket(Packet* packet) {
}
default:
Game::server->GetLogger()->Log("HandlePacket", "Unknown world packet received: %i\n", int(packet->data[3]));
Game::server->GetLogger()->Log("HandlePacket", "Unknown world packet received: %i", int(packet->data[3]));
}
}
void WorldShutdownProcess(uint32_t zoneId) {
Game::logger->Log("WorldServer", "Saving map %i instance %i\n", zoneId, instanceID);
Game::logger->Log("WorldServer", "Saving map %i instance %i", zoneId, instanceID);
for (auto i = 0; i < Game::server->GetReplicaManager()->GetParticipantCount(); ++i) {
const auto& player = Game::server->GetReplicaManager()->GetParticipantAtIndex(i);
auto* entity = Player::GetPlayer(player);
Game::logger->Log("WorldServer", "Saving data!\n");
Game::logger->Log("WorldServer", "Saving data!");
if (entity != nullptr && entity->GetCharacter() != nullptr) {
auto* skillComponent = entity->GetComponent<SkillComponent>();
if (skillComponent != nullptr) {
skillComponent->Reset();
}
std::string message = "Saving character " + entity->GetCharacter()->GetName() + "...\n";
Game::logger->Log("WorldServer", message);
Game::logger->Log("WorldServer", "Saving character %s...", entity->GetCharacter()->GetName().c_str());
entity->GetCharacter()->SaveXMLToDatabase();
message = "Character data for " + entity->GetCharacter()->GetName() + " was saved!\n";
Game::logger->Log("WorldServer", message);
Game::logger->Log("WorldServer", "Character data for %s was saved!", entity->GetCharacter()->GetName().c_str());
}
}
if (PropertyManagementComponent::Instance() != nullptr) {
Game::logger->Log("WorldServer", "Saving ALL property data for zone %i clone %i!\n", zoneId, PropertyManagementComponent::Instance()->GetCloneId());
Game::logger->Log("WorldServer", "Saving ALL property data for zone %i clone %i!", zoneId, PropertyManagementComponent::Instance()->GetCloneId());
PropertyManagementComponent::Instance()->Save();
Game::logger->Log("WorldServer", "ALL property data saved for zone %i clone %i!\n", zoneId, PropertyManagementComponent::Instance()->GetCloneId());
Game::logger->Log("WorldServer", "ALL property data saved for zone %i clone %i!", zoneId, PropertyManagementComponent::Instance()->GetCloneId());
}
Game::logger->Log("WorldServer", "ALL DATA HAS BEEN SAVED FOR ZONE %i INSTANCE %i!\n", zoneId, instanceID);
Game::logger->Log("WorldServer", "ALL DATA HAS BEEN SAVED FOR ZONE %i INSTANCE %i!", zoneId, instanceID);
while (Game::server->GetReplicaManager()->GetParticipantCount() > 0) {
const auto& player = Game::server->GetReplicaManager()->GetParticipantAtIndex(0);
@ -1296,7 +1294,7 @@ void WorldShutdownSequence() {
worldShutdownSequenceStarted = true;
Game::logger->Log("WorldServer", "Zone (%i) instance (%i) shutting down outside of main loop!\n", Game::server->GetZoneID(), instanceID);
Game::logger->Log("WorldServer", "Zone (%i) instance (%i) shutting down outside of main loop!", Game::server->GetZoneID(), instanceID);
WorldShutdownProcess(Game::server->GetZoneID());
FinalizeShutdown();
}
@ -1306,7 +1304,7 @@ void FinalizeShutdown() {
if (Game::physicsWorld) Game::physicsWorld = nullptr;
if (Game::zoneManager) delete Game::zoneManager;
Game::logger->Log("WorldServer", "Shutdown complete, zone (%i), instance (%i)\n", Game::server->GetZoneID(), instanceID);
Game::logger->Log("WorldServer", "Shutdown complete, zone (%i), instance (%i)", Game::server->GetZoneID(), instanceID);
Metrics::Clear();
Database::Destroy("WorldServer");

View File

@ -18,11 +18,10 @@ Level::Level(Zone* parentZone, const std::string& filepath) {
m_ParentZone = parentZone;
std::ifstream file(filepath, std::ios_base::in | std::ios_base::binary);
if (file) {
//printf("Opened %s\n", filepath.c_str());
ReadChunks(file);
}
else {
Game::logger->Log("Level", "Failed to load %s\n", filepath.c_str());
Game::logger->Log("Level", "Failed to load %s", filepath.c_str());
}
file.close();
@ -350,6 +349,5 @@ void Level::ReadSceneObjectDataChunk(std::ifstream & file, Header & header) {
}
}
//printf("Loaded %u objects!\n", objectsCount);
header.sceneObjects = chunk;
}

View File

@ -24,7 +24,7 @@ Zone::Zone(const LWOMAPID & mapID, const LWOINSTANCEID & instanceID, const LWOCL
}
Zone::~Zone() {
Game::logger->Log("Zone", "Destroying zone %i\n", m_ZoneID.GetMapID());
Game::logger->Log("Zone", "Destroying zone %i", m_ZoneID.GetMapID());
for (std::map<LWOSCENEID, SceneRef>::iterator it = m_Scenes.begin(); it != m_Scenes.end(); ++it) {
if (it->second.level != nullptr) delete it->second.level;
}
@ -50,7 +50,7 @@ void Zone::LoadZoneIntoMemory() {
if (m_ZoneFileFormatVersion >= Zone::ZoneFileFormatVersion::Alpha) BinaryIO::BinaryRead(file, mapRevision);
BinaryIO::BinaryRead(file, m_WorldID);
if ((uint16_t)m_WorldID != m_ZoneID.GetMapID()) Game::logger->Log("Zone", "WorldID: %i doesn't match MapID %i! Is this intended?\n", m_WorldID, m_ZoneID.GetMapID());
if ((uint16_t)m_WorldID != m_ZoneID.GetMapID()) Game::logger->Log("Zone", "WorldID: %i doesn't match MapID %i! Is this intended?", m_WorldID, m_ZoneID.GetMapID());
AddRevision(LWOSCENEID_INVALID, mapRevision);
@ -159,7 +159,7 @@ void Zone::LoadZoneIntoMemory() {
}
}
else {
Game::logger->Log("Zone", "Failed to open: %s\n", m_ZoneFilePath.c_str());
Game::logger->Log("Zone", "Failed to open: %s", m_ZoneFilePath.c_str());
}
m_ZonePath = m_ZoneFilePath.substr(0, m_ZoneFilePath.rfind('/') + 1);
@ -226,7 +226,7 @@ void Zone::AddRevision(LWOSCENEID sceneID, uint32_t revision) {
const void Zone::PrintAllGameObjects() {
for (std::pair<LWOSCENEID, SceneRef> scene : m_Scenes) {
Game::logger->Log("Zone", "\nIn sceneID: %i\n\n", scene.first.GetSceneID());
Game::logger->Log("Zone", "In sceneID: %i", scene.first.GetSceneID());
scene.second.level->PrintAllObjects();
}
}
@ -283,10 +283,10 @@ std::vector<LUTriggers::Trigger*> Zone::LoadLUTriggers(std::string triggerFile,
if (!doc) return lvlTriggers;
if (doc->Parse(data.str().c_str(), data.str().size()) == 0) {
//Game::logger->Log("Zone", "Loaded LUTriggers from file %s!\n", triggerFile.c_str());
//Game::logger->Log("Zone", "Loaded LUTriggers from file %s!", triggerFile.c_str());
}
else {
Game::logger->Log("Zone", "Failed to load LUTriggers from file %s\n", triggerFile.c_str());
Game::logger->Log("Zone", "Failed to load LUTriggers from file %s", triggerFile.c_str());
return lvlTriggers;
}

View File

@ -15,7 +15,7 @@
dZoneManager* dZoneManager::m_Address = nullptr;
void dZoneManager::Initialize(const LWOZONEID& zoneID) {
Game::logger->Log("dZoneManager", "Preparing zone: %i/%i/%i\n", zoneID.GetMapID(), zoneID.GetInstanceID(), zoneID.GetCloneID());
Game::logger->Log("dZoneManager", "Preparing zone: %i/%i/%i", zoneID.GetMapID(), zoneID.GetInstanceID(), zoneID.GetCloneID());
int64_t startTime = 0;
int64_t endTime = 0;
@ -40,7 +40,7 @@ void dZoneManager::Initialize(const LWOZONEID& zoneID) {
}
}
Game::logger->Log("dZoneManager", "Creating zone control object %i\n", zoneControlTemplate);
Game::logger->Log("dZoneManager", "Creating zone control object %i", zoneControlTemplate);
// Create ZoneControl object
EntityInfo info;
@ -53,7 +53,7 @@ void dZoneManager::Initialize(const LWOZONEID& zoneID) {
endTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
Game::logger->Log("dZoneManager", "Zone prepared in: %llu ms\n", (endTime - startTime));
Game::logger->Log("dZoneManager", "Zone prepared in: %llu ms", (endTime - startTime));
VanityUtilities::SpawnVanity();
}
@ -89,7 +89,7 @@ void dZoneManager::NotifyZone(const dZoneNotifier & notifier, const LWOOBJID& ob
case dZoneNotifier::SpawnedChildObjectDestroyed:
break;
case dZoneNotifier::ReloadZone:
Game::logger->Log("dZoneManager", "Forcing reload of zone %i\n", m_ZoneID.GetMapID());
Game::logger->Log("dZoneManager", "Forcing reload of zone %i", m_ZoneID.GetMapID());
LoadZone(m_ZoneID);
m_pZone->Initalize();
@ -102,10 +102,10 @@ void dZoneManager::NotifyZone(const dZoneNotifier & notifier, const LWOOBJID& ob
m_pZone->PrintAllGameObjects();
break;
case dZoneNotifier::InvalidNotifier:
Game::logger->Log("dZoneManager", "Got an invalid zone notifier.\n");
Game::logger->Log("dZoneManager", "Got an invalid zone notifier.");
break;
default:
Game::logger->Log("dZoneManager", "Unknown zone notifier: %i\n", int(notifier));
Game::logger->Log("dZoneManager", "Unknown zone notifier: %i", int(notifier));
}
}
@ -188,7 +188,7 @@ void dZoneManager::RemoveSpawner(const LWOOBJID id)
auto* spawner = GetSpawner(id);
if (spawner == nullptr) {
Game::logger->Log("dZoneManager", "Failed to find spawner (%llu)\n", id);
Game::logger->Log("dZoneManager", "Failed to find spawner (%llu)", id);
return;
}
@ -199,7 +199,7 @@ void dZoneManager::RemoveSpawner(const LWOOBJID id)
}
else {
Game::logger->Log("dZoneManager", "Failed to find spawner entity (%llu)\n", id);
Game::logger->Log("dZoneManager", "Failed to find spawner entity (%llu)", id);
}
for (auto* node : spawner->m_Info.nodes)
@ -218,7 +218,7 @@ void dZoneManager::RemoveSpawner(const LWOOBJID id)
spawner->Deactivate();
Game::logger->Log("dZoneManager", "Destroying spawner (%llu)\n", id);
Game::logger->Log("dZoneManager", "Destroying spawner (%llu)", id);
m_Spawners.erase(id);