Skip to content

No error or warning when a ServerRpc is called without ownership #601

Closed
@becksebenius-unity

Description

@becksebenius-unity

Describe the bug
The default setting for ServerRpcAttribute.RequireOwnership is true. This means that calls to this function will fail outright if the method is called by a client that does not have ownership. This failure is not communicated to the user at all, it is just a no-op.

To Reproduce
Steps to reproduce the behavior:

  1. Create a NetworkBehaviour with a ServerRpc method. Do not override the default RequireOwnership property
  2. Call the rpc method from a client that does not have ownership
  3. Observe that the rpc is not executed on the server, but there is no indication that it failed

Expected behavior
Users should be informed when a method they try to call does not succeed

Environment (please complete the following information):

  • OS: Win10
  • Unity Version: 2020.2.7f1
  • MLAPI Version: 0.1.0
  • MLAPI Commit: a0e87b3

Additional context
Note - I would also suggest that RequireOwnership should actually be true by default. ServerRpcs are often used to avoid complicated ownership structures, but the default behavior right now requires it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions