game: fix post-restart mall open flow
This commit is contained in:
@@ -5698,8 +5698,9 @@ void CHARACTER::ReqSafeboxLoad(const char* pszPassword)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int iPulse = thecore_pulse();
|
int iPulse = thecore_pulse();
|
||||||
|
const int last_safebox_load_time = GetSafeboxLoadTime();
|
||||||
|
|
||||||
if (iPulse - GetSafeboxLoadTime() < PASSES_PER_SEC(10))
|
if (last_safebox_load_time > 0 && iPulse - last_safebox_load_time < PASSES_PER_SEC(10))
|
||||||
{
|
{
|
||||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<창고> 창고를 닫은지 10초 안에는 열 수 없습니다."));
|
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<창고> 창고를 닫은지 10초 안에는 열 수 없습니다."));
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -938,6 +938,7 @@ ACMD(do_mall_password)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int iPulse = thecore_pulse();
|
int iPulse = thecore_pulse();
|
||||||
|
const int last_mall_load_time = ch->GetMallLoadTime();
|
||||||
|
|
||||||
if (ch->GetMall())
|
if (ch->GetMall())
|
||||||
{
|
{
|
||||||
@@ -945,7 +946,7 @@ ACMD(do_mall_password)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iPulse - ch->GetMallLoadTime() < passes_per_sec * 10) // 10초에 한번만 요청 가능
|
if (last_mall_load_time > 0 && iPulse - last_mall_load_time < passes_per_sec * 10) // 10초에 한번만 요청 가능
|
||||||
{
|
{
|
||||||
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<창고> 창고를 닫은지 10초 안에는 열 수 없습니다."));
|
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<창고> 창고를 닫은지 10초 안에는 열 수 없습니다."));
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -235,19 +235,17 @@ namespace quest
|
|||||||
assert(m_RunningQuestState);
|
assert(m_RunningQuestState);
|
||||||
|
|
||||||
packet_quest_info qi;
|
packet_quest_info qi;
|
||||||
|
TEMP_BUFFER payload;
|
||||||
|
|
||||||
qi.header = GC::QUEST_INFO;
|
qi.header = GC::QUEST_INFO;
|
||||||
qi.length = sizeof(struct packet_quest_info);
|
qi.length = sizeof(struct packet_quest_info);
|
||||||
qi.index = m_RunningQuestState->iIndex;
|
qi.index = m_RunningQuestState->iIndex;
|
||||||
qi.flag = m_iSendToClient;
|
qi.flag = m_iSendToClient;
|
||||||
|
|
||||||
TEMP_BUFFER buf;
|
|
||||||
buf.write(&qi, sizeof(qi));
|
|
||||||
|
|
||||||
if (m_iSendToClient & QUEST_SEND_ISBEGIN)
|
if (m_iSendToClient & QUEST_SEND_ISBEGIN)
|
||||||
{
|
{
|
||||||
BYTE temp = m_RunningQuestState->bStart?1:0;
|
BYTE temp = m_RunningQuestState->bStart?1:0;
|
||||||
buf.write(&temp,1);
|
payload.write(&temp,1);
|
||||||
qi.length+=1;
|
qi.length+=1;
|
||||||
|
|
||||||
sys_log(1, "QUEST BeginFlag %d", (int)temp);
|
sys_log(1, "QUEST BeginFlag %d", (int)temp);
|
||||||
@@ -255,7 +253,7 @@ namespace quest
|
|||||||
if (m_iSendToClient & QUEST_SEND_TITLE)
|
if (m_iSendToClient & QUEST_SEND_TITLE)
|
||||||
{
|
{
|
||||||
m_RunningQuestState->_title.reserve(30+1);
|
m_RunningQuestState->_title.reserve(30+1);
|
||||||
buf.write(m_RunningQuestState->_title.c_str(), 30+1);
|
payload.write(m_RunningQuestState->_title.c_str(), 30+1);
|
||||||
qi.length+=30+1;
|
qi.length+=30+1;
|
||||||
|
|
||||||
sys_log(1, "QUEST Title %s", m_RunningQuestState->_title.c_str());
|
sys_log(1, "QUEST Title %s", m_RunningQuestState->_title.c_str());
|
||||||
@@ -263,14 +261,14 @@ namespace quest
|
|||||||
if (m_iSendToClient & QUEST_SEND_CLOCK_NAME)
|
if (m_iSendToClient & QUEST_SEND_CLOCK_NAME)
|
||||||
{
|
{
|
||||||
m_RunningQuestState->_clock_name.reserve(16+1);
|
m_RunningQuestState->_clock_name.reserve(16+1);
|
||||||
buf.write(m_RunningQuestState->_clock_name.c_str(), 16+1);
|
payload.write(m_RunningQuestState->_clock_name.c_str(), 16+1);
|
||||||
qi.length+=16+1;
|
qi.length+=16+1;
|
||||||
|
|
||||||
sys_log(1, "QUEST Clock Name %s", m_RunningQuestState->_clock_name.c_str());
|
sys_log(1, "QUEST Clock Name %s", m_RunningQuestState->_clock_name.c_str());
|
||||||
}
|
}
|
||||||
if (m_iSendToClient & QUEST_SEND_CLOCK_VALUE)
|
if (m_iSendToClient & QUEST_SEND_CLOCK_VALUE)
|
||||||
{
|
{
|
||||||
buf.write(&m_RunningQuestState->_clock_value, sizeof(int));
|
payload.write(&m_RunningQuestState->_clock_value, sizeof(int));
|
||||||
qi.length+=4;
|
qi.length+=4;
|
||||||
|
|
||||||
sys_log(1, "QUEST Clock Value %d", m_RunningQuestState->_clock_value);
|
sys_log(1, "QUEST Clock Value %d", m_RunningQuestState->_clock_value);
|
||||||
@@ -278,14 +276,14 @@ namespace quest
|
|||||||
if (m_iSendToClient & QUEST_SEND_COUNTER_NAME)
|
if (m_iSendToClient & QUEST_SEND_COUNTER_NAME)
|
||||||
{
|
{
|
||||||
m_RunningQuestState->_counter_name.reserve(16+1);
|
m_RunningQuestState->_counter_name.reserve(16+1);
|
||||||
buf.write(m_RunningQuestState->_counter_name.c_str(), 16+1);
|
payload.write(m_RunningQuestState->_counter_name.c_str(), 16+1);
|
||||||
qi.length+=16+1;
|
qi.length+=16+1;
|
||||||
|
|
||||||
sys_log(1, "QUEST Counter Name %s", m_RunningQuestState->_counter_name.c_str());
|
sys_log(1, "QUEST Counter Name %s", m_RunningQuestState->_counter_name.c_str());
|
||||||
}
|
}
|
||||||
if (m_iSendToClient & QUEST_SEND_COUNTER_VALUE)
|
if (m_iSendToClient & QUEST_SEND_COUNTER_VALUE)
|
||||||
{
|
{
|
||||||
buf.write(&m_RunningQuestState->_counter_value, sizeof(int));
|
payload.write(&m_RunningQuestState->_counter_value, sizeof(int));
|
||||||
qi.length+=4;
|
qi.length+=4;
|
||||||
|
|
||||||
sys_log(1, "QUEST Counter Value %d", m_RunningQuestState->_counter_value);
|
sys_log(1, "QUEST Counter Value %d", m_RunningQuestState->_counter_value);
|
||||||
@@ -293,12 +291,17 @@ namespace quest
|
|||||||
if (m_iSendToClient & QUEST_SEND_ICON_FILE)
|
if (m_iSendToClient & QUEST_SEND_ICON_FILE)
|
||||||
{
|
{
|
||||||
m_RunningQuestState->_icon_file.reserve(24+1);
|
m_RunningQuestState->_icon_file.reserve(24+1);
|
||||||
buf.write(m_RunningQuestState->_icon_file.c_str(), 24+1);
|
payload.write(m_RunningQuestState->_icon_file.c_str(), 24+1);
|
||||||
qi.length+=24+1;
|
qi.length+=24+1;
|
||||||
|
|
||||||
sys_log(1, "QUEST Icon File %s", m_RunningQuestState->_icon_file.c_str());
|
sys_log(1, "QUEST Icon File %s", m_RunningQuestState->_icon_file.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEMP_BUFFER buf;
|
||||||
|
buf.write(&qi, sizeof(qi));
|
||||||
|
if (payload.size() > 0)
|
||||||
|
buf.write(payload.read_peek(), payload.size());
|
||||||
|
|
||||||
CQuestManager::instance().GetCurrentCharacterPtr()->GetDesc()->Packet(buf.read_peek(),buf.size());
|
CQuestManager::instance().GetCurrentCharacterPtr()->GetDesc()->Packet(buf.read_peek(),buf.size());
|
||||||
|
|
||||||
m_iSendToClient = 0;
|
m_iSendToClient = 0;
|
||||||
@@ -722,4 +725,3 @@ namespace quest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user