Download

Get PlayerController of RPC sender

In my project i have 1 specific player who can send RPC to server.

Before execute functions on server i want to check if “sender of RPC” exactly this player.

How i can get PlayerController of RPC sender?

And is it safe enough to validate player by PlayerController?

Thank you

Send the client’s PlayerState PlayerId over the RPC, and find the PlayerState on the server based on that ID.

I don’t think it’s safe to validate this way since any client can send a fake PlayerId. I don’t know how one would properly do that, someone else can chime in?

Each client only have their own PlayerController so it is safe to assume that if the call is from a PlayerController that it came from that player.