- case GSV_CHAR_HPMP_INFO: // 1 Each server in the second HP / MP and sends it.
- Recv_gsv_CHAR_HPMP_INFO();
- break;
Look familiar?
Maybe it will when I tell you that GSV_CHAR_HPMP_INFO is defined as 0x07ec
And here is the function that it calls
- ///
- /// @brief Langley MP every second on a server and sent to HP.
- ///
- //----------------------------------------------------------------------------------------------------
- void CRecvPACKET::Recv_gsv_CHAR_HPMP_INFO()
- {
- #ifdef _NoRecover
- if( g_pAVATAR )
- {
- if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurHP > 0)
- {
- if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurHP >= g_pAVATAR->Get_MaxHP())
- g_pAVATAR->Set_HP(g_pAVATAR->Get_MaxHP());
- else
- {
- g_pAVATAR->SetReviseHP( m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurHP - g_pAVATAR->Get_HP());
- }
- }
- if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP > 0)
- {
- if(m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP >= g_pAVATAR->Get_MaxMP())
- g_pAVATAR->Set_MP(g_pAVATAR->Get_MaxMP());
- else
- {
- g_pAVATAR->SetReviseMP( m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP - g_pAVATAR->Get_MP());
- /*
- #ifdef _DEBUG
- char Temp[64];
- sprintf(Temp, "MP levels that must be recovered : %d", m_pRecvPacket->m_gsv_CHAR_HPMP_INFO.m_CurMP - g_pAVATAR->Get_MP());
- g_itMGR.AppendChatMsg(Temp, IT_MGR::CHAT_TYPE_SYSTEM );
- #endif
- */
- }
- }
- }
- #endif
- }
So basically they had the very same idea that i came up with and even wrote the code to handle it.
the server sends an 0x07ec packet once per second..... all the time
The client uses this to fix the HP and MP of your avatar that it displays in the game.
Now why the hell they didn't also take out their own internal calculations is anybodies guess.