Variable Replication
One of the ways the server can keep the clients synchronized is by using variable replication. The way it works is that every specific number of times per second (defined per actor in the AActor::NetUpdateFrequency
variable, which is also exposed to blueprints) the variable replication system in the server will check whether there are any replicated variables (explained in the next section) in the client that needs to be updated with the latest value.
If the variable meets all of the replication conditions, then the server will send an update to the client and enforce the new value.
For example, if you have a replicated Health
variable and the client on its end uses a hacking tool to set the value of the variable from 10
to 100
, then the replication system will enforce the real value from the server and change it back to 10
, which nullifies the hack.
Variables are only sent to the client to be updated if:
- The variable is set to replicate. ...