Tipologie server(PvM / PvP):
*Resursă folosită: *Link exclusiv J4M* sursa/quest-renewal-t94367.html
*ServerFiles utilizat:
*Syserr:
questmanager.cpp: In member function 'void quest::CQuestManager::ReadQuestCategoryToDict()':
questmanager.cpp:265: error: template argument 1 is invalid
questmanager.cpp:266: error: 'token' was not declared in this scope
cele 2 linii
boost::tokenizer<boost::escaped_list_separator<char> token(lineFromFile, boost::escaped_list_separator<char>('\\', '\t', '\"'));
vector<string> data(token.begin(), token.end());
Cod: Selectaţi tot
#ifdef __QUEST_RENEWAL__
int CQuestManager::GetQuestCategoryByQuestIndex(WORD q_index)
{
if (QuestCategoryIndexMap.find(q_index) != QuestCategoryIndexMap.end())
return QuestCategoryIndexMap[q_index];
else
return 0; /* DEFAULT_QUEST_CATEGORY */
}
void CQuestManager::ReadQuestCategoryToDict()
{
if (!QuestCategoryIndexMap.empty())
QuestCategoryIndexMap.clear();
ifstream inf((g_stQuestDir + "/questcategory.txt").c_str());
if (!inf.is_open())
{
sys_err( "QUEST Cannot open 'questcategory.txt'");
return;
}
string lineFromFile;
while (getline(inf, lineFromFile))
{
if (lineFromFile.empty())
continue;
#ifdef _QR_MS_
std::stringstream strstr(lineFromFile);
std::istream_iterator<std::string> it(strstr);
std::istream_iterator<std::string> end;
std::vector<std::string> data(it, end);
std::ostream_iterator<std::string> oit(std::cout);
std::copy(data.begin(), data.end(), oit);
#else
boost::tokenizer<boost::escaped_list_separator<char>> token(lineFromFile, boost::escaped_list_separator<char>('\\', '\t', '\"'));
vector<string> data(token.begin(), token.end());
#endif
int category_num = atoi(data[0].c_str());
string quest_name = data[1];
unsigned int quest_index = CQuestManager::instance().GetQuestIndexByName(quest_name);
if (test_server)
sys_log(0, "QUEST_CATEGORY_LINE: %s => %s, %s", lineFromFile.c_str(), data[0].c_str(), quest_name.c_str());
if (quest_index != 0)
QuestCategoryIndexMap[quest_index] = category_num;
else
sys_err("QUEST coult not find QuestIndex for name Quest: %s(%d)", quest_name.c_str(), category_num);
}
}
#endif


