Hello everyone!
Everyone knows conditional replication and thus I am wondering why I seem to be the only person having this issue / this question.
I have an Alliance class, where Players can join and do some funny stuff together enemys should not know about. For example, the name of the alliance should be replicated to every player, but the list of members only to the members itself.
So, how can I replicate stuff to certain players only? The reason is mainly cheat-security, and thats why I can’t just send it to all and then locally dismiss the information on clients that should not know about it, because they could just modify their client programm to get access to gameplay-important information, beside the fact that this would lead in some unnessecary network-usage.
The alliance class is spawned in the alliance-manager, which itself is spawned in the GameState (one instance only, player indipendent).
Idea 1
One “idea” I had was to manually call client functions from the Alliance-class to the member-players and send them the new data to proceed. E.G, I have a function called “addNewMember” and when HasAuthority() foreach(member) ClientFunction to execute playerController->playerState->GamePlayer->Alliance->addNewMember locally.
But this seems a bit of an overheat, since I would have first to retrace from playerController to the alliance-class, and secondly I would need to implement special Client functions for everything in the playerController class…
Idea 2
Another idea I just had was client-requests from the replicated version to the server-version passing a player-controller and just sending the data when the player-controller is valid for receiving this information. But still this would require client-functions from the playerController.
Idea 3 (seems okay, so far?!)
Or what about don’t replicating mainly about the “mother-alliance instance” but just create alliance-instances for every player, who then can replicate everything with COND_OwnerOnly, and just connecting this instances to the “mother-instance”, which itself could still replicate the public stuff to non-member players, like the name.
|-> New Alliance was formed with three members. Spawn the alliance in the alliance manager and set it to replicate public-data to everyone, and spawn also three alliance instances for the three players in their GamePlayer (More persistent, gameplay-wise brother of the temporary playerState) class. Connect this instances to the mother instance and everytime something important is changed in the mother-instance, tell the child-instanced about it. When an “enemy” accesses this GamePlayer instance and want’s the alliance-instance, redirect to the mother-instance. When every important information is still noticed as COND_OwnerOnly in the alliance class, this should lead to no replication on ther mother-instance, and to-owner-only replication on the “child-alliance”, or don’t it? But that would lead to having enemys the same public-data multiple times replicated, no? Uff, heavy topic…
Does this lead in furious actor-overload?
Do you have any better ideas?