mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-27 13:55:55 +00:00
[HOT FIX] MS build issues regarding folder / command lenght usage or rc.exe (#2038)
This commit is contained in:
48
src/Db/PlayerbotDungeonRepository.cpp
Normal file
48
src/Db/PlayerbotDungeonRepository.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "PlayerbotDungeonRepository.h"
|
||||
|
||||
#include "Playerbots.h"
|
||||
|
||||
std::vector<DungeonSuggestion> const PlayerbotDungeonRepository::GetDungeonSuggestions()
|
||||
{
|
||||
return m_dungeonSuggestions;
|
||||
}
|
||||
|
||||
void PlayerbotDungeonRepository::LoadDungeonSuggestions()
|
||||
{
|
||||
LOG_INFO("server.loading", "Loading playerbots dungeon suggestions...");
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
uint32 count = 0;
|
||||
auto statement = PlayerbotsDatabase.GetPreparedStatement(PLAYERBOTS_SEL_DUNGEON_SUGGESTION);
|
||||
uint8 const expansion = sWorld->getIntConfig(CONFIG_EXPANSION);
|
||||
statement->SetData(0, expansion);
|
||||
|
||||
PreparedQueryResult result = PlayerbotsDatabase.Query(statement);
|
||||
if (result)
|
||||
{
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
std::string const name = fields[0].Get<std::string>();
|
||||
uint8 const difficulty = fields[1].Get<uint8>();
|
||||
uint8 const min_level = fields[2].Get<uint8>();
|
||||
uint8 const max_level = fields[3].Get<uint8>();
|
||||
std::string const abbrevation = fields[4].Get<std::string>();
|
||||
std::string const strategy = fields[5].Get<std::string>();
|
||||
|
||||
DungeonSuggestion const row = {
|
||||
name, static_cast<Difficulty>(difficulty), min_level, max_level, abbrevation, strategy};
|
||||
|
||||
m_dungeonSuggestions.push_back(row);
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
}
|
||||
|
||||
LOG_INFO("server.loading", "{} playerbots dungeon suggestions loaded in {} ms", count,
|
||||
GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
Reference in New Issue
Block a user