Network programming - a lot of functions and code or something is wrong?

It sounds like you what you are looking for is Replication.

You are achieving replication through RPCs, which also works. If you want to clean up the code a little it’s simpler to set the variables to be replicated.

  1. Add UPROPERTY(Replicated) above your variable that you want to be replicated.
  2. Implement GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
  3. Add DOREPLIFETIME(AReplicatedActor, bIsSprinting); in GetLifetimeReplicatedProps

In order for a value to be replicated, it needs to be modified on the server and is then replicated to all clients.
UPROPERTY(ReplicatedUsing=OnRep_Flag) also exists, which will call OnRep_Flag() everytime the variable is replicated.