1
\$\begingroup\$

I have recently picked up learning Unity3D's networking API, and have been following their multiplayer networking tutorial.

I just got to the topic "Death and Respawning" and am concerned about the safety of making ClientRpcs calls. From the article:

In our example the Client controls the position of the local Player GameObject. This is because the Player GameObject has local authority on the Client.

If the Server simply sets the Player GameObject’s position back to origin when the player’s currentHealth reaches 0, the Client would override the Server as the Client has authority.

To avoid this, the Server instructs the owning Client to move the player's GameObject to the restart position as a ClientRpc call. This position is then synchronized across all of the Clients because of the player GameObject's NetworkTransform.

So, does this mean that the local authority of the client could potentially override that of the server, and then subsequently have the server propagate incorrect updates to all other clients?

As an example, consider a player that has a "shoot" Command and can receive a "die" ClientRpc call. Let's say this player has been defeated fair and square, and the server sends the "die" ClientRpc call. But, consider that the player who died is a hacker who has rigged his/her local client to ignor this call. That player then issues a "shoot" command after s/he should have died. What would happen?

My guess is that the NetworkTransform component on the player is what dictates server authority over such instances, but I'm interested in knowing what is actually happening if not.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.