Unreal Networking

Classé dans : Non classé | 0

Full class for networking in Unreal
And a local copy, just in case :

Tools for profiling :
Netprofile on/off

Using Replication over variable is clever : does not send data if same value is set (But trigger OnRep locally (on server side most of the time). With array, does not send all the array, but only modified values.
In cpp:
CAUTION : in CCP you must call the OnRep_SetPlayerType() when you set the variables, while you don’t need it on blueprint

Réplication order :

  1. Send all replicated values
  2. Receive all replicated values
  3. Call repnotify for each repnotify variable
  4. Call begin play

OnRep Notify
– on blueprint : set /notify trigger the onrep on the local machine modifying the value.
– We need a Set call, otherwise the on rep is not trigger (example with array)
– only Modification trigger OnRep