07-27-2022, 04:26 PM
I am creating the code to implement a life bar above the characters. My question is: Does anyone know if the server constantly send the life values of the other characters?
On the server side I found:
if(ch->IsSearchLife() == true)
{
if(ch->m_targetPC != NULL && ch->m_targetPC->m_type != MSG_CHAR_UNKNOWN)
{
CPC* targetPC = ch->m_targetPC;
CNetMsg::SP rmsg(new CNetMsg);
UpdateClient::CharHpInfoMsg(rmsg, targetPC->m_index, targetPC->m_maxHP, targetPC->m_hp);
SEND_Q(rmsg, ch->m_desc);
}
}
I know that the server sends the values if a target is selected and you have the life searcher activated, but apart from that, the server sends the values constantly or only if the client requests them?
--UPDATE--
I came to the conclusion that the server only sends hp values in 3 cases, If the life searcher object is activated, If a player attacks another Or if a player enters the render range of another player(AppearMsg), so Showing these values would imply sending packets constantly and possibly consuming considerable bandwidth...

