Hello friends, the onlinetime functionality that should get the top when you log in and the time when you log out or when you die doesn't work well. A few characters bug when they exit or save in some way. I've been at this for months and it continues to bug.Can anyone help me?
C++:
void IOLoginData::updateOnlineTime(Player* player, std::ostringstream& query)
{
if (!player || player->isOffline()) {
return;
}
time_t currentTime = time(nullptr);
uint32_t onlineMinutes = static_cast<uint32_t>((currentTime - player->lastLoginSaved) / 60);
query << "`onlinetime` = `onlinetime` + " << onlineMinutes << ',';
// removido para testes
//player->lastLoginSaved = currentTime;
}