Hi Elvince,
Good point! Hacking is always a worry.
For this, you won’t really need to worry about it at the connection level. You can use the method I described above, but just worry about stuffing the health into the PerConnectionState for the player controllers that are on the correct team (this can be named PerPlayerControllerState really).
So if you set up the property as above, your code could look like this:
if ( PlayerController->Team == CorrectTeam )
{
PlayerController->PerConnectionState->Health = Health;
}
For this, you can definitely also just use an RPC to periodically update the health to the appropriate player controllers if it doesn’t change often, but I can see the need to update health often, so maybe this doesn’t apply.