Hello community,
Today I have encountered a problem with my server and I would like to ask you about the solution.
Problem:
In the game, if you press the ESC key quickly while any Quest window is open, the server side prints the following SysErr;
SYSERR: Feb 6 02:17:45 :: Select: wrong QUEST_SELECT request! : 10002
void CQuestManager::Select(unsigned int pc, unsigned int selection)
{
PC* pPC;
if ((pPC = GetPC(pc)) && pPC->IsRunning() && pPC->GetRunningQuestState()->suspend_state==SUSPEND_STATE_SELECT)
{
pPC->SetSendDoneFlag();
if (!pPC->GetRunningQuestState()->chat_scripts.empty())
{
// 채팅 이벤트인 경우
// 현재 퀘스트는 어느 퀘스트를 실행할 것인가를 고르는 퀘스트 이므로
// 끝내고 선택된 퀘스트를 실행한다.
QuestState& old_qs = *pPC->GetRunningQuestState();
CloseState(old_qs);
if (selection >= pPC->GetRunningQuestState()->chat_scripts.size())
{
pPC->SetSendDoneFlag();
GotoEndState(old_qs);
pPC->EndRunning();
}
else
{
AArgScript* pas = pPC->GetRunningQuestState()->chat_scripts[selection];
ExecuteQuestScript(*pPC, pas->quest_index, pas->state_index, pas->script.GetCode(), pas->script.GetSize());
}
}
else
{
// on default
pPC->GetRunningQuestState()->args=1;
lua_pushnumber(pPC->GetRunningQuestState()->co,selection+1);
if (!RunState(*pPC->GetRunningQuestState()))
{
CloseState(*pPC->GetRunningQuestState());
pPC->EndRunning();
}
}
}
else
{
sys_err("wrong QUEST_SELECT request! : %d",pc);
}
}