HP Bar for players
#1

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...



Messages In This Thread
[No subject] - by nicolasg - 07-27-2022, 04:26 PM
[No subject] - by Scura - 07-27-2022, 06:29 PM
[No subject] - by nicolasg - 07-27-2022, 07:19 PM
[No subject] - by Andrein95 - 06-15-2023, 08:42 AM
[No subject] - by nicolasg - 06-15-2023, 09:39 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)