EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   sending the client PC HP updates... why? (https://www.eqemulator.org/forums/showthread.php?t=29613)

EvoZak 09-20-2009 10:34 PM

sending the client PC HP updates... why?
 
From what I understand, the client does its own calcs for player HP regen. The server does a pretty good job of approximating that. Not perfect, but then live probably wasn't either.

So why does the server send out SpawnHPUpdate_Struct packets with precise values? I can send out wildly inaccurate values and the client happily ignores it and uses its own regen rates. So does anyone know why the server bothers at all? Just curious. Thx.

trevius 09-20-2009 10:48 PM

If you look deep enough, I am sure you would find a ton of things that we calculate and check for and send updates on regularly that in a perfect world, we wouldn't need to. The problem is that it isn't a perfect world. Another problem is that a large number of hacks would be possible if we didn't at least try to keep the client in check and do everything server-side that we do currently. In the case of HP updates, they are needed for both clients as well as for NPCs. The client does not ignore them, though it might try to do it's own calculations on it's own, it will still ultimately do what the server says. Also, you need to take into consideration that not all servers try to emulate Live exactly, which means that the server might not calculate stuff exactly the same as the client. We have a rule that allows server admins to decide when Out of Combat Regen starts happening and what rate it recovers at. So, without sending HP Updates, the client would never be in sync with the server in that particular case.

I am sure there are plenty of other good reasons, but I think that one alone should answer your question.

EvoZak 09-21-2009 09:38 PM

That makes sense. I wasn't saying it shouldn't be done, but rather asking if it was necessary. Maybe it was something I wasn't doing right but the client was regenerating a lot faster than the server was tracking.

So when you say the client will still ultimately do what the server says... how does that work for HPs? Cuz when the HP packet is sent, the HP bar isn't respecting it. Is it tracked somewhere else?

trevius 09-23-2009 07:55 AM

Well, the HP Updates should show up directly in your health bar and character/inventory window. When the case happens that the server and client don't match up for how many HPs you currently have as max hps, you will see your hps bouncing up and down a bit due to the packet update for HPs.

Maybe you have some other factor affecting your regen rates if that is what you are concerned with. Have you checked your rule_values table to see if you have out of combat regen enabled and if so, what value you have it set to regen at?

EvoZak 09-29-2009 10:20 PM

Thanks for clearing this up for me. I thought I was seeing the client ignore HP updates I was sending it. Turns out I was using the wrong OpCode.


All times are GMT -4. The time now is 06:19 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.