mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-07 04:52:24 +00:00
SaveStance converted to QueryDatabase
This commit is contained in:
parent
14c642a3f7
commit
7d8e128b5f
24
zone/bot.cpp
24
zone/bot.cpp
@ -2802,25 +2802,15 @@ void Bot::LoadStance() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Bot::SaveStance() {
|
void Bot::SaveStance() {
|
||||||
if(_baseBotStance != _botStance) {
|
if(_baseBotStance == _botStance)
|
||||||
std::string errorMessage;
|
return;
|
||||||
char* Query = 0;
|
|
||||||
char TempErrorMessageBuffer[MYSQL_ERRMSG_SIZE];
|
|
||||||
|
|
||||||
if(!database.RunQuery(Query, MakeAnyLenString(&Query, "REPLACE INTO botstances (BotID, StanceId) VALUES(%u, %u);", GetBotID(), GetBotStance()), TempErrorMessageBuffer)) {
|
std::string query = StringFormat("REPLACE INTO botstances (BotID, StanceId) "
|
||||||
errorMessage = std::string(TempErrorMessageBuffer);
|
"VALUES(%u, %u);", GetBotID(), GetBotStance());
|
||||||
safe_delete(Query);
|
auto results = database.QueryDatabase(query);
|
||||||
Query = 0;
|
if(!results.Success())
|
||||||
}
|
LogFile->write(EQEMuLog::Error, "Error in Bot::SaveStance()");
|
||||||
else {
|
|
||||||
safe_delete(Query);
|
|
||||||
Query = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!errorMessage.empty()) {
|
|
||||||
LogFile->write(EQEMuLog::Error, "Error in Bot::SaveStance()");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::LoadTimers() {
|
void Bot::LoadTimers() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user