Skip to content

Commit

Permalink
Alt login: Linux build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikely4r committed Dec 5, 2024
1 parent 39fe8d7 commit b8286f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ target_link_libraries(${LIBRARY_NAME}
PRIVATE shared
PRIVATE Detour
PRIVATE g3dlite
PRIVATE zlib
)

target_include_directories(${LIBRARY_NAME}
Expand Down
15 changes: 8 additions & 7 deletions playerbot/PlayerbotLoginMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ void PlayerBotLoginMgr::LoadBotsFromDb()
loginMutex.lock();
botPool.clear();
std::set<uint32> accounts;
auto result = LoginDatabase.PQuery("SELECT id FROM account where UPPER(username) like UPPER('%s')", sPlayerbotAIConfig.randomBotAccountPrefix + "%");
std::string prefixString = sPlayerbotAIConfig.randomBotAccountPrefix + "%";
auto result = LoginDatabase.PQuery("SELECT id FROM account where UPPER(username) like UPPER('%s')", prefixString.c_str());
if (!result)
{
loginMutex.unlock();
Expand All @@ -348,7 +349,7 @@ void PlayerBotLoginMgr::LoadBotsFromDb()
accounts.insert(accountId);
} while (result->NextRow());

sLog.outDebug("PlayerbotLoginMgr: %d accounts found.", accounts.size());
sLog.outDebug("PlayerbotLoginMgr: %d accounts found.", uint32(accounts.size()));

result = CharacterDatabase.PQuery("SELECT account, guid, race, class, level, totaltime, map, position_x, position_y, position_z, orientation FROM characters");

Expand All @@ -369,7 +370,7 @@ void PlayerBotLoginMgr::LoadBotsFromDb()
botPool.insert(std::make_pair(guid, PlayerBotInfo(account, guid, race, cls, level, isNew, position)));;
} while (result->NextRow());

sLog.outDebug("PlayerbotLoginMgr: %d bots found.", botPool.size());
sLog.outDebug("PlayerbotLoginMgr: %d bots found.", uint32(botPool.size()));

loginMutex.unlock();

Expand Down Expand Up @@ -468,7 +469,7 @@ void PlayerBotLoginMgr::ShowSpace()
int32 currentOnline = GetMaxOnlineBotCount() - onlineSpace.totalSpace;
int32 currentOffline = GetMaxOnlineBotCount() - offlineSpace.totalSpace;

sLog.outError("Bots online %d/%d (%d generated). Log in:%d out:%d", currentOnline, GetMaxOnlineBotCount(), currentOffline, loginQueue.size(), logoutQueue.size());
sLog.outError("Bots online %d/%d (%d generated). Log in:%d out:%d", currentOnline, GetMaxOnlineBotCount(), currentOffline, uint32(loginQueue.size()), uint32(logoutQueue.size()));

if (onlineSpace.totalSpace < 0)
sLog.outError("Too many bots online (%d/%d).", currentOnline, GetMaxOnlineBotCount());
Expand Down Expand Up @@ -498,13 +499,13 @@ void PlayerBotLoginMgr::ShowSpace()
if (onlineSpace.classRaceBucket[cls][race] < 0)
{
int32 current = GetClassRaceBucketSize(cls, race) - onlineSpace.classRaceBucket[cls][race];
sLog.outError("Too many %s %s bots online (%d/%d).", ChatHelper::formatRace(race), ChatHelper::formatClass(race), current, GetClassRaceBucketSize(cls, race));
sLog.outError("Too many %s %s bots online (%d/%d).", ChatHelper::formatRace(race).c_str(), ChatHelper::formatClass(race).c_str(), current, GetClassRaceBucketSize(cls, race));
}

if (offlineSpace.classRaceBucket[cls][race] > 0)
{
int32 current = GetClassRaceBucketSize(cls, race) - offlineSpace.classRaceBucket[cls][race];
sLog.outError("Too few %s %s bots generated (%d/%d).", ChatHelper::formatRace(race), ChatHelper::formatClass(race), current, GetClassRaceBucketSize(cls, race));
sLog.outError("Too few %s %s bots generated (%d/%d).", ChatHelper::formatRace(race).c_str(), ChatHelper::formatClass(race).c_str(), current, GetClassRaceBucketSize(cls, race));
}
}
}
Expand Down Expand Up @@ -595,7 +596,7 @@ void PlayerBotLoginMgr::FillLoginLogoutQueue()
for (auto& login : logins)
loginQueue.push(login);

sLog.outDebug("PlayerbotLoginMgr: Queued to log in: %d, out: %d", loginQueue.size(), logoutQueue.size());
sLog.outDebug("PlayerbotLoginMgr: Queued to log in: %d, out: %d", uint32(loginQueue.size()), uint32(logoutQueue.size()));
}

void PlayerBotLoginMgr::LogoutBots(uint32 maxLogouts)
Expand Down

0 comments on commit b8286f9

Please sign in to comment.