mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-16 20:24:39 -06:00
Compare commits
10 Commits
fix-empty-
...
fmtlib-exp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c4ea2ae71 | ||
|
|
cfb0826d22 | ||
|
|
3164bad9af | ||
|
|
ceb1d5d82a | ||
|
|
494c2b5784 | ||
|
|
0bcae8e555 | ||
|
|
7250aa51f6 | ||
|
|
ac6c68ecff | ||
|
|
642c86a449 | ||
|
|
73312cb948 |
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -17,3 +17,6 @@
|
||||
[submodule "thirdparty/magic_enum"]
|
||||
path = thirdparty/magic_enum
|
||||
url = https://github.com/Neargye/magic_enum.git
|
||||
[submodule "thirdparty/fmt"]
|
||||
path = thirdparty/fmt
|
||||
url = https://github.com/fmtlib/fmt.git
|
||||
|
||||
@@ -287,7 +287,7 @@ add_subdirectory(dPhysics)
|
||||
add_subdirectory(dServer)
|
||||
|
||||
# Create a list of common libraries shared between all binaries
|
||||
set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "raknet" "MariaDB::ConnCpp" "magic_enum")
|
||||
set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "fmt" "raknet" "MariaDB::ConnCpp" "magic_enum")
|
||||
|
||||
# Add platform specific common libraries
|
||||
if(UNIX)
|
||||
|
||||
@@ -54,14 +54,14 @@ int main(int argc, char** argv) {
|
||||
Server::SetupLogger("AuthServer");
|
||||
if (!Game::logger) return EXIT_FAILURE;
|
||||
|
||||
LOG("Starting Auth server...");
|
||||
LOG("Version: %s", PROJECT_VERSION);
|
||||
LOG("Compiled on: %s", __TIMESTAMP__);
|
||||
Log::Info("Starting Auth server...");
|
||||
Log::Info("Version: {:s}", PROJECT_VERSION);
|
||||
Log::Info("Compiled on: {:s}", __TIMESTAMP__);
|
||||
|
||||
try {
|
||||
Database::Connect();
|
||||
} catch (sql::SQLException& ex) {
|
||||
LOG("Got an error while connecting to the database: %s", ex.what());
|
||||
Log::Info("Got an error while connecting to the database: {:s}", ex.what());
|
||||
Database::Destroy("AuthServer");
|
||||
delete Game::server;
|
||||
delete Game::logger;
|
||||
@@ -77,7 +77,7 @@ int main(int argc, char** argv) {
|
||||
masterIP = masterInfo->ip;
|
||||
masterPort = masterInfo->port;
|
||||
}
|
||||
LOG("Master is at %s:%d", masterIP.c_str(), masterPort);
|
||||
Log::Info("Master is at {:s}:{:d}", masterIP, masterPort);
|
||||
|
||||
Game::randomEngine = std::mt19937(time(0));
|
||||
|
||||
@@ -110,7 +110,7 @@ int main(int argc, char** argv) {
|
||||
framesSinceMasterDisconnect++;
|
||||
|
||||
if (framesSinceMasterDisconnect >= authFramerate) {
|
||||
LOG("No connection to master!");
|
||||
Log::Info("No connection to master!");
|
||||
break; //Exit our loop, shut down.
|
||||
}
|
||||
} else framesSinceMasterDisconnect = 0;
|
||||
@@ -151,7 +151,7 @@ int main(int argc, char** argv) {
|
||||
std::this_thread::sleep_until(t);
|
||||
}
|
||||
|
||||
LOG("Exited Main Loop! (signal %d)", Game::lastSignal);
|
||||
Log::Info("Exited Main Loop! (signal {:d})", Game::lastSignal);
|
||||
//Delete our objects here:
|
||||
Database::Destroy("AuthServer");
|
||||
delete Game::server;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
add_executable(AuthServer "AuthServer.cpp")
|
||||
|
||||
target_link_libraries(AuthServer ${COMMON_LIBRARIES} dServer)
|
||||
target_link_libraries(AuthServer PRIVATE ${COMMON_LIBRARIES} dServer)
|
||||
|
||||
target_include_directories(AuthServer PRIVATE ${PROJECT_SOURCE_DIR}/dServer)
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@ add_compile_definitions(ChatServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}
|
||||
add_library(dChatServer ${DCHATSERVER_SOURCES})
|
||||
target_include_directories(dChatServer PRIVATE "${PROJECT_SOURCE_DIR}/dServer")
|
||||
|
||||
target_link_libraries(dChatServer ${COMMON_LIBRARIES} dChatFilter)
|
||||
target_link_libraries(ChatServer ${COMMON_LIBRARIES} dChatFilter dChatServer dServer)
|
||||
target_link_libraries(dChatServer PRIVATE ${COMMON_LIBRARIES} dChatFilter)
|
||||
target_link_libraries(ChatServer PRIVATE ${COMMON_LIBRARIES} dChatFilter dChatServer dServer)
|
||||
|
||||
|
||||
@@ -27,16 +27,16 @@ void ChatIgnoreList::GetIgnoreList(Packet* packet) {
|
||||
|
||||
auto& receiver = Game::playerContainer.GetPlayerDataMutable(playerId);
|
||||
if (!receiver) {
|
||||
LOG("Tried to get ignore list, but player %llu not found in container", playerId);
|
||||
Log::Info("Tried to get ignore list, but player {:d} not found in container", playerId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!receiver.ignoredPlayers.empty()) {
|
||||
LOG_DEBUG("Player %llu already has an ignore list, but is requesting it again.", playerId);
|
||||
Log::Debug("Player {:d} already has an ignore list, but is requesting it again.", playerId);
|
||||
} else {
|
||||
auto ignoreList = Database::Get()->GetIgnoreList(static_cast<uint32_t>(playerId));
|
||||
if (ignoreList.empty()) {
|
||||
LOG_DEBUG("Player %llu has no ignores", playerId);
|
||||
Log::Debug("Player {:d} has no ignores", playerId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -69,13 +69,13 @@ void ChatIgnoreList::AddIgnore(Packet* packet) {
|
||||
|
||||
auto& receiver = Game::playerContainer.GetPlayerDataMutable(playerId);
|
||||
if (!receiver) {
|
||||
LOG("Tried to get ignore list, but player %llu not found in container", playerId);
|
||||
Log::Info("Tried to get ignore list, but player {:d} not found in container", playerId);
|
||||
return;
|
||||
}
|
||||
|
||||
constexpr int32_t MAX_IGNORES = 32;
|
||||
if (receiver.ignoredPlayers.size() > MAX_IGNORES) {
|
||||
LOG_DEBUG("Player %llu has too many ignores", playerId);
|
||||
Log::Debug("Player {:d} has too many ignores", playerId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -91,11 +91,11 @@ void ChatIgnoreList::AddIgnore(Packet* packet) {
|
||||
// Check if the player exists
|
||||
LWOOBJID ignoredPlayerId = LWOOBJID_EMPTY;
|
||||
if (toIgnoreStr == receiver.playerName || toIgnoreStr.find("[GM]") == 0) {
|
||||
LOG_DEBUG("Player %llu tried to ignore themselves", playerId);
|
||||
Log::Debug("Player {:d} tried to ignore themselves", playerId);
|
||||
|
||||
bitStream.Write(ChatIgnoreList::AddResponse::GENERAL_ERROR);
|
||||
} else if (std::count(receiver.ignoredPlayers.begin(), receiver.ignoredPlayers.end(), toIgnoreStr) > 0) {
|
||||
LOG_DEBUG("Player %llu is already ignoring %s", playerId, toIgnoreStr.c_str());
|
||||
Log::Debug("Player {:d} is already ignoring {:s}", playerId, toIgnoreStr);
|
||||
|
||||
bitStream.Write(ChatIgnoreList::AddResponse::ALREADY_IGNORED);
|
||||
} else {
|
||||
@@ -105,7 +105,7 @@ void ChatIgnoreList::AddIgnore(Packet* packet) {
|
||||
// Fall back to query
|
||||
auto player = Database::Get()->GetCharacterInfo(toIgnoreStr);
|
||||
if (!player || player->name != toIgnoreStr) {
|
||||
LOG_DEBUG("Player %s not found", toIgnoreStr.c_str());
|
||||
Log::Debug("Player {:s} not found", toIgnoreStr);
|
||||
} else {
|
||||
ignoredPlayerId = player->id;
|
||||
}
|
||||
@@ -119,7 +119,7 @@ void ChatIgnoreList::AddIgnore(Packet* packet) {
|
||||
GeneralUtils::SetBit(ignoredPlayerId, eObjectBits::PERSISTENT);
|
||||
|
||||
receiver.ignoredPlayers.emplace_back(toIgnoreStr, ignoredPlayerId);
|
||||
LOG_DEBUG("Player %llu is ignoring %s", playerId, toIgnoreStr.c_str());
|
||||
Log::Debug("Player {:d} is ignoring {:s}", playerId, toIgnoreStr);
|
||||
|
||||
bitStream.Write(ChatIgnoreList::AddResponse::SUCCESS);
|
||||
} else {
|
||||
@@ -141,7 +141,7 @@ void ChatIgnoreList::RemoveIgnore(Packet* packet) {
|
||||
|
||||
auto& receiver = Game::playerContainer.GetPlayerDataMutable(playerId);
|
||||
if (!receiver) {
|
||||
LOG("Tried to get ignore list, but player %llu not found in container", playerId);
|
||||
Log::Info("Tried to get ignore list, but player {:d} not found in container", playerId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ void ChatIgnoreList::RemoveIgnore(Packet* packet) {
|
||||
|
||||
auto toRemove = std::remove(receiver.ignoredPlayers.begin(), receiver.ignoredPlayers.end(), removedIgnoreStr);
|
||||
if (toRemove == receiver.ignoredPlayers.end()) {
|
||||
LOG_DEBUG("Player %llu is not ignoring %s", playerId, removedIgnoreStr.c_str());
|
||||
Log::Debug("Player {:d} is not ignoring {:s}", playerId, removedIgnoreStr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ void ChatPacketHandler::HandleFriendRequest(Packet* packet) {
|
||||
|
||||
auto& requestor = Game::playerContainer.GetPlayerDataMutable(requestorPlayerID);
|
||||
if (!requestor) {
|
||||
LOG("No requestor player %llu sent to %s found.", requestorPlayerID, playerName.c_str());
|
||||
Log::Info("No requestor player {:d} sent to {:s} found.", requestorPlayerID, playerName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ void ChatPacketHandler::HandleChatMessage(Packet* packet) {
|
||||
LUWString message(size);
|
||||
inStream.Read(message);
|
||||
|
||||
LOG("Got a message from (%s) via [%s]: %s", sender.playerName.c_str(), StringifiedEnum::ToString(channel).data(), message.GetAsString().c_str());
|
||||
Log::Info("Got a message from ({:s}) via [{:s}]: {:s}", sender.playerName, StringifiedEnum::ToString(channel), message.GetAsString());
|
||||
|
||||
switch (channel) {
|
||||
case eChatChannel::TEAM: {
|
||||
@@ -391,7 +391,7 @@ void ChatPacketHandler::HandleChatMessage(Packet* packet) {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG("Unhandled Chat channel [%s]", StringifiedEnum::ToString(channel).data());
|
||||
Log::Info("Unhandled Chat channel [{:s}]", StringifiedEnum::ToString(channel));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -412,7 +412,7 @@ void ChatPacketHandler::HandlePrivateChatMessage(Packet* packet) {
|
||||
|
||||
inStream.IgnoreBytes(4);
|
||||
inStream.Read(channel);
|
||||
if (channel != eChatChannel::PRIVATE_CHAT) LOG("WARNING: Received Private chat with the wrong channel!");
|
||||
if (channel != eChatChannel::PRIVATE_CHAT) Log::Info("WARNING: Received Private chat with the wrong channel!");
|
||||
|
||||
inStream.Read(size);
|
||||
inStream.IgnoreBytes(77);
|
||||
@@ -424,7 +424,7 @@ void ChatPacketHandler::HandlePrivateChatMessage(Packet* packet) {
|
||||
LUWString message(size);
|
||||
inStream.Read(message);
|
||||
|
||||
LOG("Got a message from (%s) via [%s]: %s to %s", sender.playerName.c_str(), StringifiedEnum::ToString(channel).data(), message.GetAsString().c_str(), receiverName.c_str());
|
||||
Log::Info("Got a message from ({:s}) via [{:s}]: {:s} to {:s}", sender.playerName, StringifiedEnum::ToString(channel), message.GetAsString(), receiverName);
|
||||
|
||||
const auto& receiver = Game::playerContainer.GetPlayerData(receiverName);
|
||||
if (!receiver) {
|
||||
@@ -506,13 +506,13 @@ void ChatPacketHandler::HandleTeamInvite(Packet* packet) {
|
||||
if (team->memberIDs.size() > 3) {
|
||||
// no more teams greater than 4
|
||||
|
||||
LOG("Someone tried to invite a 5th player to a team");
|
||||
Log::Info("Someone tried to invite a 5th player to a team");
|
||||
return;
|
||||
}
|
||||
|
||||
SendTeamInvite(other, player);
|
||||
|
||||
LOG("Got team invite: %llu -> %s", playerID, invitedPlayer.GetAsString().c_str());
|
||||
Log::Info("Got team invite: {:d} -> {:s}", playerID, invitedPlayer.GetAsString());
|
||||
}
|
||||
|
||||
void ChatPacketHandler::HandleTeamInviteResponse(Packet* packet) {
|
||||
@@ -526,7 +526,7 @@ void ChatPacketHandler::HandleTeamInviteResponse(Packet* packet) {
|
||||
LWOOBJID leaderID = LWOOBJID_EMPTY;
|
||||
inStream.Read(leaderID);
|
||||
|
||||
LOG("Accepted invite: %llu -> %llu (%d)", playerID, leaderID, declined);
|
||||
Log::Info("Accepted invite: {:d} -> {:d} ({:d})", playerID, leaderID, declined);
|
||||
|
||||
if (declined) {
|
||||
return;
|
||||
@@ -535,13 +535,13 @@ void ChatPacketHandler::HandleTeamInviteResponse(Packet* packet) {
|
||||
auto* team = Game::playerContainer.GetTeam(leaderID);
|
||||
|
||||
if (team == nullptr) {
|
||||
LOG("Failed to find team for leader (%llu)", leaderID);
|
||||
Log::Info("Failed to find team for leader ({:d})", leaderID);
|
||||
|
||||
team = Game::playerContainer.GetTeam(playerID);
|
||||
}
|
||||
|
||||
if (team == nullptr) {
|
||||
LOG("Failed to find team for player (%llu)", playerID);
|
||||
Log::Info("Failed to find team for player ({:d})", playerID);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -557,7 +557,7 @@ void ChatPacketHandler::HandleTeamLeave(Packet* packet) {
|
||||
|
||||
auto* team = Game::playerContainer.GetTeam(playerID);
|
||||
|
||||
LOG("(%llu) leaving team", playerID);
|
||||
Log::Info("({:d}) leaving team", playerID);
|
||||
|
||||
if (team != nullptr) {
|
||||
Game::playerContainer.RemoveMember(team, playerID, false, false, true);
|
||||
@@ -575,7 +575,7 @@ void ChatPacketHandler::HandleTeamKick(Packet* packet) {
|
||||
inStream.Read(kickedPlayer);
|
||||
|
||||
|
||||
LOG("(%llu) kicking (%s) from team", playerID, kickedPlayer.GetAsString().c_str());
|
||||
Log::Info("({:d}) kicking ({:s}) from team", playerID, kickedPlayer.GetAsString());
|
||||
|
||||
const auto& kicked = Game::playerContainer.GetPlayerData(kickedPlayer.GetAsString());
|
||||
|
||||
@@ -608,7 +608,7 @@ void ChatPacketHandler::HandleTeamPromote(Packet* packet) {
|
||||
inStream.IgnoreBytes(4);
|
||||
inStream.Read(promotedPlayer);
|
||||
|
||||
LOG("(%llu) promoting (%s) to team leader", playerID, promotedPlayer.GetAsString().c_str());
|
||||
Log::Info("({:d}) promoting ({:s}) to team leader", playerID, promotedPlayer.GetAsString());
|
||||
|
||||
const auto& promoted = Game::playerContainer.GetPlayerData(promotedPlayer.GetAsString());
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@ int main(int argc, char** argv) {
|
||||
|
||||
//Read our config:
|
||||
|
||||
LOG("Starting Chat server...");
|
||||
LOG("Version: %s", PROJECT_VERSION);
|
||||
LOG("Compiled on: %s", __TIMESTAMP__);
|
||||
Log::Info("Starting Chat server...");
|
||||
Log::Info("Version: {:s}", PROJECT_VERSION);
|
||||
Log::Info("Compiled on: {:s}", __TIMESTAMP__);
|
||||
|
||||
try {
|
||||
std::string clientPathStr = Game::config->GetValue("client_location");
|
||||
@@ -74,7 +74,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
Game::assetManager = new AssetManager(clientPath);
|
||||
} catch (std::runtime_error& ex) {
|
||||
LOG("Got an error while setting up assets: %s", ex.what());
|
||||
Log::Info("Got an error while setting up assets: {:s}", ex.what());
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ int main(int argc, char** argv) {
|
||||
try {
|
||||
Database::Connect();
|
||||
} catch (sql::SQLException& ex) {
|
||||
LOG("Got an error while connecting to the database: %s", ex.what());
|
||||
Log::Info("Got an error while connecting to the database: {:s}", ex.what());
|
||||
Database::Destroy("ChatServer");
|
||||
delete Game::server;
|
||||
delete Game::logger;
|
||||
@@ -181,11 +181,11 @@ int main(int argc, char** argv) {
|
||||
|
||||
void HandlePacket(Packet* packet) {
|
||||
if (packet->data[0] == ID_DISCONNECTION_NOTIFICATION || packet->data[0] == ID_CONNECTION_LOST) {
|
||||
LOG("A server has disconnected, erasing their connected players from the list.");
|
||||
Log::Info("A server has disconnected, erasing their connected players from the list.");
|
||||
}
|
||||
|
||||
if (packet->data[0] == ID_NEW_INCOMING_CONNECTION) {
|
||||
LOG("A server is connecting, awaiting user list.");
|
||||
Log::Info("A server is connecting, awaiting user list.");
|
||||
}
|
||||
|
||||
if (packet->length < 4) return; // Nothing left to process. Need 4 bytes to continue.
|
||||
@@ -216,7 +216,7 @@ void HandlePacket(Packet* packet) {
|
||||
}
|
||||
|
||||
default:
|
||||
LOG("Unknown CHAT_INTERNAL id: %i", int(packet->data[3]));
|
||||
Log::Info("Unknown CHAT_INTERNAL id: {:d}", static_cast<int>(packet->data[3]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,22 +343,22 @@ void HandlePacket(Packet* packet) {
|
||||
case eChatMessageType::PRG_CSR_COMMAND:
|
||||
case eChatMessageType::HEARTBEAT_REQUEST_FROM_WORLD:
|
||||
case eChatMessageType::UPDATE_FREE_TRIAL_STATUS:
|
||||
LOG("Unhandled CHAT Message id: %s (%i)", StringifiedEnum::ToString(chat_message_type).data(), chat_message_type);
|
||||
Log::Info("Unhandled CHAT Message id: {:s} {:d}", StringifiedEnum::ToString(chat_message_type), GeneralUtils::ToUnderlying(chat_message_type));
|
||||
break;
|
||||
default:
|
||||
LOG("Unknown CHAT Message id: %i", chat_message_type);
|
||||
Log::Info("Unknown CHAT Message id: {:d}", GeneralUtils::ToUnderlying(chat_message_type));
|
||||
}
|
||||
}
|
||||
|
||||
if (static_cast<eConnectionType>(packet->data[1]) == eConnectionType::WORLD) {
|
||||
switch (static_cast<eWorldMessageType>(packet->data[3])) {
|
||||
case eWorldMessageType::ROUTE_PACKET: {
|
||||
LOG("Routing packet from world");
|
||||
Log::Info("Routing packet from world");
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
LOG("Unknown World id: %i", int(packet->data[3]));
|
||||
Log::Info("Unknown World id: {:d}", static_cast<int>(packet->data[3]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void PlayerContainer::InsertPlayer(Packet* packet) {
|
||||
CINSTREAM_SKIP_HEADER;
|
||||
LWOOBJID playerId;
|
||||
if (!inStream.Read(playerId)) {
|
||||
LOG("Failed to read player ID");
|
||||
Log::Warn("Failed to read player ID");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void PlayerContainer::InsertPlayer(Packet* packet) {
|
||||
|
||||
m_Names[data.playerID] = GeneralUtils::UTF8ToUTF16(data.playerName);
|
||||
|
||||
LOG("Added user: %s (%llu), zone: %i", data.playerName.c_str(), data.playerID, data.zoneID.GetMapID());
|
||||
Log::Info("Added user: {:s} ({:d}), zone: {:d}", data.playerName, data.playerID, data.zoneID.GetMapID());
|
||||
|
||||
Database::Get()->UpdateActivityLog(data.playerID, eActivityType::PlayerLoggedIn, data.zoneID.GetMapID());
|
||||
}
|
||||
@@ -64,7 +64,7 @@ void PlayerContainer::RemovePlayer(Packet* packet) {
|
||||
const auto& player = GetPlayerData(playerID);
|
||||
|
||||
if (!player) {
|
||||
LOG("Failed to find user: %llu", playerID);
|
||||
Log::Info("Failed to find user: {:d}", playerID);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ void PlayerContainer::RemovePlayer(Packet* packet) {
|
||||
}
|
||||
}
|
||||
|
||||
LOG("Removed user: %llu", playerID);
|
||||
Log::Info("Removed user: {:d}", playerID);
|
||||
m_Players.erase(playerID);
|
||||
|
||||
Database::Get()->UpdateActivityLog(playerID, eActivityType::PlayerLoggedOut, player.zoneID.GetMapID());
|
||||
@@ -103,7 +103,7 @@ void PlayerContainer::MuteUpdate(Packet* packet) {
|
||||
auto& player = this->GetPlayerDataMutable(playerID);
|
||||
|
||||
if (!player) {
|
||||
LOG("Failed to find user: %llu", playerID);
|
||||
Log::Warn("Failed to find user: {:d}", playerID);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ TeamData* PlayerContainer::GetTeam(LWOOBJID playerID) {
|
||||
|
||||
void PlayerContainer::AddMember(TeamData* team, LWOOBJID playerID) {
|
||||
if (team->memberIDs.size() >= 4) {
|
||||
LOG("Tried to add player to team that already had 4 players");
|
||||
Log::Warn("Tried to add player to team that already had 4 players");
|
||||
const auto& player = GetPlayerData(playerID);
|
||||
if (!player) return;
|
||||
ChatPackets::SendSystemMessage(player.sysAddr, u"The teams is full! You have not been added to a team!");
|
||||
|
||||
@@ -29,7 +29,7 @@ void RakNet::BitStream::Write<AMFBaseValue&>(AMFBaseValue& value) {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LOG("Encountered unwritable AMFType %i!", type);
|
||||
Log::Warn("Encountered unwritable AMFType {:d}!", GeneralUtils::ToUnderlying(type));
|
||||
}
|
||||
case eAmf::Undefined:
|
||||
case eAmf::Null:
|
||||
|
||||
@@ -54,14 +54,14 @@ uint32_t BrickByBrickFix::TruncateBrokenBrickByBrickXml() {
|
||||
completeUncompressedModel.append(reinterpret_cast<char*>(uncompressedChunk.get()));
|
||||
completeUncompressedModel.resize(previousSize + actualUncompressedSize);
|
||||
} else {
|
||||
LOG("Failed to inflate chunk %i for model %llu. Error: %i", chunkCount, model.id, err);
|
||||
Log::Warn("Failed to inflate chunk {} for model %llu. Error: {}", chunkCount, model.id, err);
|
||||
break;
|
||||
}
|
||||
chunkCount++;
|
||||
}
|
||||
std::unique_ptr<tinyxml2::XMLDocument> document = std::make_unique<tinyxml2::XMLDocument>();
|
||||
if (!document) {
|
||||
LOG("Failed to initialize tinyxml document. Aborting.");
|
||||
Log::Warn("Failed to initialize tinyxml document. Aborting.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -70,13 +70,13 @@ uint32_t BrickByBrickFix::TruncateBrokenBrickByBrickXml() {
|
||||
"</LXFML>",
|
||||
completeUncompressedModel.length() >= 15 ? completeUncompressedModel.length() - 15 : 0) == std::string::npos
|
||||
) {
|
||||
LOG("Brick-by-brick model %llu will be deleted!", model.id);
|
||||
Log::Info("Brick-by-brick model {} will be deleted!", model.id);
|
||||
Database::Get()->DeleteUgcModelData(model.id);
|
||||
modelsTruncated++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LOG("Brick-by-brick model %llu will be deleted!", model.id);
|
||||
Log::Info("Brick-by-brick model {} will be deleted!", model.id);
|
||||
Database::Get()->DeleteUgcModelData(model.id);
|
||||
modelsTruncated++;
|
||||
}
|
||||
@@ -121,11 +121,11 @@ uint32_t BrickByBrickFix::UpdateBrickByBrickModelsToSd0() {
|
||||
|
||||
try {
|
||||
Database::Get()->UpdateUgcModelData(model.id, outputStringStream);
|
||||
LOG("Updated model %i to sd0", model.id);
|
||||
Log::Info("Updated model {} to sd0", model.id);
|
||||
updatedModels++;
|
||||
} catch (sql::SQLException exception) {
|
||||
LOG("Failed to update model %i. This model should be inspected manually to see why."
|
||||
"The database error is %s", model.id, exception.what());
|
||||
Log::Warn("Failed to update model {}. This model should be inspected manually to see why."
|
||||
"The database error is {}", model.id, exception.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,5 +70,6 @@ else ()
|
||||
endif ()
|
||||
|
||||
target_link_libraries(dCommon
|
||||
PUBLIC fmt
|
||||
PRIVATE ZLIB::ZLIB bcrypt tinyxml2
|
||||
INTERFACE dDatabase)
|
||||
|
||||
@@ -28,7 +28,7 @@ void make_minidump(EXCEPTION_POINTERS* e) {
|
||||
"_%4d%02d%02d_%02d%02d%02d.dmp",
|
||||
t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond);
|
||||
}
|
||||
LOG("Creating crash dump %s", name);
|
||||
Log::Info("Creating crash dump {:s}", name);
|
||||
auto hFile = CreateFileA(name, GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
return;
|
||||
@@ -83,7 +83,7 @@ struct bt_ctx {
|
||||
|
||||
static inline void Bt(struct backtrace_state* state) {
|
||||
std::string fileName = Diagnostics::GetOutDirectory() + "crash_" + Diagnostics::GetProcessName() + "_" + std::to_string(getpid()) + ".log";
|
||||
LOG("backtrace is enabled, crash dump located at %s", fileName.c_str());
|
||||
Log::Info("backtrace is enabled, crash dump located at {:s}", fileName);
|
||||
FILE* file = fopen(fileName.c_str(), "w+");
|
||||
if (file != nullptr) {
|
||||
backtrace_print(state, 2, file);
|
||||
@@ -95,13 +95,13 @@ static inline void Bt(struct backtrace_state* state) {
|
||||
|
||||
static void ErrorCallback(void* data, const char* msg, int errnum) {
|
||||
auto* ctx = (struct bt_ctx*)data;
|
||||
fprintf(stderr, "ERROR: %s (%d)", msg, errnum);
|
||||
fmt::print(stderr, "ERROR: {:s} ({:d})", msg, errnum);
|
||||
ctx->error = 1;
|
||||
|
||||
std::string fileName = Diagnostics::GetOutDirectory() + "crash_" + Diagnostics::GetProcessName() + "_" + std::to_string(getpid()) + ".log";
|
||||
FILE* file = fopen(fileName.c_str(), "w+");
|
||||
if (file != nullptr) {
|
||||
fprintf(file, "ERROR: %s (%d)", msg, errnum);
|
||||
fmt::print(file, "ERROR: {:s} ({:d})", msg, errnum);
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
@@ -119,13 +119,13 @@ void CatchUnhandled(int sig) {
|
||||
try {
|
||||
if (eptr) std::rethrow_exception(eptr);
|
||||
} catch(const std::exception& e) {
|
||||
LOG("Caught exception: '%s'", e.what());
|
||||
Log::Warn("Caught exception: '{:s}'", e.what());
|
||||
}
|
||||
|
||||
#ifndef INCLUDE_BACKTRACE
|
||||
|
||||
std::string fileName = Diagnostics::GetOutDirectory() + "crash_" + Diagnostics::GetProcessName() + "_" + std::to_string(getpid()) + ".log";
|
||||
LOG("Encountered signal %i, creating crash dump %s", sig, fileName.c_str());
|
||||
Log::Warn("Encountered signal {:d}, creating crash dump {:s}", sig, fileName);
|
||||
if (Diagnostics::GetProduceMemoryDump()) {
|
||||
GenerateDump();
|
||||
}
|
||||
@@ -143,7 +143,7 @@ void CatchUnhandled(int sig) {
|
||||
|
||||
FILE* file = fopen(fileName.c_str(), "w+");
|
||||
if (file != NULL) {
|
||||
fprintf(file, "Error: signal %d:\n", sig);
|
||||
fmt::println(file, "Error: signal {:d}:", sig);
|
||||
}
|
||||
// Print the stack trace
|
||||
for (size_t i = 0; i < size; i++) {
|
||||
@@ -165,9 +165,9 @@ void CatchUnhandled(int sig) {
|
||||
}
|
||||
}
|
||||
|
||||
LOG("[%02zu] %s", i, functionName.c_str());
|
||||
Log::Info("[{:02d}] {:s}", i, functionName);
|
||||
if (file != NULL) {
|
||||
fprintf(file, "[%02zu] %s\n", i, functionName.c_str());
|
||||
fmt::println(file, "[{:02d}] {:s}", i, functionName);
|
||||
}
|
||||
}
|
||||
# else // defined(__GNUG__)
|
||||
@@ -208,7 +208,7 @@ void MakeBacktrace() {
|
||||
sigaction(SIGFPE, &sigact, nullptr) != 0 ||
|
||||
sigaction(SIGABRT, &sigact, nullptr) != 0 ||
|
||||
sigaction(SIGILL, &sigact, nullptr) != 0) {
|
||||
fprintf(stderr, "error setting signal handler for %d (%s)\n",
|
||||
fmt::println(stderr, "error setting signal handler for {:d} ({:s})",
|
||||
SIGSEGV,
|
||||
strsignal(SIGSEGV));
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ bool FdbToSqlite::Convert::ConvertDatabase(AssetStream& buffer) {
|
||||
|
||||
CDClientDatabase::ExecuteQuery("COMMIT;");
|
||||
} catch (CppSQLite3Exception& e) {
|
||||
LOG("Encountered error %s converting FDB to SQLite", e.errorMessage());
|
||||
Log::Warn("Encountered error {:s} converting FDB to SQLite", e.errorMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ LDFBaseData* LDFBaseData::DataFromString(const std::string_view& format) {
|
||||
try {
|
||||
type = static_cast<eLDFType>(strtol(ldfTypeAndValue.first.data(), &storage, 10));
|
||||
} catch (std::exception) {
|
||||
LOG("Attempted to process invalid ldf type (%s) from string (%s)", ldfTypeAndValue.first.data(), format.data());
|
||||
Log::Warn("Attempted to process invalid ldf type ({:s}) from string ({:s})", ldfTypeAndValue.first, format);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ LDFBaseData* LDFBaseData::DataFromString(const std::string_view& format) {
|
||||
case LDF_TYPE_S32: {
|
||||
const auto data = GeneralUtils::TryParse<int32_t>(ldfTypeAndValue.second);
|
||||
if (!data) {
|
||||
LOG("Warning: Attempted to process invalid int32 value (%s) from string (%s)", ldfTypeAndValue.second.data(), format.data());
|
||||
Log::Warn("Attempted to process invalid int32 value ({:s}) from string ({:s})", ldfTypeAndValue.second, format);
|
||||
return nullptr;
|
||||
}
|
||||
returnValue = new LDFData<int32_t>(key, data.value());
|
||||
@@ -74,7 +74,7 @@ LDFBaseData* LDFBaseData::DataFromString(const std::string_view& format) {
|
||||
case LDF_TYPE_FLOAT: {
|
||||
const auto data = GeneralUtils::TryParse<float>(ldfTypeAndValue.second);
|
||||
if (!data) {
|
||||
LOG("Warning: Attempted to process invalid float value (%s) from string (%s)", ldfTypeAndValue.second.data(), format.data());
|
||||
Log::Warn("Attempted to process invalid float value ({:s}) from string ({:s})", ldfTypeAndValue.second, format);
|
||||
return nullptr;
|
||||
}
|
||||
returnValue = new LDFData<float>(key, data.value());
|
||||
@@ -84,7 +84,7 @@ LDFBaseData* LDFBaseData::DataFromString(const std::string_view& format) {
|
||||
case LDF_TYPE_DOUBLE: {
|
||||
const auto data = GeneralUtils::TryParse<double>(ldfTypeAndValue.second);
|
||||
if (!data) {
|
||||
LOG("Warning: Attempted to process invalid double value (%s) from string (%s)", ldfTypeAndValue.second.data(), format.data());
|
||||
Log::Warn("Attempted to process invalid double value ({:s}) from string ({:s})", ldfTypeAndValue.second, format);
|
||||
return nullptr;
|
||||
}
|
||||
returnValue = new LDFData<double>(key, data.value());
|
||||
@@ -102,7 +102,7 @@ LDFBaseData* LDFBaseData::DataFromString(const std::string_view& format) {
|
||||
} else {
|
||||
const auto dataOptional = GeneralUtils::TryParse<uint32_t>(ldfTypeAndValue.second);
|
||||
if (!dataOptional) {
|
||||
LOG("Warning: Attempted to process invalid uint32 value (%s) from string (%s)", ldfTypeAndValue.second.data(), format.data());
|
||||
Log::Warn("Attempted to process invalid uint32 value ({:s}) from string ({:s})", ldfTypeAndValue.second, format);
|
||||
return nullptr;
|
||||
}
|
||||
data = dataOptional.value();
|
||||
@@ -122,7 +122,7 @@ LDFBaseData* LDFBaseData::DataFromString(const std::string_view& format) {
|
||||
} else {
|
||||
const auto dataOptional = GeneralUtils::TryParse<bool>(ldfTypeAndValue.second);
|
||||
if (!dataOptional) {
|
||||
LOG("Warning: Attempted to process invalid bool value (%s) from string (%s)", ldfTypeAndValue.second.data(), format.data());
|
||||
Log::Warn("Attempted to process invalid bool value ({:s}) from string ({:s})", ldfTypeAndValue.second, format);
|
||||
return nullptr;
|
||||
}
|
||||
data = dataOptional.value();
|
||||
@@ -135,7 +135,7 @@ LDFBaseData* LDFBaseData::DataFromString(const std::string_view& format) {
|
||||
case LDF_TYPE_U64: {
|
||||
const auto data = GeneralUtils::TryParse<uint64_t>(ldfTypeAndValue.second);
|
||||
if (!data) {
|
||||
LOG("Warning: Attempted to process invalid uint64 value (%s) from string (%s)", ldfTypeAndValue.second.data(), format.data());
|
||||
Log::Warn("Attempted to process invalid uint64 value ({:s}) from string ({:s})", ldfTypeAndValue.second, format);
|
||||
return nullptr;
|
||||
}
|
||||
returnValue = new LDFData<uint64_t>(key, data.value());
|
||||
@@ -145,7 +145,7 @@ LDFBaseData* LDFBaseData::DataFromString(const std::string_view& format) {
|
||||
case LDF_TYPE_OBJID: {
|
||||
const auto data = GeneralUtils::TryParse<LWOOBJID>(ldfTypeAndValue.second);
|
||||
if (!data) {
|
||||
LOG("Warning: Attempted to process invalid LWOOBJID value (%s) from string (%s)", ldfTypeAndValue.second.data(), format.data());
|
||||
Log::Warn("Attempted to process invalid LWOOBJID value ({:s}) from string ({:s})", ldfTypeAndValue.second, format);
|
||||
return nullptr;
|
||||
}
|
||||
returnValue = new LDFData<LWOOBJID>(key, data.value());
|
||||
@@ -159,12 +159,12 @@ LDFBaseData* LDFBaseData::DataFromString(const std::string_view& format) {
|
||||
}
|
||||
|
||||
case LDF_TYPE_UNKNOWN: {
|
||||
LOG("Warning: Attempted to process invalid unknown value (%s) from string (%s)", ldfTypeAndValue.second.data(), format.data());
|
||||
Log::Warn("Attempted to process invalid unknown value ({:s}) from string ({:s})", ldfTypeAndValue.second, format);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
LOG("Warning: Attempted to process invalid LDF type (%d) from string (%s)", type, format.data());
|
||||
Log::Warn("Attempted to process invalid LDF type ({:d}) from string ({:s})", GeneralUtils::ToUnderlying(type), format);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void Writer::Flush() {
|
||||
|
||||
FileWriter::FileWriter(const char* outpath) {
|
||||
m_Outfile = fopen(outpath, "wt");
|
||||
if (!m_Outfile) printf("Couldn't open %s for writing!\n", outpath);
|
||||
if (!m_Outfile) fmt::println("Couldn't open {:s} for writing!", outpath);
|
||||
m_Outpath = outpath;
|
||||
m_IsConsoleWriter = false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
// fmt includes:
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/chrono.h>
|
||||
|
||||
// C++ includes:
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
#include <source_location>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -15,22 +23,88 @@
|
||||
// Calculate the filename at compile time from the path.
|
||||
// We just do this by scanning the path for the last '/' or '\' character and returning the string after it.
|
||||
constexpr const char* GetFileNameFromAbsolutePath(const char* path) {
|
||||
const char* file = path;
|
||||
while (*path) {
|
||||
char nextChar = *path++;
|
||||
if (nextChar == '/' || nextChar == '\\') {
|
||||
file = path;
|
||||
}
|
||||
}
|
||||
return file;
|
||||
const char* file = path;
|
||||
while (*path) {
|
||||
const char nextChar = *path++;
|
||||
if (nextChar == '/' || nextChar == '\\') {
|
||||
file = path;
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Location wrapper class
|
||||
* Used to implicitly forward source location information without adding a function parameter
|
||||
*/
|
||||
template <typename T>
|
||||
class location_wrapper {
|
||||
public:
|
||||
// Constructor
|
||||
template <typename U = T>
|
||||
consteval location_wrapper(const U& val, const std::source_location& loc = std::source_location::current())
|
||||
: m_File(GetFileNameFromAbsolutePath(loc.file_name()))
|
||||
, m_Loc(loc)
|
||||
, m_Obj(val) {
|
||||
}
|
||||
|
||||
// Methods
|
||||
[[nodiscard]] constexpr const char* file() const noexcept { return m_File; }
|
||||
|
||||
[[nodiscard]] constexpr const std::source_location& loc() const noexcept { return m_Loc; }
|
||||
|
||||
[[nodiscard]] constexpr const T& get() const noexcept { return m_Obj; }
|
||||
|
||||
protected:
|
||||
const char* m_File{};
|
||||
std::source_location m_Loc{};
|
||||
T m_Obj{};
|
||||
};
|
||||
|
||||
/**
|
||||
* Logging functions (EXPERIMENTAL)
|
||||
*/
|
||||
namespace Log {
|
||||
template <typename... Ts>
|
||||
[[nodiscard]] inline tm Time() { // TODO: Move?
|
||||
return fmt::localtime(std::time(nullptr));
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
using FormatString = location_wrapper<fmt::format_string<Ts...>>;
|
||||
|
||||
template <typename... Ts>
|
||||
inline void Info(const FormatString<Ts...> fmt_str, Ts&&... args) {
|
||||
fmt::print("[{:%d-%m-%y %H:%M:%S} {}:{}] ", Time(), fmt_str.file(), fmt_str.loc().line());
|
||||
fmt::println(fmt_str.get(), std::forward<Ts>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
inline void Warn(const FormatString<Ts...> fmt_str, Ts&&... args) {
|
||||
fmt::print("[{:%d-%m-%y %H:%M:%S} {}:{}] Warning: ", Time(), fmt_str.file(), fmt_str.loc().line());
|
||||
fmt::println(fmt_str.get(), std::forward<Ts>(args)...);
|
||||
}
|
||||
|
||||
template <typename... Ts>
|
||||
inline void Debug(const FormatString<Ts...> fmt_str, Ts&&... args) {
|
||||
// if (!m_logDebugStatements) return;
|
||||
Log::Info(fmt_str, std::forward<Ts>(args)...);
|
||||
}
|
||||
}
|
||||
|
||||
// These have to have a constexpr variable to store the filename_and_line result in a local variable otherwise
|
||||
// they will not be valid constexpr and will be evaluated at runtime instead of compile time!
|
||||
// The full string is still stored in the binary, however the offset of the filename in the absolute paths
|
||||
// is used in the instruction instead of the start of the absolute path.
|
||||
#define LOG(message, ...) do { auto str = FILENAME_AND_LINE; Game::logger->Log(str, message, ##__VA_ARGS__); } while(0)
|
||||
#define LOG_DEBUG(message, ...) do { auto str = FILENAME_AND_LINE; Game::logger->LogDebug(str, message, ##__VA_ARGS__); } while(0)
|
||||
//#define LOG(message, ...) do { auto str = FILENAME_AND_LINE; Game::logger->Log(str, message, ##__VA_ARGS__); } while(0)
|
||||
//#define LOG(message, ...) do {\
|
||||
const auto now = std::chrono::time_point_cast<std::chrono::seconds>(std::chrono::system_clock::now());\
|
||||
fmt::println("[{:%d-%m-%y %H:%M:%S} {:s}] " message, now, FILENAME_AND_LINE, ##__VA_ARGS__);\
|
||||
} while(0)
|
||||
#define LOG(message, ...) Log::Info(message __VA_OPT__(,) __VA_ARGS__)
|
||||
|
||||
//#define LOG_DEBUG(message, ...) do { auto str = FILENAME_AND_LINE; Game::logger->LogDebug(str, message, ##__VA_ARGS__); } while(0)
|
||||
#define LOG_DEBUG(message, ...) Log::Debug(message __VA_OPT__(,) __VA_ARGS__)
|
||||
|
||||
// Writer class for writing data to files.
|
||||
class Writer {
|
||||
|
||||
@@ -23,7 +23,7 @@ PackIndex::PackIndex(const std::filesystem::path& filePath) {
|
||||
m_PackFileIndices.push_back(packFileIndex);
|
||||
}
|
||||
|
||||
LOG("Loaded pack catalog with %i pack files and %i files", m_PackPaths.size(), m_PackFileIndices.size());
|
||||
Log::Info("Loaded pack catalog with {:d} pack files and {:d} files", m_PackPaths.size(), m_PackFileIndices.size());
|
||||
|
||||
for (auto& item : m_PackPaths) {
|
||||
std::replace(item.begin(), item.end(), '\\', '/');
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
|
||||
namespace StringifiedEnum {
|
||||
template<typename T>
|
||||
const std::string_view ToString(const T e) {
|
||||
constexpr std::string_view ToString(const T e) {
|
||||
static_assert(std::is_enum_v<T>, "Not an enum"); // Check type
|
||||
|
||||
constexpr auto& sv = magic_enum::enum_entries<T>();
|
||||
constexpr const auto& sv = magic_enum::enum_entries<T>();
|
||||
|
||||
const auto it = std::lower_bound(
|
||||
sv.begin(), sv.end(), e,
|
||||
|
||||
@@ -157,7 +157,7 @@ void CDClientManager::LoadValuesFromDatabase() {
|
||||
}
|
||||
|
||||
void CDClientManager::LoadValuesFromDefaults() {
|
||||
LOG("Loading default CDClient tables!");
|
||||
Log::Info("Loading default CDClient tables!");
|
||||
|
||||
CDPetComponentTable::Instance().LoadValuesFromDefaults();
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ CDPetComponent& CDPetComponentTable::GetByID(const uint32_t componentID) {
|
||||
auto& entries = GetEntriesMutable();
|
||||
auto itr = entries.find(componentID);
|
||||
if (itr == entries.end()) {
|
||||
LOG("Unable to load pet component (ID %i) values from database! Using default values instead.", componentID);
|
||||
Log::Warn("Unable to load pet component (ID {:d}) values from database! Using default values instead.", componentID);
|
||||
return defaultEntry;
|
||||
}
|
||||
return itr->second;
|
||||
|
||||
@@ -15,7 +15,7 @@ target_include_directories(dDatabaseCDClient PUBLIC "."
|
||||
"${PROJECT_SOURCE_DIR}/dCommon"
|
||||
"${PROJECT_SOURCE_DIR}/dCommon/dEnums"
|
||||
)
|
||||
target_link_libraries(dDatabaseCDClient PRIVATE sqlite3)
|
||||
target_link_libraries(dDatabaseCDClient PRIVATE fmt sqlite3)
|
||||
|
||||
if (${CDCLIENT_CACHE_ALL})
|
||||
add_compile_definitions(dDatabaseCDClient PRIVATE CDCLIENT_CACHE_ALL=${CDCLIENT_CACHE_ALL})
|
||||
|
||||
@@ -4,4 +4,5 @@ add_subdirectory(GameDatabase)
|
||||
add_library(dDatabase STATIC "MigrationRunner.cpp")
|
||||
target_include_directories(dDatabase PUBLIC ".")
|
||||
target_link_libraries(dDatabase
|
||||
PUBLIC dDatabaseCDClient dDatabaseGame)
|
||||
PUBLIC dDatabaseCDClient dDatabaseGame
|
||||
PRIVATE fmt)
|
||||
|
||||
@@ -16,6 +16,7 @@ target_include_directories(dDatabaseGame PUBLIC "."
|
||||
)
|
||||
target_link_libraries(dDatabaseGame
|
||||
PUBLIC MariaDB::ConnCpp
|
||||
PRIVATE fmt
|
||||
INTERFACE dCommon)
|
||||
|
||||
# Glob together all headers that need to be precompiled
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace {
|
||||
|
||||
void Database::Connect() {
|
||||
if (database) {
|
||||
LOG("Tried to connect to database when it's already connected!");
|
||||
Log::Warn("Tried to connect to database when it's already connected!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ void Database::Connect() {
|
||||
|
||||
GameDatabase* Database::Get() {
|
||||
if (!database) {
|
||||
LOG("Tried to get database when it's not connected!");
|
||||
Log::Warn("Tried to get database when it's not connected!");
|
||||
Connect();
|
||||
}
|
||||
return database;
|
||||
@@ -35,6 +35,6 @@ void Database::Destroy(std::string source) {
|
||||
delete database;
|
||||
database = nullptr;
|
||||
} else {
|
||||
LOG("Trying to destroy database when it's not connected!");
|
||||
Log::Warn("Trying to destroy database when it's not connected!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace sql {
|
||||
};
|
||||
|
||||
#ifdef _DEBUG
|
||||
# define DLU_SQL_TRY_CATCH_RETHROW(x) do { try { x; } catch (sql::SQLException& ex) { LOG("SQL Error: %s", ex.what()); throw; } } while(0)
|
||||
# define DLU_SQL_TRY_CATCH_RETHROW(x) do { try { x; } catch (sql::SQLException& ex) { Log::Warn("SQL Error: {:s}", ex.what()); throw; } } while(0)
|
||||
#else
|
||||
# define DLU_SQL_TRY_CATCH_RETHROW(x) x
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -53,8 +53,8 @@ void MySQLDatabase::Connect() {
|
||||
void MySQLDatabase::Destroy(std::string source) {
|
||||
if (!con) return;
|
||||
|
||||
if (source.empty()) LOG("Destroying MySQL connection!");
|
||||
else LOG("Destroying MySQL connection from %s!", source.c_str());
|
||||
if (source.empty()) Log::Info("Destroying MySQL connection!");
|
||||
else Log::Info("Destroying MySQL connection from {:s}!", source);
|
||||
|
||||
con->close();
|
||||
delete con;
|
||||
@@ -68,7 +68,7 @@ void MySQLDatabase::ExecuteCustomQuery(const std::string_view query) {
|
||||
sql::PreparedStatement* MySQLDatabase::CreatePreppedStmt(const std::string& query) {
|
||||
if (!con) {
|
||||
Connect();
|
||||
LOG("Trying to reconnect to MySQL");
|
||||
Log::Info("Trying to reconnect to MySQL");
|
||||
}
|
||||
|
||||
if (!con->isValid() || con->isClosed()) {
|
||||
@@ -77,7 +77,7 @@ sql::PreparedStatement* MySQLDatabase::CreatePreppedStmt(const std::string& quer
|
||||
con = nullptr;
|
||||
|
||||
Connect();
|
||||
LOG("Trying to reconnect to MySQL from invalid or closed connection");
|
||||
Log::Info("Trying to reconnect to MySQL from invalid or closed connection");
|
||||
}
|
||||
|
||||
return con->prepareStatement(sql::SQLString(query.c_str(), query.length()));
|
||||
|
||||
@@ -147,91 +147,91 @@ private:
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::string_view param) {
|
||||
// LOG("%s", param.data());
|
||||
// Log::Info("{}", param);
|
||||
stmt->setString(index, param.data());
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const char* param) {
|
||||
// LOG("%s", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setString(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::string param) {
|
||||
// LOG("%s", param.c_str());
|
||||
stmt->setString(index, param.c_str());
|
||||
// Log::Info("{}", param);
|
||||
stmt->setString(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int8_t param) {
|
||||
// LOG("%u", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setByte(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint8_t param) {
|
||||
// LOG("%d", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setByte(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int16_t param) {
|
||||
// LOG("%u", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setShort(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint16_t param) {
|
||||
// LOG("%d", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setShort(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint32_t param) {
|
||||
// LOG("%u", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setUInt(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int32_t param) {
|
||||
// LOG("%d", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setInt(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const int64_t param) {
|
||||
// LOG("%llu", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setInt64(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const uint64_t param) {
|
||||
// LOG("%llu", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setUInt64(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const float param) {
|
||||
// LOG("%f", param);
|
||||
// Log::Info({}", param);
|
||||
stmt->setFloat(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const double param) {
|
||||
// LOG("%f", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setDouble(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const bool param) {
|
||||
// LOG("%d", param);
|
||||
// Log::Info("{}", param);
|
||||
stmt->setBoolean(index, param);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::istream* param) {
|
||||
// LOG("Blob");
|
||||
// Log::Info("Blob");
|
||||
// This is the one time you will ever see me use const_cast.
|
||||
stmt->setBlob(index, const_cast<std::istream*>(param));
|
||||
}
|
||||
@@ -239,10 +239,10 @@ inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::istr
|
||||
template<>
|
||||
inline void SetParam(UniquePreppedStmtRef stmt, const int index, const std::optional<uint32_t> param) {
|
||||
if (param) {
|
||||
// LOG("%d", param.value());
|
||||
// Log::Info("{}", param.value());
|
||||
stmt->setInt(index, param.value());
|
||||
} else {
|
||||
// LOG("Null");
|
||||
// Log::Info("Null");
|
||||
stmt->setNull(index, sql::DataType::SQLNULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ void MySQLDatabase::InsertNewPropertyModel(const LWOOBJID& propertyId, const IPr
|
||||
0, // behavior 4. TODO implement this.
|
||||
0 // behavior 5. TODO implement this.
|
||||
);
|
||||
} catch (sql::SQLException& e) {
|
||||
LOG("Error inserting new property model: %s", e.what());
|
||||
} catch (const sql::SQLException& e) {
|
||||
Log::Warn("Error inserting new property model: {:s}", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ void MigrationRunner::RunMigrations() {
|
||||
|
||||
if (Database::Get()->IsMigrationRun(migration.name)) continue;
|
||||
|
||||
LOG("Running migration: %s", migration.name.c_str());
|
||||
Log::Info("Running migration: {:s}", migration.name);
|
||||
if (migration.name == "dlu/5_brick_model_sd0.sql") {
|
||||
runSd0Migrations = true;
|
||||
} else {
|
||||
@@ -56,7 +56,7 @@ void MigrationRunner::RunMigrations() {
|
||||
}
|
||||
|
||||
if (finalSQL.empty() && !runSd0Migrations) {
|
||||
LOG("Server database is up to date.");
|
||||
Log::Info("Server database is up to date.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ void MigrationRunner::RunMigrations() {
|
||||
if (query.empty()) continue;
|
||||
Database::Get()->ExecuteCustomQuery(query.c_str());
|
||||
} catch (sql::SQLException& e) {
|
||||
LOG("Encountered error running migration: %s", e.what());
|
||||
Log::Info("Encountered error running migration: {:s}", e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,9 +75,9 @@ void MigrationRunner::RunMigrations() {
|
||||
// Do this last on the off chance none of the other migrations have been run yet.
|
||||
if (runSd0Migrations) {
|
||||
uint32_t numberOfUpdatedModels = BrickByBrickFix::UpdateBrickByBrickModelsToSd0();
|
||||
LOG("%i models were updated from zlib to sd0.", numberOfUpdatedModels);
|
||||
Log::Info("{:d} models were updated from zlib to sd0.", numberOfUpdatedModels);
|
||||
uint32_t numberOfTruncatedModels = BrickByBrickFix::TruncateBrokenBrickByBrickXml();
|
||||
LOG("%i models were truncated from the database.", numberOfTruncatedModels);
|
||||
Log::Info("{:d} models were truncated from the database.", numberOfTruncatedModels);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,14 +111,14 @@ void MigrationRunner::RunSQLiteMigrations() {
|
||||
|
||||
// Doing these 1 migration at a time since one takes a long time and some may think it is crashing.
|
||||
// This will at the least guarentee that the full migration needs to be run in order to be counted as "migrated".
|
||||
LOG("Executing migration: %s. This may take a while. Do not shut down server.", migration.name.c_str());
|
||||
Log::Info("Executing migration: {:s}. This may take a while. Do not shut down server.", migration.name);
|
||||
CDClientDatabase::ExecuteQuery("BEGIN TRANSACTION;");
|
||||
for (const auto& dml : GeneralUtils::SplitString(migration.data, ';')) {
|
||||
if (dml.empty()) continue;
|
||||
try {
|
||||
CDClientDatabase::ExecuteDML(dml.c_str());
|
||||
} catch (CppSQLite3Exception& e) {
|
||||
LOG("Encountered error running DML command: (%i) : %s", e.errorCode(), e.errorMessage());
|
||||
Log::Warn("Encountered error running DML command: ({:d}) : {:s}", e.errorCode(), e.errorMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,5 +129,5 @@ void MigrationRunner::RunSQLiteMigrations() {
|
||||
CDClientDatabase::ExecuteQuery("COMMIT;");
|
||||
}
|
||||
|
||||
LOG("CDServer database is up to date.");
|
||||
Log::Info("CDServer database is up to date.");
|
||||
}
|
||||
|
||||
@@ -82,16 +82,16 @@ void Character::DoQuickXMLDataParse() {
|
||||
if (!m_Doc) return;
|
||||
|
||||
if (m_Doc->Parse(m_XMLData.c_str(), m_XMLData.size()) == 0) {
|
||||
LOG("Loaded xmlData for character %s (%i)!", m_Name.c_str(), m_ID);
|
||||
Log::Info("Loaded xmlData for character {:s} ({:d})!", m_Name, m_ID);
|
||||
} else {
|
||||
LOG("Failed to load xmlData!");
|
||||
Log::Warn("Failed to load xmlData!");
|
||||
//Server::rakServer->CloseConnection(m_ParentUser->GetSystemAddress(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
tinyxml2::XMLElement* mf = m_Doc->FirstChildElement("obj")->FirstChildElement("mf");
|
||||
if (!mf) {
|
||||
LOG("Failed to find mf tag!");
|
||||
Log::Warn("Failed to find mf tag!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -110,14 +110,14 @@ void Character::DoQuickXMLDataParse() {
|
||||
|
||||
tinyxml2::XMLElement* inv = m_Doc->FirstChildElement("obj")->FirstChildElement("inv");
|
||||
if (!inv) {
|
||||
LOG("Char has no inv!");
|
||||
Log::Warn("Char has no inv!");
|
||||
return;
|
||||
}
|
||||
|
||||
tinyxml2::XMLElement* bag = inv->FirstChildElement("items")->FirstChildElement("in");
|
||||
|
||||
if (!bag) {
|
||||
LOG("Couldn't find bag0!");
|
||||
Log::Warn("Couldn't find bag0!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ void Character::SaveXMLToDatabase() {
|
||||
|
||||
//Call upon the entity to update our xmlDoc:
|
||||
if (!m_OurEntity) {
|
||||
LOG("%i:%s didn't have an entity set while saving! CHARACTER WILL NOT BE SAVED!", this->GetID(), this->GetName().c_str());
|
||||
Log::Warn("{:d}:{:s} didn't have an entity set while saving! CHARACTER WILL NOT BE SAVED!", this->GetID(), this->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -321,7 +321,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;
|
||||
LOG("%i:%s Saved character to Database in: %fs", this->GetID(), this->GetName().c_str(), elapsed.count());
|
||||
Log::Info("{:d}:{:s} Saved character to Database in: {:f}s", this->GetID(), this->GetName(), elapsed.count());
|
||||
}
|
||||
|
||||
void Character::SetIsNewLogin() {
|
||||
@@ -334,7 +334,7 @@ void Character::SetIsNewLogin() {
|
||||
auto* nextChild = currentChild->NextSiblingElement();
|
||||
if (currentChild->Attribute("si")) {
|
||||
flags->DeleteChild(currentChild);
|
||||
LOG("Removed isLoggedIn flag from character %i:%s, saving character to database", GetID(), GetName().c_str());
|
||||
Log::Info("Removed isLoggedIn flag from character {:d}:{:s}, saving character to database", GetID(), GetName());
|
||||
WriteToDatabase();
|
||||
}
|
||||
currentChild = nextChild;
|
||||
|
||||
@@ -138,11 +138,11 @@ Entity::Entity(const LWOOBJID& objectID, EntityInfo info, User* parentUser, Enti
|
||||
|
||||
Entity::~Entity() {
|
||||
if (IsPlayer()) {
|
||||
LOG("Deleted player");
|
||||
Log::Info("Deleted player");
|
||||
|
||||
// Make sure the player exists first. Remove afterwards to prevent the OnPlayerExist functions from not being able to find the player.
|
||||
if (!PlayerManager::RemovePlayer(this)) {
|
||||
LOG("Unable to find player to remove from manager.");
|
||||
Log::Warn("Unable to find player to remove from manager.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ void EntityManager::KillEntities() {
|
||||
auto* entity = GetEntity(toKill);
|
||||
|
||||
if (!entity) {
|
||||
LOG("Attempting to kill null entity %llu", toKill);
|
||||
Log::Warn("Attempting to kill null entity {}", toKill);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ void EntityManager::DeleteEntities() {
|
||||
|
||||
if (ghostingToDelete != m_EntitiesToGhost.end()) m_EntitiesToGhost.erase(ghostingToDelete);
|
||||
} else {
|
||||
LOG("Attempted to delete non-existent entity %llu", toDelete);
|
||||
Log::Warn("Attempted to delete non-existent entity {}", toDelete);
|
||||
}
|
||||
m_Entities.erase(toDelete);
|
||||
}
|
||||
@@ -322,7 +322,7 @@ const std::unordered_map<std::string, LWOOBJID>& EntityManager::GetSpawnPointEnt
|
||||
|
||||
void EntityManager::ConstructEntity(Entity* entity, const SystemAddress& sysAddr, const bool skipChecks) {
|
||||
if (!entity) {
|
||||
LOG("Attempted to construct null entity");
|
||||
Log::Warn("Attempted to construct null entity");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ void Leaderboard::SetupLeaderboard(bool weekly, uint32_t resultStart, uint32_t r
|
||||
baseLookup += std::to_string(static_cast<uint32_t>(this->relatedPlayer));
|
||||
}
|
||||
baseLookup += " LIMIT 1";
|
||||
LOG_DEBUG("query is %s", baseLookup.c_str());
|
||||
Log::Debug("query is {:s}", baseLookup);
|
||||
std::unique_ptr<sql::PreparedStatement> baseQuery(Database::Get()->CreatePreppedStmt(baseLookup));
|
||||
baseQuery->setInt(1, this->gameID);
|
||||
std::unique_ptr<sql::ResultSet> baseResult(baseQuery->executeQuery());
|
||||
@@ -251,7 +251,7 @@ void Leaderboard::SetupLeaderboard(bool weekly, uint32_t resultStart, uint32_t r
|
||||
int32_t res = snprintf(lookupBuffer.get(), STRING_LENGTH, queryBase.c_str(), orderBase.data(), filter.c_str(), resultStart, resultEnd);
|
||||
DluAssert(res != -1);
|
||||
std::unique_ptr<sql::PreparedStatement> query(Database::Get()->CreatePreppedStmt(lookupBuffer.get()));
|
||||
LOG_DEBUG("Query is %s vars are %i %i %i", lookupBuffer.get(), this->gameID, this->relatedPlayer, relatedPlayerLeaderboardId);
|
||||
Log::Debug("Query is {:s} vars are {:d} {:d} {:d}", lookupBuffer.get(), this->gameID, this->relatedPlayer, relatedPlayerLeaderboardId);
|
||||
query->setInt(1, this->gameID);
|
||||
if (this->infoType == InfoType::Friends) {
|
||||
query->setInt(2, this->relatedPlayer);
|
||||
@@ -358,7 +358,7 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activi
|
||||
}
|
||||
case Leaderboard::Type::None:
|
||||
default:
|
||||
LOG("Unknown leaderboard type %i for game %i. Cannot save score!", leaderboardType, activityId);
|
||||
Log::Warn("Unknown leaderboard type {:d} for game {:d}. Cannot save score!", GeneralUtils::ToUnderlying(leaderboardType), activityId);
|
||||
return;
|
||||
}
|
||||
bool newHighScore = lowerScoreBetter ? newScore < oldScore : newScore > oldScore;
|
||||
@@ -377,7 +377,7 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activi
|
||||
} else {
|
||||
saveQuery = FormatInsert(leaderboardType, newScore, false);
|
||||
}
|
||||
LOG("save query %s %i %i", saveQuery.c_str(), playerID, activityId);
|
||||
Log::Info("save query {:s} {:d} {:d}", saveQuery, playerID, activityId);
|
||||
std::unique_ptr<sql::PreparedStatement> saveStatement(Database::Get()->CreatePreppedStmt(saveQuery));
|
||||
saveStatement->setInt(1, playerID);
|
||||
saveStatement->setInt(2, activityId);
|
||||
|
||||
@@ -67,7 +67,7 @@ void Trade::SetAccepted(LWOOBJID participant, bool value) {
|
||||
if (participant == m_ParticipantA) {
|
||||
m_AcceptedA = !value;
|
||||
|
||||
LOG("Accepted from A (%d), B: (%d)", value, m_AcceptedB);
|
||||
Log::Info("Accepted from A ({}), B: ({})", value, m_AcceptedB);
|
||||
|
||||
auto* entityB = GetParticipantBEntity();
|
||||
|
||||
@@ -77,7 +77,7 @@ void Trade::SetAccepted(LWOOBJID participant, bool value) {
|
||||
} else if (participant == m_ParticipantB) {
|
||||
m_AcceptedB = !value;
|
||||
|
||||
LOG("Accepted from B (%d), A: (%d)", value, m_AcceptedA);
|
||||
Log::Info("Accepted from B ({}), A: ({})", value, m_AcceptedA);
|
||||
|
||||
auto* entityA = GetParticipantAEntity();
|
||||
|
||||
@@ -125,7 +125,7 @@ void Trade::Complete() {
|
||||
|
||||
// First verify both players have the coins and items requested for the trade.
|
||||
if (characterA->GetCoins() < m_CoinsA || characterB->GetCoins() < m_CoinsB) {
|
||||
LOG("Possible coin trade cheating attempt! Aborting trade.");
|
||||
Log::Warn("Possible coin trade cheating attempt! Aborting trade.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,11 +133,11 @@ void Trade::Complete() {
|
||||
auto* itemToRemove = inventoryA->FindItemById(tradeItem.itemId);
|
||||
if (itemToRemove) {
|
||||
if (itemToRemove->GetCount() < tradeItem.itemCount) {
|
||||
LOG("Possible cheating attempt from %s in trading!!! Aborting trade", characterA->GetName().c_str());
|
||||
Log::Warn("Possible cheating attempt from {:s} in trading!!! Aborting trade", characterA->GetName());
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
LOG("Possible cheating attempt from %s in trading due to item not being available!!!", characterA->GetName().c_str());
|
||||
Log::Warn("Possible cheating attempt from {:s} in trading due to item not being available!!!", characterA->GetName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -146,11 +146,11 @@ void Trade::Complete() {
|
||||
auto* itemToRemove = inventoryB->FindItemById(tradeItem.itemId);
|
||||
if (itemToRemove) {
|
||||
if (itemToRemove->GetCount() < tradeItem.itemCount) {
|
||||
LOG("Possible cheating attempt from %s in trading!!! Aborting trade", characterB->GetName().c_str());
|
||||
Log::Warn("Possible cheating attempt from {:s} in trading!!! Aborting trade", characterB->GetName());
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
LOG("Possible cheating attempt from %s in trading due to item not being available!!! Aborting trade", characterB->GetName().c_str());
|
||||
Log::Warn("Possible cheating attempt from {:s} in trading due to item not being available!!! Aborting trade", characterB->GetName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ void Trade::SendUpdateToOther(LWOOBJID participant) {
|
||||
uint64_t coins;
|
||||
std::vector<TradeItem> itemIds;
|
||||
|
||||
LOG("Attempting to send trade update");
|
||||
Log::Info("Attempting to send trade update");
|
||||
|
||||
if (participant == m_ParticipantA) {
|
||||
other = GetParticipantBEntity();
|
||||
@@ -228,7 +228,7 @@ void Trade::SendUpdateToOther(LWOOBJID participant) {
|
||||
items.push_back(tradeItem);
|
||||
}
|
||||
|
||||
LOG("Sending trade update");
|
||||
Log::Info("Sending trade update");
|
||||
|
||||
GameMessages::SendServerTradeUpdate(other->GetObjectID(), coins, items, other->GetSystemAddress());
|
||||
}
|
||||
@@ -281,7 +281,7 @@ Trade* TradingManager::NewTrade(LWOOBJID participantA, LWOOBJID participantB) {
|
||||
|
||||
trades[tradeId] = trade;
|
||||
|
||||
LOG("Created new trade between (%llu) <-> (%llu)", participantA, participantB);
|
||||
Log::Info("Created new trade between ({}) <-> ({})", participantA, participantB);
|
||||
|
||||
return trade;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ User::User(const SystemAddress& sysAddr, const std::string& username, const std:
|
||||
Character* character = new Character(lastUsedCharacterId, this);
|
||||
character->UpdateFromDatabase();
|
||||
m_Characters.push_back(character);
|
||||
LOG("Loaded %i as it is the last used char", lastUsedCharacterId);
|
||||
Log::Info("Loaded {:d} as it is the last used char", lastUsedCharacterId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void User::UserOutOfSync() {
|
||||
m_AmountOfTimesOutOfSync++;
|
||||
if (m_AmountOfTimesOutOfSync > m_MaxDesyncAllowed) {
|
||||
//YEET
|
||||
LOG("User %s was out of sync %i times out of %i, disconnecting for suspected speedhacking.", m_Username.c_str(), m_AmountOfTimesOutOfSync, m_MaxDesyncAllowed);
|
||||
Log::Warn("User {:s} was out of sync {:d} times out of {:d}, disconnecting for suspected speedhacking.", m_Username, m_AmountOfTimesOutOfSync, m_MaxDesyncAllowed);
|
||||
Game::server->Disconnect(this->m_SystemAddress, eServerDisconnectIdentifiers::PLAY_SCHEDULE_TIME_DONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ void UserManager::Initialize() {
|
||||
|
||||
auto fnStream = Game::assetManager->GetFile("names/minifigname_first.txt");
|
||||
if (!fnStream) {
|
||||
LOG("Failed to load %s", (Game::assetManager->GetResPath() / "names/minifigname_first.txt").string().c_str());
|
||||
Log::Warn("Failed to load {:s}", (Game::assetManager->GetResPath() / "names/minifigname_first.txt").string());
|
||||
throw std::runtime_error("Aborting initialization due to missing minifigure name file.");
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void UserManager::Initialize() {
|
||||
|
||||
auto mnStream = Game::assetManager->GetFile("names/minifigname_middle.txt");
|
||||
if (!mnStream) {
|
||||
LOG("Failed to load %s", (Game::assetManager->GetResPath() / "names/minifigname_middle.txt").string().c_str());
|
||||
Log::Warn("Failed to load {:s}", (Game::assetManager->GetResPath() / "names/minifigname_middle.txt").string());
|
||||
throw std::runtime_error("Aborting initialization due to missing minifigure name file.");
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ void UserManager::Initialize() {
|
||||
|
||||
auto lnStream = Game::assetManager->GetFile("names/minifigname_last.txt");
|
||||
if (!lnStream) {
|
||||
LOG("Failed to load %s", (Game::assetManager->GetResPath() / "names/minifigname_last.txt").string().c_str());
|
||||
Log::Warn("Failed to load {:s}", (Game::assetManager->GetResPath() / "names/minifigname_last.txt").string());
|
||||
throw std::runtime_error("Aborting initialization due to missing minifigure name file.");
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ void UserManager::Initialize() {
|
||||
// Load our pre-approved names:
|
||||
auto chatListStream = Game::assetManager->GetFile("chatplus_en_us.txt");
|
||||
if (!chatListStream) {
|
||||
LOG("Failed to load %s", (Game::assetManager->GetResPath() / "chatplus_en_us.txt").string().c_str());
|
||||
Log::Warn("Failed to load {:s}", (Game::assetManager->GetResPath() / "chatplus_en_us.txt").string());
|
||||
throw std::runtime_error("Aborting initialization due to missing chat whitelist file.");
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ bool UserManager::DeleteUser(const SystemAddress& sysAddr) {
|
||||
|
||||
void UserManager::DeletePendingRemovals() {
|
||||
for (auto* user : m_UsersToDelete) {
|
||||
LOG("Deleted user %i", user->GetAccountID());
|
||||
Log::Info("Deleted user {:d}", user->GetAccountID());
|
||||
|
||||
delete user;
|
||||
}
|
||||
@@ -306,27 +306,27 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
LOT pantsLOT = FindCharPantsID(pantsColor);
|
||||
|
||||
if (!name.empty() && Database::Get()->GetCharacterInfo(name)) {
|
||||
LOG("AccountID: %i chose unavailable name: %s", u->GetAccountID(), name.c_str());
|
||||
Log::Info("AccountID: {:d} chose unavailable name: {:s}", u->GetAccountID(), name);
|
||||
WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::CUSTOM_NAME_IN_USE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Database::Get()->GetCharacterInfo(predefinedName)) {
|
||||
LOG("AccountID: %i chose unavailable predefined name: %s", u->GetAccountID(), predefinedName.c_str());
|
||||
Log::Info("AccountID: {:d} chose unavailable predefined name: {:s}", u->GetAccountID(), predefinedName);
|
||||
WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::PREDEFINED_NAME_IN_USE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (name.empty()) {
|
||||
LOG("AccountID: %i is creating a character with predefined name: %s", u->GetAccountID(), predefinedName.c_str());
|
||||
Log::Info("AccountID: {:d} is creating a character with predefined name: {:s}", u->GetAccountID(), predefinedName);
|
||||
} else {
|
||||
LOG("AccountID: %i is creating a character with name: %s (temporary: %s)", u->GetAccountID(), name.c_str(), predefinedName.c_str());
|
||||
Log::Info("AccountID: {:d} is creating a character with name: {:s} (temporary: {:s})", u->GetAccountID(), name, predefinedName);
|
||||
}
|
||||
|
||||
//Now that the name is ok, we can get an objectID from Master:
|
||||
ObjectIDManager::RequestPersistentID([=, this](uint32_t objectID) mutable {
|
||||
if (Database::Get()->GetCharacterInfo(objectID)) {
|
||||
LOG("Character object id unavailable, check object_id_tracker!");
|
||||
Log::Warn("Character object id unavailable, check object_id_tracker!");
|
||||
WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::OBJECT_ID_UNAVAILABLE);
|
||||
return;
|
||||
}
|
||||
@@ -397,7 +397,7 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet) {
|
||||
User* u = GetUser(sysAddr);
|
||||
if (!u) {
|
||||
LOG("Couldn't get user to delete character");
|
||||
Log::Warn("Couldn't get user to delete character");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
inStream.Read(objectID);
|
||||
uint32_t charID = static_cast<uint32_t>(objectID);
|
||||
|
||||
LOG("Received char delete req for ID: %llu (%u)", objectID, charID);
|
||||
Log::Info("Received char delete req for ID: {:d} ({:d})", objectID, charID);
|
||||
|
||||
bool hasCharacter = CheatDetection::VerifyLwoobjidIsSender(
|
||||
objectID,
|
||||
@@ -418,7 +418,7 @@ void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
if (!hasCharacter) {
|
||||
WorldPackets::SendCharacterDeleteResponse(sysAddr, false);
|
||||
} else {
|
||||
LOG("Deleting character %i", charID);
|
||||
Log::Info("Deleting character {:d}", charID);
|
||||
Database::Get()->DeleteCharacter(charID);
|
||||
|
||||
CBITSTREAM;
|
||||
@@ -433,7 +433,7 @@ void UserManager::DeleteCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet) {
|
||||
User* u = GetUser(sysAddr);
|
||||
if (!u) {
|
||||
LOG("Couldn't get user to delete character");
|
||||
Log::Warn("Couldn't get user to delete character");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
GeneralUtils::ClearBit(objectID, eObjectBits::PERSISTENT);
|
||||
|
||||
uint32_t charID = static_cast<uint32_t>(objectID);
|
||||
LOG("Received char rename request for ID: %llu (%u)", objectID, charID);
|
||||
Log::Info("Received char rename request for ID: {:d} ({:d})", objectID, charID);
|
||||
|
||||
LUWString LUWStringName;
|
||||
inStream.Read(LUWStringName);
|
||||
@@ -479,12 +479,12 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
if (!Database::Get()->GetCharacterInfo(newName)) {
|
||||
if (IsNamePreapproved(newName)) {
|
||||
Database::Get()->SetCharacterName(charID, newName);
|
||||
LOG("Character %s now known as %s", character->GetName().c_str(), newName.c_str());
|
||||
Log::Info("Character {:s} now known as {:s}", character->GetName(), newName);
|
||||
WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::SUCCESS);
|
||||
UserManager::RequestCharacterList(sysAddr);
|
||||
} else {
|
||||
Database::Get()->SetPendingCharacterName(charID, newName);
|
||||
LOG("Character %s has been renamed to %s and is pending approval by a moderator.", character->GetName().c_str(), newName.c_str());
|
||||
Log::Info("Character {:s} has been renamed to {:s} and is pending approval by a moderator.", character->GetName(), newName);
|
||||
WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::SUCCESS);
|
||||
UserManager::RequestCharacterList(sysAddr);
|
||||
}
|
||||
@@ -492,7 +492,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::NAME_IN_USE);
|
||||
}
|
||||
} else {
|
||||
LOG("Unknown error occurred when renaming character, either hasCharacter or character variable != true.");
|
||||
Log::Warn("Unknown error occurred when renaming character, either hasCharacter or character variable != true.");
|
||||
WorldPackets::SendCharacterRenameResponse(sysAddr, eRenameResponse::UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
@@ -500,7 +500,7 @@ void UserManager::RenameCharacter(const SystemAddress& sysAddr, Packet* packet)
|
||||
void UserManager::LoginCharacter(const SystemAddress& sysAddr, uint32_t playerID) {
|
||||
User* u = GetUser(sysAddr);
|
||||
if (!u) {
|
||||
LOG("Couldn't get user to log in character");
|
||||
Log::Warn("Couldn't get user to log in character");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -519,7 +519,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) {
|
||||
LOG("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);
|
||||
Log::Info("Transferring {:s} to Zone {:d} (Instance {:d} | Clone {:d} | Mythran Shift: {:s}) with IP {:s} and Port {:d}", character->GetName(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP, serverPort);
|
||||
if (character) {
|
||||
character->SetZoneID(zoneID);
|
||||
character->SetZoneInstance(zoneInstance);
|
||||
@@ -529,7 +529,7 @@ void UserManager::LoginCharacter(const SystemAddress& sysAddr, uint32_t playerID
|
||||
return;
|
||||
});
|
||||
} else {
|
||||
LOG("Unknown error occurred when logging in a character, either hasCharacter or character variable != true.");
|
||||
Log::Warn("Unknown error occurred when logging in a character, either hasCharacter or character variable != true.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ uint32_t FindCharShirtID(uint32_t shirtColor, uint32_t shirtStyle) {
|
||||
tableData.finalize();
|
||||
return shirtLOT;
|
||||
} catch (const std::exception& ex) {
|
||||
LOG("Could not look up shirt %i %i: %s", shirtColor, shirtStyle, ex.what());
|
||||
Log::Warn("Could not look up shirt {:d} {:d}: {:s}", shirtColor, shirtStyle, ex.what());
|
||||
// in case of no shirt found in CDServer, return problematic red vest.
|
||||
return 4069;
|
||||
}
|
||||
@@ -564,7 +564,7 @@ uint32_t FindCharPantsID(uint32_t pantsColor) {
|
||||
tableData.finalize();
|
||||
return pantsLOT;
|
||||
} catch (const std::exception& ex) {
|
||||
LOG("Could not look up pants %i: %s", pantsColor, ex.what());
|
||||
Log::Warn("Could not look up pants {:d}: {:s}", pantsColor, ex.what());
|
||||
// in case of no pants color found in CDServer, return red pants.
|
||||
return 2508;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ void AirMovementBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bi
|
||||
uint32_t handle{};
|
||||
|
||||
if (!bitStream.Read(handle)) {
|
||||
LOG("Unable to read handle from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read handle from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ void AirMovementBehavior::Sync(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
uint32_t behaviorId{};
|
||||
|
||||
if (!bitStream.Read(behaviorId)) {
|
||||
LOG("Unable to read behaviorId from bitStream, aborting Sync! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read behaviorId from bitStream, aborting Sync! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
LWOOBJID target{};
|
||||
|
||||
if (!bitStream.Read(target)) {
|
||||
LOG("Unable to read target from bitStream, aborting Sync! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read target from bitStream, aborting Sync! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ void AreaOfEffectBehavior::Handle(BehaviorContext* context, RakNet::BitStream& b
|
||||
uint32_t targetCount{};
|
||||
|
||||
if (!bitStream.Read(targetCount)) {
|
||||
LOG("Unable to read targetCount from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read targetCount from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void AreaOfEffectBehavior::Handle(BehaviorContext* context, RakNet::BitStream& b
|
||||
}
|
||||
|
||||
if (targetCount > this->m_maxTargets) {
|
||||
LOG("Serialized size is greater than max targets! Size: %i, Max: %i", targetCount, this->m_maxTargets);
|
||||
Log::Warn("Serialized size is greater than max targets! Size: {:d}, Max: {:d}", targetCount, this->m_maxTargets);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void AreaOfEffectBehavior::Handle(BehaviorContext* context, RakNet::BitStream& b
|
||||
for (auto i = 0u; i < targetCount; ++i) {
|
||||
LWOOBJID target{};
|
||||
if (!bitStream.Read(target)) {
|
||||
LOG("failed to read in target %i from bitStream, aborting target Handle!", i);
|
||||
Log::Warn("failed to read in target {:d} from bitStream, aborting target Handle!", i);
|
||||
};
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ void AttackDelayBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bi
|
||||
uint32_t handle{};
|
||||
|
||||
if (!bitStream.Read(handle)) {
|
||||
LOG("Unable to read handle from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read handle from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@ void BasicAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bi
|
||||
|
||||
uint16_t allocatedBits{};
|
||||
if (!bitStream.Read(allocatedBits) || allocatedBits == 0) {
|
||||
LOG_DEBUG("No allocated bits");
|
||||
Log::Debug("No allocated bits");
|
||||
return;
|
||||
}
|
||||
LOG_DEBUG("Number of allocated bits %i", allocatedBits);
|
||||
Log::Debug("Number of allocated bits {:d}", allocatedBits);
|
||||
const auto baseAddress = bitStream.GetReadOffset();
|
||||
|
||||
DoHandleBehavior(context, bitStream, branch);
|
||||
@@ -48,13 +48,13 @@ void BasicAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bi
|
||||
void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
|
||||
auto* targetEntity = Game::entityManager->GetEntity(branch.target);
|
||||
if (!targetEntity) {
|
||||
LOG("Target targetEntity %llu not found.", branch.target);
|
||||
Log::Warn("Target targetEntity {:d} not found.", branch.target);
|
||||
return;
|
||||
}
|
||||
|
||||
auto* destroyableComponent = targetEntity->GetComponent<DestroyableComponent>();
|
||||
if (!destroyableComponent) {
|
||||
LOG("No destroyable found on the obj/lot %llu/%i", branch.target, targetEntity->GetLOT());
|
||||
Log::Warn("No destroyable found on the obj/lot {:d}/{:d}", branch.target, targetEntity->GetLOT());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
|
||||
bool isSuccess{};
|
||||
|
||||
if (!bitStream.Read(isBlocked)) {
|
||||
LOG("Unable to read isBlocked");
|
||||
Log::Warn("Unable to read isBlocked");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -75,31 +75,31 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
|
||||
}
|
||||
|
||||
if (!bitStream.Read(isImmune)) {
|
||||
LOG("Unable to read isImmune");
|
||||
Log::Warn("Unable to read isImmune");
|
||||
return;
|
||||
}
|
||||
|
||||
if (isImmune) {
|
||||
LOG_DEBUG("Target targetEntity %llu is immune!", branch.target);
|
||||
Log::Debug("Target targetEntity {} is immune!", branch.target);
|
||||
this->m_OnFailImmune->Handle(context, bitStream, branch);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!bitStream.Read(isSuccess)) {
|
||||
LOG("failed to read success from bitstream");
|
||||
Log::Warn("failed to read success from bitstream");
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSuccess) {
|
||||
uint32_t armorDamageDealt{};
|
||||
if (!bitStream.Read(armorDamageDealt)) {
|
||||
LOG("Unable to read armorDamageDealt");
|
||||
Log::Warn("Unable to read armorDamageDealt");
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t healthDamageDealt{};
|
||||
if (!bitStream.Read(healthDamageDealt)) {
|
||||
LOG("Unable to read healthDamageDealt");
|
||||
Log::Warn("Unable to read healthDamageDealt");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
|
||||
|
||||
bool died{};
|
||||
if (!bitStream.Read(died)) {
|
||||
LOG("Unable to read died");
|
||||
Log::Warn("Unable to read died");
|
||||
return;
|
||||
}
|
||||
auto previousArmor = destroyableComponent->GetArmor();
|
||||
@@ -123,7 +123,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
|
||||
|
||||
uint8_t successState{};
|
||||
if (!bitStream.Read(successState)) {
|
||||
LOG("Unable to read success state");
|
||||
Log::Warn("Unable to read success state");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ void BasicAttackBehavior::DoHandleBehavior(BehaviorContext* context, RakNet::Bit
|
||||
break;
|
||||
default:
|
||||
if (static_cast<eBasicAttackSuccessTypes>(successState) != eBasicAttackSuccessTypes::FAILIMMUNE) {
|
||||
LOG("Unknown success state (%i)!", successState);
|
||||
Log::Warn("Unknown success state ({})!", successState);
|
||||
return;
|
||||
}
|
||||
this->m_OnFailImmune->Handle(context, bitStream, branch);
|
||||
@@ -166,13 +166,13 @@ void BasicAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitStream&
|
||||
void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
|
||||
auto* targetEntity = Game::entityManager->GetEntity(branch.target);
|
||||
if (!targetEntity) {
|
||||
LOG("Target entity %llu is null!", branch.target);
|
||||
Log::Warn("Target entity {} is null!", branch.target);
|
||||
return;
|
||||
}
|
||||
|
||||
auto* destroyableComponent = targetEntity->GetComponent<DestroyableComponent>();
|
||||
if (!destroyableComponent || !destroyableComponent->GetParent()) {
|
||||
LOG("No destroyable component on %llu", branch.target);
|
||||
Log::Warn("No destroyable component on {}", branch.target);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet
|
||||
bitStream.Write(isImmune);
|
||||
|
||||
if (isImmune) {
|
||||
LOG_DEBUG("Target targetEntity %llu is immune!", branch.target);
|
||||
Log::Debug("Target targetEntity {} is immune!", branch.target);
|
||||
this->m_OnFailImmune->Calculate(context, bitStream, branch);
|
||||
return;
|
||||
}
|
||||
@@ -241,7 +241,7 @@ void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet
|
||||
break;
|
||||
default:
|
||||
if (static_cast<eBasicAttackSuccessTypes>(successState) != eBasicAttackSuccessTypes::FAILIMMUNE) {
|
||||
LOG("Unknown success state (%i)!", successState);
|
||||
Log::Warn("Unknown success state ({})!", GeneralUtils::ToUnderlying(successState));
|
||||
break;
|
||||
}
|
||||
this->m_OnFailImmune->Calculate(context, bitStream, branch);
|
||||
|
||||
@@ -281,12 +281,12 @@ Behavior* Behavior::CreateBehavior(const uint32_t behaviorId) {
|
||||
case BehaviorTemplates::BEHAVIOR_MOUNT: break;
|
||||
case BehaviorTemplates::BEHAVIOR_SKILL_SET: break;
|
||||
default:
|
||||
//LOG("Failed to load behavior with invalid template id (%i)!", templateId);
|
||||
//Log::Warn("Failed to load behavior with invalid template id ({:d})!", templateId);
|
||||
break;
|
||||
}
|
||||
|
||||
if (behavior == nullptr) {
|
||||
//LOG("Failed to load unimplemented template id (%i)!", templateId);
|
||||
//Log::Warn("Failed to load unimplemented template id ({:d})!", templateId);
|
||||
|
||||
behavior = new EmptyBehavior(behaviorId);
|
||||
}
|
||||
@@ -309,7 +309,7 @@ BehaviorTemplates Behavior::GetBehaviorTemplate(const uint32_t behaviorId) {
|
||||
}
|
||||
|
||||
if (templateID == BehaviorTemplates::BEHAVIOR_EMPTY && behaviorId != 0) {
|
||||
LOG("Failed to load behavior template with id (%i)!", behaviorId);
|
||||
Log::Warn("Failed to load behavior template with id ({:d})!", behaviorId);
|
||||
}
|
||||
|
||||
return templateID;
|
||||
@@ -429,7 +429,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) {
|
||||
LOG("Failed to load behavior with id (%i)!", behaviorId);
|
||||
Log::Warn("Failed to load behavior with id ({:d})!", behaviorId);
|
||||
|
||||
this->m_effectId = 0;
|
||||
this->m_effectHandle = nullptr;
|
||||
|
||||
@@ -31,7 +31,7 @@ uint32_t BehaviorContext::GetUniqueSkillId() const {
|
||||
auto* entity = Game::entityManager->GetEntity(this->originator);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Invalid entity for (%llu)!", this->originator);
|
||||
Log::Warn("Invalid entity for ({})!", this->originator);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ uint32_t BehaviorContext::GetUniqueSkillId() const {
|
||||
auto* component = entity->GetComponent<SkillComponent>();
|
||||
|
||||
if (component == nullptr) {
|
||||
LOG("No skill component attached to (%llu)!", this->originator);;
|
||||
Log::Warn("No skill component attached to ({})!", this->originator);;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ void BehaviorContext::SyncBehavior(const uint32_t syncId, RakNet::BitStream& bit
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
LOG("Failed to find behavior sync entry with sync id (%i)!", syncId);
|
||||
Log::Warn("Failed to find behavior sync entry with sync id ({})!", syncId);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -135,7 +135,7 @@ void BehaviorContext::SyncBehavior(const uint32_t syncId, RakNet::BitStream& bit
|
||||
const auto branch = entry.branchContext;
|
||||
|
||||
if (behavior == nullptr) {
|
||||
LOG("Invalid behavior for sync id (%i)!", syncId);
|
||||
Log::Warn("Invalid behavior for sync id ({})!", syncId);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -317,7 +317,7 @@ void BehaviorContext::FilterTargets(std::vector<Entity*>& targets, std::forward_
|
||||
// if the caster is not there, return empty targets list
|
||||
auto* caster = Game::entityManager->GetEntity(this->caster);
|
||||
if (!caster) {
|
||||
LOG_DEBUG("Invalid caster for (%llu)!", this->originator);
|
||||
Log::Debug("Invalid caster for ({})!", this->originator);
|
||||
targets.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ void BlockBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
|
||||
auto* entity = Game::entityManager->GetEntity(target);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Failed to find target (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find target ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ void BlockBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branc
|
||||
auto* entity = Game::entityManager->GetEntity(target);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Failed to find target (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find target ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ void BuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStream
|
||||
auto* entity = Game::entityManager->GetEntity(target);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Invalid target (%llu)!", target);
|
||||
Log::Warn("Invalid target ({})!", target);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -21,7 +21,7 @@ void BuffBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStream
|
||||
auto* component = entity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (component == nullptr) {
|
||||
LOG("Invalid target, no destroyable component (%llu)!", target);
|
||||
Log::Warn("Invalid target, no destroyable component ({})!", target);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ void BuffBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch
|
||||
auto* entity = Game::entityManager->GetEntity(target);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Invalid target (%llu)!", target);
|
||||
Log::Warn("Invalid target ({})!", target);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ void BuffBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch
|
||||
auto* component = entity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (component == nullptr) {
|
||||
LOG("Invalid target, no destroyable component (%llu)!", target);
|
||||
Log::Warn("Invalid target, no destroyable component ({})!", target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ void CarBoostBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitSt
|
||||
return;
|
||||
}
|
||||
|
||||
LOG("Activating car boost!");
|
||||
Log::Info("Activating car boost!");
|
||||
|
||||
auto* possessableComponent = entity->GetComponent<PossessableComponent>();
|
||||
if (possessableComponent != nullptr) {
|
||||
@@ -27,7 +27,7 @@ void CarBoostBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitSt
|
||||
|
||||
auto* characterComponent = possessor->GetComponent<CharacterComponent>();
|
||||
if (characterComponent != nullptr) {
|
||||
LOG("Tracking car boost!");
|
||||
Log::Info("Tracking car boost!");
|
||||
characterComponent->UpdatePlayerStatistic(RacingCarBoostsActivated);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ void ChainBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
|
||||
uint32_t chainIndex{};
|
||||
|
||||
if (!bitStream.Read(chainIndex)) {
|
||||
LOG("Unable to read chainIndex from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read chainIndex from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ void ChainBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
|
||||
if (chainIndex < this->m_behaviors.size()) {
|
||||
this->m_behaviors.at(chainIndex)->Handle(context, bitStream, branch);
|
||||
} else {
|
||||
LOG("chainIndex out of bounds, aborting handle of chain %i bits unread %i", chainIndex, bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("chainIndex out of bounds, aborting handle of chain {:d} bits unread {:d}", chainIndex, bitStream.GetNumberOfUnreadBits());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ void ChargeUpBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitSt
|
||||
uint32_t handle{};
|
||||
|
||||
if (!bitStream.Read(handle)) {
|
||||
LOG("Unable to read handle from bitStream, aborting Handle! variable_type");
|
||||
Log::Warn("Unable to read handle from bitStream, aborting Handle! variable_type");
|
||||
return;
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ void DamageAbsorptionBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
auto* target = Game::entityManager->GetEntity(branch.target);
|
||||
|
||||
if (target == nullptr) {
|
||||
LOG("Failed to find target (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find target ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ void DamageAbsorptionBehavior::Timer(BehaviorContext* context, BehaviorBranchCon
|
||||
auto* target = Game::entityManager->GetEntity(second);
|
||||
|
||||
if (target == nullptr) {
|
||||
LOG("Failed to find target (%llu)!", second);
|
||||
Log::Warn("Failed to find target ({})!", second);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ void DamageReductionBehavior::Handle(BehaviorContext* context, RakNet::BitStream
|
||||
auto* target = Game::entityManager->GetEntity(branch.target);
|
||||
|
||||
if (target == nullptr) {
|
||||
LOG("Failed to find target (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find target ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ void DamageReductionBehavior::Timer(BehaviorContext* context, BehaviorBranchCont
|
||||
auto* target = Game::entityManager->GetEntity(second);
|
||||
|
||||
if (target == nullptr) {
|
||||
LOG("Failed to find target (%llu)!", second);
|
||||
Log::Warn("Failed to find target ({})!", second);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ void ForceMovementBehavior::Handle(BehaviorContext* context, RakNet::BitStream&
|
||||
|
||||
uint32_t handle{};
|
||||
if (!bitStream.Read(handle)) {
|
||||
LOG("Unable to read handle from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read handle from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
context->RegisterSyncBehavior(handle, this, branch, this->m_Duration);
|
||||
@@ -22,13 +22,13 @@ void ForceMovementBehavior::Handle(BehaviorContext* context, RakNet::BitStream&
|
||||
void ForceMovementBehavior::Sync(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
|
||||
uint32_t next{};
|
||||
if (!bitStream.Read(next)) {
|
||||
LOG("Unable to read target from bitStream, aborting Sync! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read target from bitStream, aborting Sync! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
LWOOBJID target{};
|
||||
if (!bitStream.Read(target)) {
|
||||
LOG("Unable to read target from bitStream, aborting Sync! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read target from bitStream, aborting Sync! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ void HealBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bit_strea
|
||||
auto* entity = Game::entityManager->GetEntity(branch.target);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Failed to find entity for (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find entity for ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -19,7 +19,7 @@ void HealBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bit_strea
|
||||
auto* destroyable = static_cast<DestroyableComponent*>(entity->GetComponent(eReplicaComponentType::DESTROYABLE));
|
||||
|
||||
if (destroyable == nullptr) {
|
||||
LOG("Failed to find destroyable component for %(llu)!", branch.target);
|
||||
Log::Warn("Failed to find destroyable component for ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ void ImmunityBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitSt
|
||||
auto* target = Game::entityManager->GetEntity(branch.target);
|
||||
|
||||
if (!target) {
|
||||
LOG("Failed to find target (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find target ({})!", branch.target);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ void ImmunityBehavior::Timer(BehaviorContext* context, BehaviorBranchContext bra
|
||||
auto* target = Game::entityManager->GetEntity(second);
|
||||
|
||||
if (!target) {
|
||||
LOG("Failed to find target (%llu)!", second);
|
||||
Log::Warn("Failed to find target ({})!", second);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ void InterruptBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
bool unknown = false;
|
||||
|
||||
if (!bitStream.Read(unknown)) {
|
||||
LOG("Unable to read unknown1 from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read unknown1 from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ void InterruptBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
bool unknown = false;
|
||||
|
||||
if (!bitStream.Read(unknown)) {
|
||||
LOG("Unable to read unknown2 from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read unknown2 from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ void InterruptBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
bool unknown = false;
|
||||
|
||||
if (!bitStream.Read(unknown)) {
|
||||
LOG("Unable to read unknown3 from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read unknown3 from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ void KnockbackBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
bool unknown{};
|
||||
|
||||
if (!bitStream.Read(unknown)) {
|
||||
LOG("Unable to read unknown from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read unknown from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ void MovementSwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream&
|
||||
this->m_movingAction->m_templateId == BehaviorTemplates::BEHAVIOR_EMPTY) {
|
||||
return;
|
||||
}
|
||||
LOG("Unable to read movementType from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read movementType from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
LWOOBJID target{};
|
||||
|
||||
if (!bitStream.Read(target)) {
|
||||
LOG("Unable to read target from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read target from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
auto* entity = Game::entityManager->GetEntity(context->originator);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Failed to find originator (%llu)!", context->originator);
|
||||
Log::Warn("Failed to find originator ({:d})!", context->originator);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr) {
|
||||
LOG("Failed to find skill component for (%llu)!", -context->originator);
|
||||
Log::Warn("Failed to find skill component for ({:d})!", -context->originator);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
if (m_useMouseposit && !branch.isSync) {
|
||||
NiPoint3 targetPosition = NiPoint3Constant::ZERO;
|
||||
if (!bitStream.Read(targetPosition)) {
|
||||
LOG("Unable to read targetPosition from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read targetPosition from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
}
|
||||
@@ -46,7 +46,7 @@ void ProjectileAttackBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
LWOOBJID projectileId{};
|
||||
|
||||
if (!bitStream.Read(projectileId)) {
|
||||
LOG("Unable to read projectileId from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read projectileId from bitStream, aborting Handle! {:d}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -64,7 +64,7 @@ void ProjectileAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitSt
|
||||
auto* entity = Game::entityManager->GetEntity(context->originator);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Failed to find originator (%llu)!", context->originator);
|
||||
Log::Warn("Failed to find originator ({})!", context->originator);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ void ProjectileAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitSt
|
||||
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr) {
|
||||
LOG("Failed to find skill component for (%llu)!", context->originator);
|
||||
Log::Warn("Failed to find skill component for ({})!", context->originator);
|
||||
|
||||
return;
|
||||
|
||||
@@ -81,7 +81,7 @@ void ProjectileAttackBehavior::Calculate(BehaviorContext* context, RakNet::BitSt
|
||||
auto* other = Game::entityManager->GetEntity(branch.target);
|
||||
|
||||
if (other == nullptr) {
|
||||
LOG("Invalid projectile target (%llu)!", branch.target);
|
||||
Log::Warn("Invalid projectile target ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ void PropertyTeleportBehavior::Handle(BehaviorContext* context, RakNet::BitStrea
|
||||
if (zoneClone != 0) ChatPackets::SendSystemMessage(sysAddr, u"Transfering to your property!");
|
||||
else ChatPackets::SendSystemMessage(sysAddr, u"Transfering back to previous world!");
|
||||
|
||||
LOG("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);
|
||||
Log::Info("Transferring {:s} to Zone {:d} (Instance {:d} | Clone {:d} | Mythran Shift: {:s}) with IP {:s} and Port {:d}", sysAddr.ToString(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP, serverPort);
|
||||
if (entity->GetCharacter()) {
|
||||
entity->GetCharacter()->SetZoneID(zoneID);
|
||||
entity->GetCharacter()->SetZoneInstance(zoneInstance);
|
||||
|
||||
@@ -11,7 +11,7 @@ void RepairBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bit_str
|
||||
auto* entity = Game::entityManager->GetEntity(branch.target);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Failed to find entity for (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find entity for ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -19,7 +19,7 @@ void RepairBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bit_str
|
||||
auto* destroyable = static_cast<DestroyableComponent*>(entity->GetComponent(eReplicaComponentType::DESTROYABLE));
|
||||
|
||||
if (destroyable == nullptr) {
|
||||
LOG("Failed to find destroyable component for %(llu)!", branch.target);
|
||||
Log::Warn("Failed to find destroyable component for ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
|
||||
auto* origin = Game::entityManager->GetEntity(context->originator);
|
||||
|
||||
if (origin == nullptr) {
|
||||
LOG("Failed to find self entity (%llu)!", context->originator);
|
||||
Log::Warn("Failed to find self entity ({})!", context->originator);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
|
||||
);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Failed to spawn entity (%i)!", this->m_lot);
|
||||
Log::Warn("Failed to spawn entity ({})!", this->m_lot);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ void SpawnBehavior::Timer(BehaviorContext* context, const BehaviorBranchContext
|
||||
auto* entity = Game::entityManager->GetEntity(second);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Failed to find spawned entity (%llu)!", second);
|
||||
Log::Warn("Failed to find spawned entity ({})!", second);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ void StunBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStream
|
||||
|
||||
bool blocked{};
|
||||
if (!bitStream.Read(blocked)) {
|
||||
LOG("Unable to read blocked from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read blocked from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
auto* target = Game::entityManager->GetEntity(branch.target);
|
||||
|
||||
if (target == nullptr) {
|
||||
LOG("Failed to find target (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find target ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitStr
|
||||
auto* self = Game::entityManager->GetEntity(context->originator);
|
||||
|
||||
if (self == nullptr) {
|
||||
LOG("Invalid self entity (%llu)!", context->originator);
|
||||
Log::Warn("Invalid self entity ({})!", context->originator);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ void StunBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitStr
|
||||
bitStream.Write(blocked);
|
||||
|
||||
if (target == nullptr) {
|
||||
LOG("Failed to find target (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find target ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ void SwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
|
||||
|
||||
if (this->m_imagination > 0 || !this->m_isEnemyFaction) {
|
||||
if (!bitStream.Read(state)) {
|
||||
LOG("Unable to read state from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read state from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
}
|
||||
@@ -28,7 +28,7 @@ void SwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_DEBUG("[%i] State: (%d), imagination: (%i) / (%f)", entity->GetLOT(), state, destroyableComponent->GetImagination(), destroyableComponent->GetMaxImagination());
|
||||
Log::Debug("[{}] State: ({}), imagination: ({}) / ({})", entity->GetLOT(), state, destroyableComponent->GetImagination(), destroyableComponent->GetMaxImagination());
|
||||
|
||||
if (state) {
|
||||
this->m_actionTrue->Handle(context, bitStream, branch);
|
||||
|
||||
@@ -13,7 +13,7 @@ void SwitchMultipleBehavior::Handle(BehaviorContext* context, RakNet::BitStream&
|
||||
float value{};
|
||||
|
||||
if (!bitStream.Read(value)) {
|
||||
LOG("Unable to read value from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read value from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
|
||||
|
||||
if (this->m_usePickedTarget && branch.target != LWOOBJID_EMPTY) {
|
||||
auto target = Game::entityManager->GetEntity(branch.target);
|
||||
if (!target) LOG("target %llu is null", branch.target);
|
||||
if (!target) Log::Warn("target {} is null", branch.target);
|
||||
else {
|
||||
targets.push_back(target);
|
||||
context->FilterTargets(targets, this->m_ignoreFactionList, this->m_includeFactionList, this->m_targetSelf, this->m_targetEnemy, this->m_targetFriend, this->m_targetTeam);
|
||||
@@ -29,7 +29,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
|
||||
|
||||
bool hasTargets = false;
|
||||
if (!bitStream.Read(hasTargets)) {
|
||||
LOG("Unable to read hasTargets from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read hasTargets from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
|
||||
bool blocked = false;
|
||||
|
||||
if (!bitStream.Read(blocked)) {
|
||||
LOG("Unable to read blocked from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read blocked from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -50,12 +50,12 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
|
||||
if (hasTargets) {
|
||||
uint32_t count = 0;
|
||||
if (!bitStream.Read(count)) {
|
||||
LOG("Unable to read count from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read count from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
if (count > m_maxTargets) {
|
||||
LOG("Bitstream has too many targets Max:%i Recv:%i", this->m_maxTargets, count);
|
||||
Log::Warn("Bitstream has too many targets Max:{} Recv:{}", this->m_maxTargets, count);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
|
||||
LWOOBJID id{};
|
||||
|
||||
if (!bitStream.Read(id)) {
|
||||
LOG("Unable to read id from bitStream, aborting Handle! %i", bitStream.GetNumberOfUnreadBits());
|
||||
Log::Warn("Unable to read id from bitStream, aborting Handle! {}", bitStream.GetNumberOfUnreadBits());
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -71,7 +71,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
|
||||
auto* canidate = Game::entityManager->GetEntity(id);
|
||||
if (canidate) targets.push_back(canidate);
|
||||
} else {
|
||||
LOG("Bitstream has LWOOBJID_EMPTY as a target!");
|
||||
Log::Warn("Bitstream has LWOOBJID_EMPTY as a target!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ void TacArcBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStre
|
||||
void TacArcBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitStream, BehaviorBranchContext branch) {
|
||||
auto* self = Game::entityManager->GetEntity(context->originator);
|
||||
if (self == nullptr) {
|
||||
LOG("Invalid self for (%llu)!", context->originator);
|
||||
Log::Warn("Invalid self for ({})!", context->originator);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ void TauntBehavior::Handle(BehaviorContext* context, RakNet::BitStream& bitStrea
|
||||
auto* target = Game::entityManager->GetEntity(branch.target);
|
||||
|
||||
if (target == nullptr) {
|
||||
LOG("Failed to find target (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find target ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -26,7 +26,7 @@ void TauntBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitSt
|
||||
auto* target = Game::entityManager->GetEntity(branch.target);
|
||||
|
||||
if (target == nullptr) {
|
||||
LOG("Failed to find target (%llu)!", branch.target);
|
||||
Log::Warn("Failed to find target ({})!", branch.target);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ void VerifyBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
auto* self = Game::entityManager->GetEntity(context->originator);
|
||||
|
||||
if (self == nullptr) {
|
||||
LOG("Invalid self for (%llu)", context->originator);
|
||||
Log::Warn("Invalid self for ({})", context->originator);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ void ActivityComponent::Update(float deltaTime) {
|
||||
|
||||
// The timer has elapsed, start the instance
|
||||
if (lobby->timer <= 0.0f) {
|
||||
LOG("Setting up instance.");
|
||||
Log::Info("Setting up instance.");
|
||||
ActivityInstance* instance = NewInstance();
|
||||
LoadPlayersIntoInstance(instance, lobby->players);
|
||||
instance->StartZone();
|
||||
@@ -524,7 +524,7 @@ void ActivityInstance::StartZone() {
|
||||
if (player == nullptr)
|
||||
return;
|
||||
|
||||
LOG("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);
|
||||
Log::Info("Transferring {:s} to Zone {:d} (Instance {:d} | Clone {:d} | Mythran Shift: {:s}) with IP {:s} and Port {:d}", player->GetCharacter()->GetName(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP, serverPort);
|
||||
if (player->GetCharacter()) {
|
||||
player->GetCharacter()->SetZoneID(zoneID);
|
||||
player->GetCharacter()->SetZoneInstance(zoneInstance);
|
||||
|
||||
@@ -540,7 +540,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
|
||||
auto* entity = Game::entityManager->GetEntity(target);
|
||||
|
||||
if (entity == nullptr) {
|
||||
LOG("Invalid entity for checking validity (%llu)!", target);
|
||||
Log::Warn("Invalid entity for checking validity ({})!", target);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -554,7 +554,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
|
||||
auto* referenceDestroyable = m_Parent->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (referenceDestroyable == nullptr) {
|
||||
LOG("Invalid reference destroyable component on (%llu)!", m_Parent->GetObjectID());
|
||||
Log::Warn("Invalid reference destroyable component on ({})!", m_Parent->GetObjectID());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -81,13 +81,13 @@ void BouncerComponent::LookupPetSwitch() {
|
||||
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
|
||||
LOG("Loaded pet bouncer");
|
||||
Log::Info("Loaded pet bouncer");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_PetSwitchLoaded) {
|
||||
LOG("Failed to load pet bouncer");
|
||||
Log::Warn("Failed to load pet bouncer");
|
||||
|
||||
m_Parent->AddCallbackTimer(0.5f, [this]() {
|
||||
LookupPetSwitch();
|
||||
|
||||
@@ -110,7 +110,7 @@ void BuffComponent::Update(float deltaTime) {
|
||||
const std::string& GetFxName(const std::string& buffname) {
|
||||
const auto& toReturn = BuffFx[buffname];
|
||||
if (toReturn.empty()) {
|
||||
LOG_DEBUG("No fx name for %s", buffname.c_str());
|
||||
Log::Debug("No fx name for {:s}", buffname);
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ void BuffComponent::ApplyBuffFx(uint32_t buffId, const BuffParameter& buff) {
|
||||
if (buffName.empty()) return;
|
||||
|
||||
fxToPlay += std::to_string(buffId);
|
||||
LOG_DEBUG("Playing %s %i", fxToPlay.c_str(), buff.effectId);
|
||||
Log::Debug("Playing {:s} {:d}", fxToPlay, buff.effectId);
|
||||
GameMessages::SendPlayFXEffect(m_Parent->GetObjectID(), buff.effectId, u"cast", fxToPlay, LWOOBJID_EMPTY, 1.07f, 1.0f, false);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ void BuffComponent::RemoveBuffFx(uint32_t buffId, const BuffParameter& buff) {
|
||||
if (buffName.empty()) return;
|
||||
|
||||
fxToPlay += std::to_string(buffId);
|
||||
LOG_DEBUG("Stopping %s", fxToPlay.c_str());
|
||||
Log::Debug("Stopping {:s}", fxToPlay);
|
||||
GameMessages::SendStopFXEffect(m_Parent, false, fxToPlay);
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ const std::vector<BuffParameter>& BuffComponent::GetBuffParameters(int32_t buffI
|
||||
|
||||
param.values.push_back(value);
|
||||
} catch (std::invalid_argument& exception) {
|
||||
LOG("Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
|
||||
Log::Warn("Failed to parse value ({:s}): ({:s})!", token, exception.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ void BuildBorderComponent::OnUse(Entity* originator) {
|
||||
if (!entities.empty()) {
|
||||
buildArea = entities[0]->GetObjectID();
|
||||
|
||||
LOG("Using PropertyPlaque");
|
||||
Log::Info("Using PropertyPlaque");
|
||||
}
|
||||
|
||||
auto* inventoryComponent = originator->GetComponent<InventoryComponent>();
|
||||
@@ -41,7 +41,7 @@ void BuildBorderComponent::OnUse(Entity* originator) {
|
||||
|
||||
inventoryComponent->PushEquippedItems();
|
||||
|
||||
LOG("Starting with %llu", buildArea);
|
||||
Log::Info("Starting with {}", buildArea);
|
||||
|
||||
if (PropertyManagementComponent::Instance() != nullptr) {
|
||||
GameMessages::SendStartArrangingWithItem(
|
||||
|
||||
@@ -190,7 +190,7 @@ void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
|
||||
|
||||
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
|
||||
if (!character) {
|
||||
LOG("Failed to find char tag while loading XML!");
|
||||
Log::Warn("Failed to find char tag while loading XML!");
|
||||
return;
|
||||
}
|
||||
if (character->QueryAttribute("rpt", &m_Reputation) == tinyxml2::XML_NO_ATTRIBUTE) {
|
||||
@@ -302,7 +302,7 @@ void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
|
||||
void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
tinyxml2::XMLElement* minifig = doc->FirstChildElement("obj")->FirstChildElement("mf");
|
||||
if (!minifig) {
|
||||
LOG("Failed to find mf tag while updating XML!");
|
||||
Log::Warn("Failed to find mf tag while updating XML!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
|
||||
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
|
||||
if (!character) {
|
||||
LOG("Failed to find char tag while updating XML!");
|
||||
Log::Warn("Failed to find char tag while updating XML!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
//
|
||||
|
||||
auto newUpdateTimestamp = std::time(nullptr);
|
||||
LOG("Time since last save: %d", newUpdateTimestamp - m_LastUpdateTimestamp);
|
||||
Log::Warn("Time since last save: {:d}", newUpdateTimestamp - m_LastUpdateTimestamp);
|
||||
|
||||
m_TotalTimePlayed += newUpdateTimestamp - m_LastUpdateTimestamp;
|
||||
character->SetAttribute("time", m_TotalTimePlayed);
|
||||
@@ -405,7 +405,7 @@ Item* CharacterComponent::GetRocket(Entity* player) {
|
||||
}
|
||||
|
||||
if (!rocket) {
|
||||
LOG("Unable to find rocket to equip!");
|
||||
Log::Warn("Unable to find rocket to equip!");
|
||||
return rocket;
|
||||
}
|
||||
return rocket;
|
||||
@@ -772,7 +772,7 @@ void CharacterComponent::AwardClaimCodes() {
|
||||
|
||||
auto* cdrewardCodes = CDClientManager::GetTable<CDRewardCodesTable>();
|
||||
for (auto const rewardCode : rewardCodes) {
|
||||
LOG_DEBUG("Processing RewardCode %i", rewardCode);
|
||||
Log::Debug("Processing RewardCode {:d}", rewardCode);
|
||||
const uint32_t rewardCodeIndex = rewardCode >> 6;
|
||||
const uint32_t bitIndex = rewardCode % 64;
|
||||
if (GeneralUtils::CheckBit(m_ClaimCodes[rewardCodeIndex], bitIndex)) continue;
|
||||
|
||||
@@ -50,7 +50,7 @@ ControllablePhysicsComponent::ControllablePhysicsComponent(Entity* entity) : Phy
|
||||
return;
|
||||
|
||||
if (entity->GetLOT() == 1) {
|
||||
LOG("Using patch to load minifig physics");
|
||||
Log::Info("Using patch to load minifig physics");
|
||||
|
||||
float radius = 1.5f;
|
||||
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), radius, false);
|
||||
@@ -161,7 +161,7 @@ void ControllablePhysicsComponent::Serialize(RakNet::BitStream& outBitStream, bo
|
||||
void ControllablePhysicsComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
|
||||
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
|
||||
if (!character) {
|
||||
LOG("Failed to find char tag!");
|
||||
Log::Warn("Failed to find char tag!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ void ControllablePhysicsComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
|
||||
void ControllablePhysicsComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
|
||||
if (!character) {
|
||||
LOG("Failed to find char tag while updating XML!");
|
||||
Log::Warn("Failed to find char tag while updating XML!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ void ControllablePhysicsComponent::RemoveSpeedboost(float value) {
|
||||
|
||||
void ControllablePhysicsComponent::ActivateBubbleBuff(eBubbleType bubbleType, bool specialAnims) {
|
||||
if (m_IsInBubble) {
|
||||
LOG("Already in bubble");
|
||||
Log::Warn("Already in bubble");
|
||||
return;
|
||||
}
|
||||
m_BubbleType = bubbleType;
|
||||
|
||||
@@ -188,7 +188,7 @@ void DestroyableComponent::Update(float deltaTime) {
|
||||
void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
|
||||
tinyxml2::XMLElement* dest = doc->FirstChildElement("obj")->FirstChildElement("dest");
|
||||
if (!dest) {
|
||||
LOG("Failed to find dest tag!");
|
||||
Log::Warn("Failed to find dest tag!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
|
||||
void DestroyableComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
tinyxml2::XMLElement* dest = doc->FirstChildElement("obj")->FirstChildElement("dest");
|
||||
if (!dest) {
|
||||
LOG("Failed to find dest tag!");
|
||||
Log::Warn("Failed to find dest tag!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,14 +175,14 @@ void InventoryComponent::AddItem(
|
||||
const bool bound,
|
||||
int32_t preferredSlot) {
|
||||
if (count == 0) {
|
||||
LOG("Attempted to add 0 of item (%i) to the inventory!", lot);
|
||||
Log::Warn("Attempted to add 0 of item ({}) to the inventory!", lot);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Inventory::IsValidItem(lot)) {
|
||||
if (lot > 0) {
|
||||
LOG("Attempted to add invalid item (%i) to the inventory!", lot);
|
||||
Log::Warn("Attempted to add invalid item ({} to the inventory!", lot);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -200,7 +200,7 @@ void InventoryComponent::AddItem(
|
||||
const auto slot = preferredSlot != -1 && inventory->IsSlotEmpty(preferredSlot) ? preferredSlot : inventory->FindEmptySlot();
|
||||
|
||||
if (slot == -1) {
|
||||
LOG("Failed to find empty slot for inventory (%i)!", inventoryType);
|
||||
Log::Warn("Failed to find empty slot for inventory ({:d})!", GeneralUtils::ToUnderlying(inventoryType));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -296,7 +296,7 @@ void InventoryComponent::AddItem(
|
||||
|
||||
bool InventoryComponent::RemoveItem(const LOT lot, const uint32_t count, eInventoryType inventoryType, const bool ignoreBound, const bool silent) {
|
||||
if (count == 0) {
|
||||
LOG("Attempted to remove 0 of item (%i) from the inventory!", lot);
|
||||
Log::Warn("Attempted to remove 0 of item ({}) from the inventory!", lot);
|
||||
return false;
|
||||
}
|
||||
if (inventoryType == INVALID) inventoryType = Inventory::FindInventoryTypeForLot(lot);
|
||||
@@ -478,7 +478,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
|
||||
auto* inventoryElement = document->FirstChildElement("obj")->FirstChildElement("inv");
|
||||
|
||||
if (inventoryElement == nullptr) {
|
||||
LOG("Failed to find 'inv' xml element!");
|
||||
Log::Warn("Failed to find 'inv' xml element!");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -486,7 +486,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
|
||||
auto* bags = inventoryElement->FirstChildElement("bag");
|
||||
|
||||
if (bags == nullptr) {
|
||||
LOG("Failed to find 'bags' xml element!");
|
||||
Log::Warn("Failed to find 'bags' xml element!");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -512,7 +512,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
|
||||
auto* items = inventoryElement->FirstChildElement("items");
|
||||
|
||||
if (items == nullptr) {
|
||||
LOG("Failed to find 'items' xml element!");
|
||||
Log::Warn("Failed to find 'items' xml element!");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -527,7 +527,7 @@ void InventoryComponent::LoadXml(tinyxml2::XMLDocument* document) {
|
||||
auto* inventory = GetInventory(static_cast<eInventoryType>(type));
|
||||
|
||||
if (inventory == nullptr) {
|
||||
LOG("Failed to find inventory (%i)!", type);
|
||||
Log::Warn("Failed to find inventory ({})!", type);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -600,7 +600,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document) {
|
||||
auto* inventoryElement = document->FirstChildElement("obj")->FirstChildElement("inv");
|
||||
|
||||
if (inventoryElement == nullptr) {
|
||||
LOG("Failed to find 'inv' xml element!");
|
||||
Log::Warn("Failed to find 'inv' xml element!");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -623,7 +623,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document) {
|
||||
auto* bags = inventoryElement->FirstChildElement("bag");
|
||||
|
||||
if (bags == nullptr) {
|
||||
LOG("Failed to find 'bags' xml element!");
|
||||
Log::Warn("Failed to find 'bags' xml element!");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -642,7 +642,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document) {
|
||||
auto* items = inventoryElement->FirstChildElement("items");
|
||||
|
||||
if (items == nullptr) {
|
||||
LOG("Failed to find 'items' xml element!");
|
||||
Log::Warn("Failed to find 'items' xml element!");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -917,7 +917,7 @@ void InventoryComponent::EquipScripts(Item* equippedItem) {
|
||||
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
|
||||
auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
|
||||
if (!itemScript) {
|
||||
LOG("null script?");
|
||||
Log::Warn("null script?");
|
||||
}
|
||||
itemScript->OnFactionTriggerItemEquipped(m_Parent, equippedItem->GetId());
|
||||
}
|
||||
@@ -932,7 +932,7 @@ void InventoryComponent::UnequipScripts(Item* unequippedItem) {
|
||||
CDScriptComponent scriptCompData = scriptCompTable->GetByID(scriptComponentID);
|
||||
auto* itemScript = CppScripts::GetScript(m_Parent, scriptCompData.script_name);
|
||||
if (!itemScript) {
|
||||
LOG("null script?");
|
||||
Log::Warn("null script?");
|
||||
}
|
||||
itemScript->OnFactionTriggerItemUnequipped(m_Parent, unequippedItem->GetId());
|
||||
}
|
||||
@@ -1312,7 +1312,7 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
|
||||
const auto entry = behaviors->GetSkillByID(result.skillID);
|
||||
|
||||
if (entry.skillID == 0) {
|
||||
LOG("Failed to find buff behavior for skill (%i)!", result.skillID);
|
||||
Log::Warn("Failed to find buff behavior for skill ({})!", result.skillID);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -1379,7 +1379,7 @@ std::vector<Item*> InventoryComponent::GenerateProxies(Item* parent) {
|
||||
try {
|
||||
lots.push_back(std::stoi(segment));
|
||||
} catch (std::invalid_argument& exception) {
|
||||
LOG("Failed to parse proxy (%s): (%s)!", segment.c_str(), exception.what());
|
||||
Log::Warn("Failed to parse proxy ({:s}): ({:s})!", segment, exception.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ LevelProgressionComponent::LevelProgressionComponent(Entity* parent) : Component
|
||||
void LevelProgressionComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
tinyxml2::XMLElement* level = doc->FirstChildElement("obj")->FirstChildElement("lvl");
|
||||
if (!level) {
|
||||
LOG("Failed to find lvl tag while updating XML!");
|
||||
Log::Warn("Failed to find lvl tag while updating XML!");
|
||||
return;
|
||||
}
|
||||
level->SetAttribute("l", m_Level);
|
||||
@@ -27,7 +27,7 @@ void LevelProgressionComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
void LevelProgressionComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
|
||||
tinyxml2::XMLElement* level = doc->FirstChildElement("obj")->FirstChildElement("lvl");
|
||||
if (!level) {
|
||||
LOG("Failed to find lvl tag while loading XML!");
|
||||
Log::Warn("Failed to find lvl tag while loading XML!");
|
||||
return;
|
||||
}
|
||||
level->QueryAttribute("l", &m_Level);
|
||||
|
||||
@@ -364,7 +364,7 @@ const std::vector<uint32_t> MissionComponent::LookForAchievements(eMissionTaskTy
|
||||
break;
|
||||
}
|
||||
} catch (std::invalid_argument& exception) {
|
||||
LOG("Failed to parse target (%s): (%s)!", token.c_str(), exception.what());
|
||||
Log::Warn("Failed to parse target ({:s}): ({:s})!", token, exception.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
|
||||
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||
|
||||
if (!missionComponent) {
|
||||
LOG("Unable to get mission component for Entity %llu", entity->GetObjectID());
|
||||
Log::Warn("Unable to get mission component for Entity {}", entity->GetObjectID());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
|
||||
|
||||
randomMissionPool.push_back(value);
|
||||
} catch (std::invalid_argument& exception) {
|
||||
LOG("Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
|
||||
Log::Warn("Failed to parse value ({:s}): ({:s})!", token, exception.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ MovingPlatformComponent::MovingPlatformComponent(Entity* parent, const std::stri
|
||||
m_NoAutoStart = false;
|
||||
|
||||
if (m_Path == nullptr) {
|
||||
LOG("Path not found: %s", pathName.c_str());
|
||||
Log::Warn("Path not found: {:s}", pathName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ void PetComponent::OnUse(Entity* originator) {
|
||||
|
||||
if (bricks.empty()) {
|
||||
ChatPackets::SendSystemMessage(originator->GetSystemAddress(), u"Failed to load the puzzle minigame for this pet.");
|
||||
LOG("Couldn't find %s for minigame!", buildFile.c_str());
|
||||
Log::Warn("Couldn't find {:s} for minigame!", buildFile);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -640,7 +640,7 @@ void PetComponent::RequestSetPetName(std::u16string name) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG("Got set pet name (%s)", GeneralUtils::UTF16ToWTF8(name).c_str());
|
||||
Log::Info("Got set pet name ({:s})", GeneralUtils::UTF16ToWTF8(name));
|
||||
|
||||
auto* inventoryComponent = tamer->GetComponent<InventoryComponent>();
|
||||
|
||||
@@ -908,7 +908,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(m_PetInfo.imaginationDrainRate, [playerDestroyableComponent, this, item]() {
|
||||
if (!playerDestroyableComponent) {
|
||||
LOG("No petComponent and/or no playerDestroyableComponent");
|
||||
Log::Warn("No petComponent and/or no playerDestroyableComponent");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ PhantomPhysicsComponent::PhantomPhysicsComponent(Entity* parent) : PhysicsCompon
|
||||
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), 390.496826f, 111.467964f, 600.821534f, true);
|
||||
m_Position.y -= (111.467964f * m_Scale) / 2;
|
||||
} else {
|
||||
// LOG_DEBUG("This one is supposed to have %s", info->physicsAsset.c_str());
|
||||
// Log::Debug("This one is supposed to have {:s}", info->physicsAsset);
|
||||
|
||||
//add fallback cube:
|
||||
m_dpEntity = new dpEntity(m_Parent->GetObjectID(), 2.0f, 2.0f, 2.0f);
|
||||
@@ -361,10 +361,10 @@ void PhantomPhysicsComponent::SetDirection(const NiPoint3& pos) {
|
||||
void PhantomPhysicsComponent::SpawnVertices() {
|
||||
if (!m_dpEntity) return;
|
||||
|
||||
LOG("%llu", m_Parent->GetObjectID());
|
||||
Log::Info("{}", m_Parent->GetObjectID());
|
||||
auto box = static_cast<dpShapeBox*>(m_dpEntity->GetShape());
|
||||
for (auto vert : box->GetVertices()) {
|
||||
LOG("%f, %f, %f", vert.x, vert.y, vert.z);
|
||||
Log::Info("{}, {}, {}", vert.x, vert.y, vert.z);
|
||||
|
||||
EntityInfo info;
|
||||
info.lot = 33;
|
||||
|
||||
@@ -219,7 +219,7 @@ void PropertyEntranceComponent::OnPropertyEntranceSync(Entity* entity, bool incl
|
||||
delete nameLookup;
|
||||
nameLookup = nullptr;
|
||||
|
||||
LOG("Failed to find property owner name for %llu!", cloneId);
|
||||
Log::Warn("Failed to find property owner name for {}!", cloneId);
|
||||
|
||||
continue;
|
||||
} else {
|
||||
|
||||
@@ -114,7 +114,7 @@ std::vector<NiPoint3> PropertyManagementComponent::GetPaths() const {
|
||||
|
||||
points.push_back(value);
|
||||
} catch (std::invalid_argument& exception) {
|
||||
LOG("Failed to parse value (%s): (%s)!", token.c_str(), exception.what());
|
||||
Log::Warn("Failed to parse value ({:s}): ({:s})!", token, exception.what());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ void PropertyManagementComponent::OnFinishBuilding() {
|
||||
}
|
||||
|
||||
void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const NiPoint3 position, NiQuaternion rotation) {
|
||||
LOG("Placing model <%f, %f, %f>", position.x, position.y, position.z);
|
||||
Log::Info("Placing model <{}, {}, {}>", position.x, position.y, position.z);
|
||||
|
||||
auto* entity = GetOwner();
|
||||
|
||||
@@ -283,7 +283,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
|
||||
auto* item = inventoryComponent->FindItemById(id);
|
||||
|
||||
if (item == nullptr) {
|
||||
LOG("Failed to find item with id %d", id);
|
||||
Log::Warn("Failed to find item with id {}", id);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -381,7 +381,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
|
||||
}
|
||||
|
||||
void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int deleteReason) {
|
||||
LOG("Delete model: (%llu) (%i)", id, deleteReason);
|
||||
Log::Info("Delete model: ({}) ({})", id, deleteReason);
|
||||
|
||||
auto* entity = GetOwner();
|
||||
|
||||
@@ -398,13 +398,13 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
|
||||
auto* model = Game::entityManager->GetEntity(id);
|
||||
|
||||
if (model == nullptr) {
|
||||
LOG("Failed to find model entity");
|
||||
Log::Warn("Failed to find model entity");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (model->GetLOT() == 14 && deleteReason == 0) {
|
||||
LOG("User is trying to pick up a BBB model, but this is not implemented, so we return to prevent the user from losing the model");
|
||||
Log::Info("User is trying to pick up a BBB model, but this is not implemented, so we return to prevent the user from losing the model");
|
||||
|
||||
GameMessages::SendUGCEquipPostDeleteBasedOnEditMode(entity->GetObjectID(), entity->GetSystemAddress(), LWOOBJID_EMPTY, 0);
|
||||
|
||||
@@ -417,7 +417,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
|
||||
const auto index = models.find(id);
|
||||
|
||||
if (index == models.end()) {
|
||||
LOG("Failed to find model");
|
||||
Log::Warn("Failed to find model");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -429,12 +429,12 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
|
||||
models.erase(id);
|
||||
|
||||
if (spawner == nullptr) {
|
||||
LOG("Failed to find spawner");
|
||||
Log::Warn("Failed to find spawner");
|
||||
}
|
||||
|
||||
Game::entityManager->DestructEntity(model);
|
||||
|
||||
LOG("Deleting model LOT %i", model->GetLOT());
|
||||
Log::Info("Deleting model LOT {}", model->GetLOT());
|
||||
|
||||
if (model->GetLOT() == 14) {
|
||||
//add it to the inv
|
||||
@@ -517,13 +517,13 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
|
||||
{
|
||||
item->SetCount(item->GetCount() - 1);
|
||||
|
||||
LOG("DLU currently does not support breaking apart brick by brick models.");
|
||||
Log::Info("DLU currently does not support breaking apart brick by brick models.");
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
LOG("Invalid delete reason");
|
||||
Log::Warn("Invalid delete reason");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ void PropertyManagementComponent::OnQueryPropertyData(Entity* originator, const
|
||||
const auto zoneId = worldId.GetMapID();
|
||||
const auto cloneId = worldId.GetCloneID();
|
||||
|
||||
LOG("Getting property info for %d", zoneId);
|
||||
Log::Info("Getting property info for {}", zoneId);
|
||||
GameMessages::PropertyDataMessage message = GameMessages::PropertyDataMessage(zoneId);
|
||||
|
||||
const auto isClaimed = GetOwnerId() != LWOOBJID_EMPTY;
|
||||
|
||||
@@ -19,7 +19,7 @@ void PropertyVendorComponent::OnUse(Entity* originator) {
|
||||
OnQueryPropertyData(originator, originator->GetSystemAddress());
|
||||
|
||||
if (PropertyManagementComponent::Instance()->GetOwnerId() == LWOOBJID_EMPTY) {
|
||||
LOG("Property vendor opening!");
|
||||
Log::Info("Property vendor opening!");
|
||||
|
||||
GameMessages::SendOpenPropertyVendor(m_Parent->GetObjectID(), originator->GetSystemAddress());
|
||||
|
||||
@@ -37,7 +37,7 @@ void PropertyVendorComponent::OnBuyFromVendor(Entity* originator, const bool con
|
||||
if (PropertyManagementComponent::Instance() == nullptr) return;
|
||||
|
||||
if (PropertyManagementComponent::Instance()->Claim(originator->GetObjectID()) == false) {
|
||||
LOG("FAILED TO CLAIM PROPERTY. PLAYER ID IS %llu", originator->GetObjectID());
|
||||
Log::Warn("FAILED TO CLAIM PROPERTY. PLAYER ID IS {}", originator->GetObjectID());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,6 +51,5 @@ void PropertyVendorComponent::OnBuyFromVendor(Entity* originator, const bool con
|
||||
|
||||
PropertyManagementComponent::Instance()->OnQueryPropertyData(originator, originator->GetSystemAddress());
|
||||
|
||||
LOG("Fired event; (%d) (%i) (%i)", confirmed, lot, count);
|
||||
Log::Info("Fired event; ({}) ({}) ({})", confirmed, lot, count);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ QuickBuildComponent::QuickBuildComponent(Entity* const entity) : Component{ enti
|
||||
if (positionAsVector.size() == 3 && activatorPositionValid) {
|
||||
m_ActivatorPosition = activatorPositionValid.value();
|
||||
} else {
|
||||
LOG("Failed to find activator position for lot %i. Defaulting to parents position.", m_Parent->GetLOT());
|
||||
Log::Info("Failed to find activator position for lot {}. Defaulting to parent's position.", m_Parent->GetLOT());
|
||||
m_ActivatorPosition = m_Parent->GetPosition();
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ void QuickBuildComponent::CompleteQuickBuild(Entity* const user) {
|
||||
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
||||
characterComponent->TrackQuickBuildComplete();
|
||||
} else {
|
||||
LOG("Some user tried to finish the rebuild but they didn't have a character somehow.");
|
||||
Log::Warn("Some user tried to finish the rebuild but they didn't have a character somehow.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ void RacingControlComponent::OnPlayerLoaded(Entity* player) {
|
||||
|
||||
m_LoadedPlayers++;
|
||||
|
||||
LOG("Loading player %i",
|
||||
Log::Info("Loading player {}",
|
||||
m_LoadedPlayers);
|
||||
m_LobbyPlayers.push_back(player->GetObjectID());
|
||||
}
|
||||
@@ -101,7 +101,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
||||
auto* item = inventoryComponent->FindItemByLot(8092);
|
||||
|
||||
if (item == nullptr) {
|
||||
LOG("Failed to find item");
|
||||
Log::Warn("Failed to find item");
|
||||
auto* characterComponent = player->GetComponent<CharacterComponent>();
|
||||
|
||||
if (characterComponent) {
|
||||
@@ -570,10 +570,10 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
// From the first 2 players loading in the rest have a max of 15 seconds
|
||||
// to load in, can raise this if it's too low
|
||||
if (m_LoadTimer >= 15) {
|
||||
LOG("Loading all players...");
|
||||
Log::Info("Loading all players...");
|
||||
|
||||
for (size_t positionNumber = 0; positionNumber < m_LobbyPlayers.size(); positionNumber++) {
|
||||
LOG("Loading player now!");
|
||||
Log::Info("Loading player now!");
|
||||
|
||||
auto* player =
|
||||
Game::entityManager->GetEntity(m_LobbyPlayers[positionNumber]);
|
||||
@@ -582,7 +582,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG("Loading player now NOW!");
|
||||
Log::Info("Loading player now NOW!");
|
||||
|
||||
LoadPlayerVehicle(player, positionNumber + 1, true);
|
||||
|
||||
@@ -732,7 +732,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
|
||||
m_Started = true;
|
||||
|
||||
LOG("Starting race");
|
||||
Log::Info("Starting race");
|
||||
|
||||
Game::entityManager->SerializeEntity(m_Parent);
|
||||
|
||||
@@ -837,7 +837,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
if (player.bestLapTime == 0 || player.bestLapTime > lapTime) {
|
||||
player.bestLapTime = lapTime;
|
||||
|
||||
LOG("Best lap time (%llu)", lapTime);
|
||||
Log::Info("Best lap time ({})", lapTime);
|
||||
}
|
||||
|
||||
auto* missionComponent =
|
||||
@@ -857,7 +857,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
|
||||
player.raceTime = raceTime;
|
||||
|
||||
LOG("Completed time %llu, %llu",
|
||||
Log::Info("Completed time {}, {}",
|
||||
raceTime, raceTime * 1000);
|
||||
|
||||
LeaderboardManager::SaveScore(playerEntity->GetObjectID(), m_ActivityID, static_cast<float>(player.raceTime), static_cast<float>(player.bestLapTime), static_cast<float>(player.finished == 1));
|
||||
@@ -871,11 +871,11 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
}
|
||||
}
|
||||
|
||||
LOG("Lapped (%i) in (%llu)", player.lap,
|
||||
Log::Info("Lapped ({}) in ({})", player.lap,
|
||||
lapTime);
|
||||
}
|
||||
|
||||
LOG("Reached point (%i)/(%i)", player.respawnIndex,
|
||||
Log::Info("Reached point ({})/({})", player.respawnIndex,
|
||||
path->pathWaypoints.size());
|
||||
|
||||
break;
|
||||
|
||||
@@ -33,7 +33,7 @@ RenderComponent::RenderComponent(Entity* const parentEntity, const int32_t compo
|
||||
const auto groupIdInt = GeneralUtils::TryParse<int32_t>(groupId);
|
||||
|
||||
if (!groupIdInt) {
|
||||
LOG("bad animation group Id %s", groupId.c_str());
|
||||
Log::Warn("bad animation group Id {:s}", groupId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -176,6 +176,6 @@ float RenderComponent::DoAnimation(Entity* self, const std::string& animation, b
|
||||
}
|
||||
}
|
||||
if (sendAnimation) GameMessages::SendPlayAnimation(self, GeneralUtils::ASCIIToUTF16(animation), priority, scale);
|
||||
if (returnlength == 0.0f) LOG("WARNING: Unable to find animation %s for lot %i in any group.", animation.c_str(), self->GetLOT());
|
||||
if (returnlength == 0.0f) Log::Warn("Unable to find animation {} for lot {} in any group.", animation, self->GetLOT());
|
||||
return returnlength;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void RocketLaunchpadControlComponent::Launch(Entity* originator, LWOMAPID mapId,
|
||||
|
||||
auto* rocket = characterComponent->GetRocket(originator);
|
||||
if (!rocket) {
|
||||
LOG("Unable to find rocket!");
|
||||
Log::Warn("Unable to find rocket!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ void SkillComponent::SyncPlayerSkill(const uint32_t skillUid, const uint32_t syn
|
||||
const auto index = this->m_managedBehaviors.find(skillUid);
|
||||
|
||||
if (index == this->m_managedBehaviors.end()) {
|
||||
LOG("Failed to find skill with uid (%i)!", skillUid, syncId);
|
||||
Log::Warn("Failed to find skill with uid ({})!", skillUid, syncId);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ void SkillComponent::SyncPlayerProjectile(const LWOOBJID projectileId, RakNet::B
|
||||
}
|
||||
|
||||
if (index == -1) {
|
||||
LOG("Failed to find projectile id (%llu)!", projectileId);
|
||||
Log::Warn("Failed to find projectile id ({})!", projectileId);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ void SkillComponent::SyncPlayerProjectile(const LWOOBJID projectileId, RakNet::B
|
||||
auto result = query.execQuery();
|
||||
|
||||
if (result.eof()) {
|
||||
LOG("Failed to find skill id for (%i)!", sync_entry.lot);
|
||||
Log::Warn("Failed to find skill id for ({})!", sync_entry.lot);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -396,7 +396,7 @@ void SkillComponent::SyncProjectileCalculation(const ProjectileSyncEntry& entry)
|
||||
|
||||
if (other == nullptr) {
|
||||
if (entry.branchContext.target != LWOOBJID_EMPTY) {
|
||||
LOG("Invalid projectile target (%llu)!", entry.branchContext.target);
|
||||
Log::Warn("Invalid projectile target ({})!", entry.branchContext.target);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -408,7 +408,7 @@ void SkillComponent::SyncProjectileCalculation(const ProjectileSyncEntry& entry)
|
||||
auto result = query.execQuery();
|
||||
|
||||
if (result.eof()) {
|
||||
LOG("Failed to find skill id for (%i)!", entry.lot);
|
||||
Log::Warn("Failed to find skill id for ({})!", entry.lot);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ void TriggerComponent::HandleTriggerCommand(LUTriggers::Command* command, Entity
|
||||
case eTriggerCommandType::DEACTIVATE_MIXER_PROGRAM: break;
|
||||
// DEPRECATED BLOCK END
|
||||
default:
|
||||
LOG_DEBUG("Event %i was not handled!", command->id);
|
||||
Log::Debug("Event {:d} was not handled!", GeneralUtils::ToUnderlying(command->id));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ void TriggerComponent::HandleDestroyObject(Entity* targetEntity, std::string arg
|
||||
void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string args){
|
||||
auto* triggerComponent = targetEntity->GetComponent<TriggerComponent>();
|
||||
if (!triggerComponent) {
|
||||
LOG_DEBUG("Trigger component not found!");
|
||||
Log::Debug("Trigger component not found!");
|
||||
return;
|
||||
}
|
||||
triggerComponent->SetTriggerEnabled(args == "1");
|
||||
@@ -203,7 +203,7 @@ void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string arg
|
||||
void TriggerComponent::HandleResetRebuild(Entity* targetEntity, std::string args){
|
||||
auto* quickBuildComponent = targetEntity->GetComponent<QuickBuildComponent>();
|
||||
if (!quickBuildComponent) {
|
||||
LOG_DEBUG("Rebuild component not found!");
|
||||
Log::Debug("Rebuild component not found!");
|
||||
return;
|
||||
}
|
||||
quickBuildComponent->ResetQuickBuild(args == "1");
|
||||
@@ -233,7 +233,7 @@ void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::s
|
||||
|
||||
auto* phantomPhysicsComponent = m_Parent->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
LOG_DEBUG("Phantom Physics component not found!");
|
||||
Log::Debug("Phantom Physics component not found!");
|
||||
return;
|
||||
}
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
||||
@@ -249,7 +249,7 @@ void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::s
|
||||
void TriggerComponent::HandleRepelObject(Entity* targetEntity, std::string args){
|
||||
auto* phantomPhysicsComponent = m_Parent->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
LOG_DEBUG("Phantom Physics component not found!");
|
||||
Log::Debug("Phantom Physics component not found!");
|
||||
return;
|
||||
}
|
||||
const float forceMultiplier = GeneralUtils::TryParse<float>(args).value_or(1.0f);
|
||||
@@ -272,7 +272,7 @@ void TriggerComponent::HandleRepelObject(Entity* targetEntity, std::string args)
|
||||
|
||||
void TriggerComponent::HandleSetTimer(Entity* targetEntity, std::vector<std::string> argArray){
|
||||
if (argArray.size() != 2) {
|
||||
LOG_DEBUG("Not enough variables!");
|
||||
Log::Debug("Not enough variables!");
|
||||
return;
|
||||
}
|
||||
const float time = GeneralUtils::TryParse<float>(argArray.at(1)).value_or(0.0f);
|
||||
@@ -312,7 +312,7 @@ void TriggerComponent::HandlePlayCinematic(Entity* targetEntity, std::vector<std
|
||||
void TriggerComponent::HandleToggleBBB(Entity* targetEntity, std::string args) {
|
||||
auto* character = targetEntity->GetCharacter();
|
||||
if (!character) {
|
||||
LOG_DEBUG("Character was not found!");
|
||||
Log::Debug("Character was not found!");
|
||||
return;
|
||||
}
|
||||
bool buildMode = !(character->GetBuildMode());
|
||||
@@ -328,7 +328,7 @@ void TriggerComponent::HandleUpdateMission(Entity* targetEntity, std::vector<std
|
||||
if (argArray.at(0) != "exploretask") return;
|
||||
MissionComponent* missionComponent = targetEntity->GetComponent<MissionComponent>();
|
||||
if (!missionComponent){
|
||||
LOG_DEBUG("Mission component not found!");
|
||||
Log::Debug("Mission component not found!");
|
||||
return;
|
||||
}
|
||||
missionComponent->Progress(eMissionTaskType::EXPLORE, 0, 0, argArray.at(4));
|
||||
@@ -351,7 +351,7 @@ void TriggerComponent::HandlePlayEffect(Entity* targetEntity, std::vector<std::s
|
||||
void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
|
||||
auto* skillComponent = targetEntity->GetComponent<SkillComponent>();
|
||||
if (!skillComponent) {
|
||||
LOG_DEBUG("Skill component not found!");
|
||||
Log::Debug("Skill component not found!");
|
||||
return;
|
||||
}
|
||||
const uint32_t skillId = GeneralUtils::TryParse<uint32_t>(args).value_or(0);
|
||||
@@ -361,7 +361,7 @@ void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
|
||||
void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::vector<std::string> argArray) {
|
||||
auto* phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
LOG_DEBUG("Phantom Physics component not found!");
|
||||
Log::Debug("Phantom Physics component not found!");
|
||||
return;
|
||||
}
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
||||
@@ -395,7 +395,7 @@ void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::v
|
||||
void TriggerComponent::HandleSetPhysicsVolumeStatus(Entity* targetEntity, std::string args) {
|
||||
auto* phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
LOG_DEBUG("Phantom Physics component not found!");
|
||||
Log::Debug("Phantom Physics component not found!");
|
||||
return;
|
||||
}
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(args == "On");
|
||||
@@ -432,6 +432,6 @@ void TriggerComponent::HandleActivatePhysics(Entity* targetEntity, std::string a
|
||||
} else if (args == "false"){
|
||||
// TODO remove Phsyics entity if there is one
|
||||
} else {
|
||||
LOG_DEBUG("Invalid argument for ActivatePhysics Trigger: %s", args.c_str());
|
||||
Log::Debug("Invalid argument for ActivatePhysics Trigger: {:s}", args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ bool VendorComponent::SetupItem(LOT item) {
|
||||
|
||||
auto itemComponentID = compRegistryTable->GetByIDAndType(item, eReplicaComponentType::ITEM, -1);
|
||||
if (itemComponentID == -1) {
|
||||
LOG("Attempted to add item %i with ItemComponent ID -1 to vendor %i inventory. Not adding item!", itemComponentID, m_Parent->GetLOT());
|
||||
Log::Warn("Attempted to add item {} with ItemComponent ID -1 to vendor {} inventory. Not adding item!", itemComponentID, m_Parent->GetLOT());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,11 +49,11 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
User* usr = UserManager::Instance()->GetUser(sysAddr);
|
||||
|
||||
if (!entity) {
|
||||
LOG("Failed to find associated entity (%llu), aborting GM: %4i, %s!", objectID, messageID, StringifiedEnum::ToString(messageID).data());
|
||||
Log::Warn("Failed to find associated entity ({:d}), aborting GM: {:4d}, {:s}!", objectID, GeneralUtils::ToUnderlying(messageID), StringifiedEnum::ToString(messageID));
|
||||
return;
|
||||
}
|
||||
|
||||
if (messageID != eGameMessageType::READY_FOR_UPDATES) LOG_DEBUG("Received GM with ID and name: %4i, %s", messageID, StringifiedEnum::ToString(messageID).data());
|
||||
if (messageID != eGameMessageType::READY_FOR_UPDATES) Log::Debug("Received GM with ID and name: {:4d}, {:s}", GeneralUtils::ToUnderlying(messageID), StringifiedEnum::ToString(messageID));
|
||||
|
||||
switch (messageID) {
|
||||
|
||||
@@ -167,7 +167,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
character->OnZoneLoad();
|
||||
}
|
||||
|
||||
LOG("Player %s (%llu) loaded.", entity->GetCharacter()->GetName().c_str(), entity->GetObjectID());
|
||||
Log::Info("Player {:s} ({:d}) loaded.", entity->GetCharacter()->GetName(), entity->GetObjectID());
|
||||
|
||||
// After we've done our thing, tell the client they're ready
|
||||
GameMessages::SendPlayerReady(entity, sysAddr);
|
||||
@@ -686,7 +686,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
||||
GameMessages::SendVendorStatusUpdate(entity, sysAddr, true);
|
||||
break;
|
||||
default:
|
||||
LOG_DEBUG("Received Unknown GM with ID: %4i, %s", messageID, StringifiedEnum::ToString(messageID).data());
|
||||
Log::Info("Received Unknown GM with ID: {:4d}, {:s}", GeneralUtils::ToUnderlying(messageID), StringifiedEnum::ToString(messageID));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1713,7 +1713,7 @@ void GameMessages::HandleActivityStateChangeRequest(RakNet::BitStream& inStream,
|
||||
|
||||
auto* assosiate = Game::entityManager->GetEntity(objectID);
|
||||
|
||||
LOG("%s [%i, %i] from %i to %i", GeneralUtils::UTF16ToWTF8(stringValue).c_str(), value1, value2, entity->GetLOT(), assosiate != nullptr ? assosiate->GetLOT() : 0);
|
||||
Log::Info("{:s} [{:d}, {:d}] from {:d} to {:d}", GeneralUtils::UTF16ToWTF8(stringValue), value1, value2, entity->GetLOT(), assosiate != nullptr ? assosiate->GetLOT() : 0);
|
||||
|
||||
std::vector<Entity*> scriptedActs = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::SHOOTING_GALLERY);
|
||||
for (Entity* scriptEntity : scriptedActs) {
|
||||
@@ -3810,7 +3810,7 @@ void GameMessages::HandleMessageBoxResponse(RakNet::BitStream& inStream, Entity*
|
||||
userData.push_back(character);
|
||||
}
|
||||
|
||||
LOG("Button: %d; LOT: %u identifier: %s; userData: %s", iButton, entity->GetLOT(), GeneralUtils::UTF16ToWTF8(identifier).c_str(), GeneralUtils::UTF16ToWTF8(userData).c_str());
|
||||
Log::Info("Button: {:d}; LOT: {:d} identifier: {:s}; userData: {:s}", iButton, entity->GetLOT(), GeneralUtils::UTF16ToWTF8(identifier), GeneralUtils::UTF16ToWTF8(userData));
|
||||
|
||||
auto* user = UserManager::Instance()->GetUser(sysAddr);
|
||||
|
||||
@@ -3866,7 +3866,7 @@ void GameMessages::HandleChoiceBoxRespond(RakNet::BitStream& inStream, Entity* e
|
||||
identifier.push_back(character);
|
||||
}
|
||||
|
||||
LOG("Button: %d; LOT: %u buttonIdentifier: %s; userData: %s", iButton, entity->GetLOT(), GeneralUtils::UTF16ToWTF8(buttonIdentifier).c_str(), GeneralUtils::UTF16ToWTF8(identifier).c_str());
|
||||
Log::Info("Button: {:d}; LOT: {:d} buttonIdentifier: {:s}; userData: {:s}", iButton, entity->GetLOT(), GeneralUtils::UTF16ToWTF8(buttonIdentifier), GeneralUtils::UTF16ToWTF8(identifier));
|
||||
|
||||
auto* user = UserManager::Instance()->GetUser(sysAddr);
|
||||
|
||||
@@ -4046,10 +4046,10 @@ void GameMessages::HandleAcknowledgePossession(RakNet::BitStream& inStream, Enti
|
||||
void GameMessages::HandleModuleAssemblyQueryData(RakNet::BitStream& inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||
auto* moduleAssemblyComponent = entity->GetComponent<ModuleAssemblyComponent>();
|
||||
|
||||
LOG("Got Query from %i", entity->GetLOT());
|
||||
Log::Info("Got Query from {:d}", entity->GetLOT());
|
||||
|
||||
if (moduleAssemblyComponent != nullptr) {
|
||||
LOG("Returning assembly %s", GeneralUtils::UTF16ToWTF8(moduleAssemblyComponent->GetAssemblyPartsLOTs()).c_str());
|
||||
Log::Info("Returning assembly {:s}", GeneralUtils::UTF16ToWTF8(moduleAssemblyComponent->GetAssemblyPartsLOTs()));
|
||||
|
||||
SendModuleAssemblyDBDataForClient(entity->GetObjectID(), moduleAssemblyComponent->GetSubKey(), moduleAssemblyComponent->GetAssemblyPartsLOTs(), UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
@@ -4872,7 +4872,7 @@ void GameMessages::HandleFireEventServerSide(RakNet::BitStream& inStream, Entity
|
||||
mapId = Game::zoneManager->GetZoneID().GetMapID(); // Fallback to sending the player back to the same zone.
|
||||
}
|
||||
|
||||
LOG("Player %llu has requested zone transfer to (%i, %i).", sender->GetObjectID(), static_cast<int>(mapId), static_cast<int>(cloneId));
|
||||
Log::Info("Player {:d} has requested zone transfer to ({:d}, {:d}).", sender->GetObjectID(), static_cast<int>(mapId), static_cast<int>(cloneId));
|
||||
|
||||
auto* character = player->GetCharacter();
|
||||
|
||||
@@ -4881,7 +4881,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) {
|
||||
LOG("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);
|
||||
Log::Info("Transferring {:s} to Zone {:d} (Instance {:d} | Clone {:d} | Mythran Shift: {:s}) with IP {:s} and Port {:d}", character->GetName(), zoneID, zoneInstance, zoneClone, mythranShift == true ? "true" : "false", serverIP, serverPort);
|
||||
|
||||
if (character) {
|
||||
character->SetZoneID(zoneID);
|
||||
|
||||
@@ -100,7 +100,7 @@ Item::Item(
|
||||
if (isModMoveAndEquip) {
|
||||
Equip();
|
||||
|
||||
LOG("Move and equipped (%i) from (%i)", this->lot, this->inventory->GetType());
|
||||
Log::Info("Move and equipped ({:d}) from ({:d})", this->lot, GeneralUtils::ToUnderlying(this->inventory->GetType()));
|
||||
|
||||
Game::entityManager->SerializeEntity(inventory->GetComponent()->GetParent());
|
||||
}
|
||||
@@ -355,7 +355,7 @@ void Item::UseNonEquip(Item* item) {
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG_DEBUG("Player %llu %s used item %i", playerEntity->GetObjectID(), success ? "successfully" : "unsuccessfully", thisLot);
|
||||
Log::Debug("Player {:d} {:s} used item {:d}", playerEntity->GetObjectID(), success ? "successfully" : "unsuccessfully", thisLot);
|
||||
GameMessages::SendUseItemResult(playerInventoryComponent->GetParent(), thisLot, success);
|
||||
}
|
||||
}
|
||||
@@ -426,7 +426,7 @@ void Item::DisassembleModel(uint32_t numToDismantle) {
|
||||
auto file = Game::assetManager->GetFile(lxfmlPath.c_str());
|
||||
|
||||
if (!file) {
|
||||
LOG("Failed to load %s to disassemble model into bricks, check that this file exists", lxfmlPath.c_str());
|
||||
Log::Warn("Failed to load {:s} to disassemble model into bricks, check that this file exists", lxfmlPath);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ void Item::DisassembleModel(uint32_t numToDismantle) {
|
||||
if (designID) {
|
||||
const auto designId = GeneralUtils::TryParse<uint32_t>(designID);
|
||||
if (!designId) {
|
||||
LOG("Failed to parse designID %s", designID);
|
||||
Log::Warn("Failed to parse designID {:s}", designID);
|
||||
continue;
|
||||
}
|
||||
parts[designId.value()]++;
|
||||
|
||||
@@ -47,7 +47,7 @@ Mission::Mission(MissionComponent* missionComponent, const uint32_t missionId) {
|
||||
info = *mis;
|
||||
|
||||
if (mis == &CDMissionsTable::Default) {
|
||||
LOG("Failed to find mission (%i)!", missionId);
|
||||
Log::Info("Failed to find mission ({:d})!", missionId);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,5 +10,5 @@ AddActionMessage::AddActionMessage(const AMFArrayValue& arguments)
|
||||
|
||||
m_Action = Action{ *actionValue };
|
||||
|
||||
LOG_DEBUG("actionIndex %i stripId %i stateId %i type %s valueParameterName %s valueParameterString %s valueParameterDouble %f m_BehaviorId %i", m_ActionIndex, m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_Action.GetType().c_str(), m_Action.GetValueParameterName().c_str(), m_Action.GetValueParameterString().c_str(), m_Action.GetValueParameterDouble(), m_BehaviorId);
|
||||
Log::Debug("actionIndex {:d} stripId {:d} stateId {:d} type {:s} valueParameterName {:s} valueParameterString {:s} valueParameterDouble {:f} m_BehaviorId {:d}", m_ActionIndex, m_ActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_ActionContext.GetStateId()), m_Action.GetType(), m_Action.GetValueParameterName(), m_Action.GetValueParameterString(), m_Action.GetValueParameterDouble(), m_BehaviorId);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ AddStripMessage::AddStripMessage(const AMFArrayValue& arguments)
|
||||
|
||||
m_ActionsToAdd.emplace_back(*actionValue);
|
||||
|
||||
LOG_DEBUG("xPosition %f yPosition %f stripId %i stateId %i behaviorId %i t %s valueParameterName %s valueParameterString %s valueParameterDouble %f", m_Position.GetX(), m_Position.GetY(), m_ActionContext.GetStripId(), m_ActionContext.GetStateId(), m_BehaviorId, m_ActionsToAdd.back().GetType().c_str(), m_ActionsToAdd.back().GetValueParameterName().c_str(), m_ActionsToAdd.back().GetValueParameterString().c_str(), m_ActionsToAdd.back().GetValueParameterDouble());
|
||||
Log::Debug("xPosition {:f} yPosition {:f} stripId {:d} stateId {:d} behaviorId {:d} t {:s} valueParameterName {:s} valueParameterString {:s} valueParameterDouble {:f}", m_Position.GetX(), m_Position.GetY(), m_ActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_ActionContext.GetStateId()), m_BehaviorId, m_ActionsToAdd.back().GetType(), m_ActionsToAdd.back().GetValueParameterName(), m_ActionsToAdd.back().GetValueParameterString(), m_ActionsToAdd.back().GetValueParameterDouble());
|
||||
}
|
||||
LOG_DEBUG("number of actions %i", m_ActionsToAdd.size());
|
||||
Log::Debug("number of actions {:d}", m_ActionsToAdd.size());
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ MergeStripsMessage::MergeStripsMessage(const AMFArrayValue& arguments)
|
||||
, m_SourceActionContext{ arguments, "srcStateID", "srcStripID" }
|
||||
, m_DestinationActionContext{ arguments, "dstStateID", "dstStripID" } {
|
||||
|
||||
LOG_DEBUG("srcstripId %i dststripId %i srcstateId %i dststateId %i dstactionIndex %i behaviorId %i", m_SourceActionContext.GetStripId(), m_DestinationActionContext.GetStripId(), m_SourceActionContext.GetStateId(), m_DestinationActionContext.GetStateId(), m_DstActionIndex, m_BehaviorId);
|
||||
Log::Debug("srcstripId {:d} dststripId {:d} srcstateId {:d} dststateId {:d} dstactionIndex {:d} behaviorId {:d}", m_SourceActionContext.GetStripId(), m_DestinationActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_SourceActionContext.GetStateId()), GeneralUtils::ToUnderlying(m_DestinationActionContext.GetStateId()), m_DstActionIndex, m_BehaviorId);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,5 +7,5 @@ MigrateActionsMessage::MigrateActionsMessage(const AMFArrayValue& arguments)
|
||||
, m_SourceActionContext{ arguments, "srcStateID", "srcStripID" }
|
||||
, m_DestinationActionContext{ arguments, "dstStateID", "dstStripID" } {
|
||||
|
||||
LOG_DEBUG("srcactionIndex %i dstactionIndex %i srcstripId %i dststripId %i srcstateId %i dststateId %i behaviorId %i", m_SrcActionIndex, m_DstActionIndex, m_SourceActionContext.GetStripId(), m_DestinationActionContext.GetStripId(), m_SourceActionContext.GetStateId(), m_DestinationActionContext.GetStateId(), m_BehaviorId);
|
||||
Log::Debug("srcactionIndex {:d} dstactionIndex {:d} srcstripId {:d} dststripId {:d} srcstateId {:d} dststateId {:d} behaviorId {:d}", m_SrcActionIndex, m_DstActionIndex, m_SourceActionContext.GetStripId(), m_DestinationActionContext.GetStripId(), GeneralUtils::ToUnderlying(m_SourceActionContext.GetStateId()), GeneralUtils::ToUnderlying(m_DestinationActionContext.GetStateId()), m_BehaviorId);
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ RearrangeStripMessage::RearrangeStripMessage(const AMFArrayValue& arguments)
|
||||
, m_DstActionIndex{ GetActionIndexFromArgument(arguments, "dstActionIndex") }
|
||||
, m_ActionContext{ arguments } {
|
||||
|
||||
LOG_DEBUG("srcactionIndex %i dstactionIndex %i stripId %i behaviorId %i stateId %i", m_SrcActionIndex, m_DstActionIndex, m_ActionContext.GetStripId(), m_BehaviorId, m_ActionContext.GetStateId());
|
||||
Log::Debug("srcactionIndex {:d} dstactionIndex {:d} stripId {:d} behaviorId {:d} stateId {:d}", m_SrcActionIndex, m_DstActionIndex, m_ActionContext.GetStripId(), m_BehaviorId, GeneralUtils::ToUnderlying(m_ActionContext.GetStateId()));
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user