Hey once more,
I have a 4 player setup with 3 clients and a server, and replication takes care of most game logic by now. However,
I need to restrict certain actions on objects depending on the clients, eg. client #1 can only play his cards, not the other ones,
whereas client#2 can play other cards, but not those. Basically, I need a way to say:
if(handIndex == clientIndex) PlayCard();
All of my gamelogic is happening on the server, and the client correctly sends clicks with the object’s id, which allows
me to move the correct card on the server and therefore for everyone else. I now need a way to send along the client’s id,
which then allows me to differentiate between them.
I have asked for help on answerhub, but
iterating through playercontroller’s (as suggested) doesn’t work, there seems to be only one playerController for all 3 other clients, and I cannot reach it from
the server by iterating.
The other suggesting to use PlayerId inside the Playerstate is nice, but since my 40 card pawns aren’t possessed by a controller,
PlayerState is always null. Also, if I iterate for a playercontroller on the client, and use playercontroller->playerstate->playerid on that,
it will be again the same for all 3 clients. ( and also again, a playerId that I cannot find by iterating on the server)
please help me out, I’m already taking desperate approaches as well