Actor "trace back" only works on one client
Every playerState has a "current selected ACity instance" variable. When an ACity is spawned (On the server), the server writes a pointer to this ACity to the PlayerStates "current selected..." and replicates this value to the client (owner only). That works on all Clients. All clients can access this pointer and do stuff with it. To switch between different citys, the player clicks the one he whats to do things on. Since the server has to know, that all upcoming rpc calls should now concern a (maybe) different ACity instance, the Client sends a RPC call to the server telling him, which ACity he clicked. Then again, this ACity pointer is set as the "current selected City" and replicated back to the client. But this only works on EXACTLY one client. Sometimes client 1, sometimes client 2.. On the other ones, the server replicates just a NULL-Pointer after the client sended a clicked ACity. Also, only on one client (the one the code works on) the city-pointer gets "converted" when passed to the server (The memory adresses are not the same, eg the game converted the clients city pointer to the servers city pointer), whereas on every other client the pointer-adress stays exactly the same. A.) why and B.) why does this work so far? How comes that this object really exists on the server? and C.) why does this only happen on one client? I would understand it if it would happen on every client, but on every one EXCEPT one? Internally, the server accepts all the pointers and works correctly with them..
A special case is, when I use a non dedicated server and spawn an instance over the servers game instance, the "current focused City" replication always correctly replicates the pointer (but correctly doesn't mean it's the ACity instance originally spawned, but it doesn't replicate a NULL pointer as it does to the clients)
As I mentioned, the Clients are all exactly the same, every initialisation follows the exact same process. And the effect is exactly the same, on dedicated and listen server. I can't explain this behaviour and fear it is a Engine-Bug.. Or am I missing something? Everything is set to bAlwaysRelevant already. I checked all the ENetRoles at the different stages of the code, every client has the same Role-Values..
I really appreciate some information about that..
We haven't heard back from you in a while, so I'm resolving this post for tracking purposes. If you're still having trouble communicating this information from Server to all Clients, please feel free to respond with the .h and .cpp files requested above and we can investigate. Thanks!
answered Apr 15 '15 at 09:38 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here