Jump to content
Logo
Your Metin2 zone for C++, Python, Lua.

Client Close / Plase game header 81


KlausGames

Recommended Posts

Phase Game Fix - does not handle this header (header: 81, last: 45, 81)

The error occurs randomly, but always with the same header, I followed the steps in the guide in the link above but without success, I tried to update the buf in the function at the end to send the correct size, but without success. I thank the attention.

in questpc.cpp:

 

void PC::SendQuestInfoPakcet()
	{
		assert(m_iSendToClient);
		assert(m_RunningQuestState);

		packet_quest_info qi;

		qi.header = HEADER_GC_QUEST_INFO;
		qi.size = sizeof(struct packet_quest_info);
		qi.index = m_RunningQuestState->iIndex;
		qi.flag = m_iSendToClient;
#ifdef ENABLE_QUEST_CATEGORY
		qi.c_index = CQuestManager::instance().ReadQuestCategoryFile(qi.index);
#endif

		TEMP_BUFFER buf;
		buf.write(&qi, sizeof(qi));

		if (m_iSendToClient & QUEST_SEND_ISBEGIN)
		{
			BYTE temp = m_RunningQuestState->bStart?1:0;
			buf.write(&temp,1);
			qi.size+=1;

			sys_log(1, "QUEST BeginFlag %d", (int)temp);
		}
		if (m_iSendToClient & QUEST_SEND_TITLE)
		{
			m_RunningQuestState->_title.reserve(30+1);
			buf.write(m_RunningQuestState->_title.c_str(), 30+1);
			qi.size+=30+1;

			sys_log(1, "QUEST Title %s", m_RunningQuestState->_title.c_str());
		}
		if (m_iSendToClient & QUEST_SEND_CLOCK_NAME)
		{
			m_RunningQuestState->_clock_name.reserve(16+1);
			buf.write(m_RunningQuestState->_clock_name.c_str(), 16+1);
			qi.size+=16+1;

			sys_log(1, "QUEST Clock Name %s", m_RunningQuestState->_clock_name.c_str());
		}
		if (m_iSendToClient & QUEST_SEND_CLOCK_VALUE)
		{
			buf.write(&m_RunningQuestState->_clock_value, sizeof(int));
			qi.size+=4;

			sys_log(1, "QUEST Clock Value %d", m_RunningQuestState->_clock_value);
		}
		if (m_iSendToClient & QUEST_SEND_COUNTER_NAME)
		{
			m_RunningQuestState->_counter_name.reserve(16+1);
			buf.write(m_RunningQuestState->_counter_name.c_str(), 16+1);
			qi.size+=16+1;

			sys_log(1, "QUEST Counter Name %s", m_RunningQuestState->_counter_name.c_str());
		}
		if (m_iSendToClient & QUEST_SEND_COUNTER_VALUE)
		{
			buf.write(&m_RunningQuestState->_counter_value, sizeof(int));
			qi.size+=4;

			sys_log(1, "QUEST Counter Value %d", m_RunningQuestState->_counter_value);
		}
		if (m_iSendToClient & QUEST_SEND_ICON_FILE)
		{
			m_RunningQuestState->_icon_file.reserve(24+1);
			buf.write(m_RunningQuestState->_icon_file.c_str(), 24+1);
			qi.size+=24+1;

			sys_log(1, "QUEST Icon File %s", m_RunningQuestState->_icon_file.c_str());
		}

		CQuestManager::instance().GetCurrentCharacterPtr()->GetDesc()->Packet(buf.read_peek(),buf.size());

		m_iSendToClient = 0;

	}

 

Link to comment
Guest
This topic is now closed to further replies.
Style Version: 0.1

The code was completely created from scratch and optimized.

The basic style on which it was created: Default

Created by: Grzyb.ovh

The style was to be simple to browse topics, devoid of graphics, uniform in color and definitely simple. ×

×
×
  • Create New...

Important Information

Do you like cookies? 🍪 We use cookies to provide the highest quality of service. Learn more