get better warning/error output on character creation failures

This commit is contained in:
DarthArgus
2016-12-29 04:28:37 +00:00
parent b8280bad64
commit af37f5b847
2 changed files with 10 additions and 5 deletions
@@ -46,10 +46,14 @@ bool CreateCharacterCustomPersistStep::beforePersist(DB::Session *session)
bool CreateCharacterCustomPersistStep::afterPersist(DB::Session *session)
{
// std::string characterName = Unicode::wideToNarrow(DatabaseProcess::getInstance().getNameByStationId(m_stationId));
DBQuery::AddCharacter qry(m_stationId,m_characterObject, m_characterName, m_normalizedName);
if (! (session->exec(&qry)))
if (! (session->exec(&qry))) {
std::string characterName(Unicode::wideToNarrow(m_characterName));
WARNING(true, ("CreateCharacterCustomPersistStep: Failed saving character and character object for %s", characterName.c_str()));
return false;
}
qry.done();
return true;
}
@@ -993,9 +993,10 @@ void Persister::addCharacter(uint32 stationId, const NetworkId &characterObject,
m_pendingCharacters[characterObject]=temp;
//TODO: remove this hack: match up create and end messages because we can't count on having all the data at a frame bounday
auto i=m_newCharacterLock.find(creationGameServer);
UNREF(i);
DEBUG_FATAL(i!=m_newCharacterLock.end(),("Programmer bug: got an addCharacter from server %i before we received EndBaselines from the previous addCharacter. Indicates we're getting network messages out of order.\n",creationGameServer));
if (m_newCharacterLock.find(creationGameServer) != m_newCharacterLock.end()) {
WARNING(true,("Programmer bug: got an addCharacter from server %i before we received EndBaselines from the previous addCharacter. Indicates we're getting network messages out of order.\n",creationGameServer));
}
m_newCharacterLock.insert(creationGameServer);
}