MirrorNetworking / MirrorNetworking/Mirror
Allow [Command] functions to be called in server-only mode
Open
@miwarnec is already working on this.
Since Apr 8, 2023.
enhancement
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 870
- PR merge metrics
- No merged PRs in 30d
Description
This has been requested a lot, ever since UNET.
For example:
class Inventory : NetworkBehaviour
{
// drop item at slot
[Command]
void DropItem(int slot) { ... }
// local client may request to drop
void Update()
{
if (isLocalPlayer && clicked) DropItem(4);
}
// server may want to call the code too
[Server]
void PunishPlayer()
{
// THIS ERRORS because commands can't be called on server-only
for (i = 0 to count)
DropItem(i);
}
...
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.