Add better logs to saving (#1068)

* Fix overread in projectile behavior

* Fix stuns

* Correctly read in bitStream

* Fix projectile behavior

* Address movement type issues

* Update shutdown time to be accurate

* Fix small issues

* Fix missing template

* Add note for compile jobs

* Add bounds check for speed division

* Add better logs
This commit is contained in:
David Markowitz 2023-05-06 11:32:38 -07:00 committed by GitHub
parent 5479cf4428
commit cffb1449d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -373,7 +373,7 @@ void Character::SaveXMLToDatabase() {
//Call upon the entity to update our xmlDoc: //Call upon the entity to update our xmlDoc:
if (!m_OurEntity) { if (!m_OurEntity) {
Game::logger->Log("Character", "We didn't have an entity set while saving! CHARACTER WILL NOT BE SAVED!"); Game::logger->Log("Character", "%i:%s didn't have an entity set while saving! CHARACTER WILL NOT BE SAVED!", this->GetID(), this->GetName().c_str());
return; return;
} }
@ -384,7 +384,7 @@ void Character::SaveXMLToDatabase() {
//For metrics, log the time it took to save: //For metrics, log the time it took to save:
auto end = std::chrono::system_clock::now(); auto end = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed = end - start; std::chrono::duration<double> elapsed = end - start;
Game::logger->Log("Character", "Saved character to Database in: %fs", elapsed.count()); Game::logger->Log("Character", "%i:%s Saved character to Database in: %fs", this->GetID(), this->GetName().c_str(), elapsed.count());
} }
void Character::SetIsNewLogin() { void Character::SetIsNewLogin() {
@ -396,7 +396,7 @@ void Character::SetIsNewLogin() {
while (currentChild) { while (currentChild) {
if (currentChild->Attribute("si")) { if (currentChild->Attribute("si")) {
flags->DeleteChild(currentChild); flags->DeleteChild(currentChild);
Game::logger->Log("Character", "Removed isLoggedIn flag from character %i, saving character to database", GetID()); Game::logger->Log("Character", "Removed isLoggedIn flag from character %i:%s, saving character to database", GetID(), GetName().c_str());
WriteToDatabase(); WriteToDatabase();
} }
currentChild = currentChild->NextSiblingElement(); currentChild = currentChild->NextSiblingElement();