UdonSharp icon indicating copy to clipboard operation
UdonSharp copied to clipboard

Add an [Networked(<targets>)] attribute

Open orels1 opened this issue 5 years ago • 2 comments
trafficstars

Feature Description: As a continuation of this it would be nice to have some sort of [Networked] attribute to use in your U# code. This will mean that we can use a C#-like style of invoking events while still keeping them networked, as right now we have to use SendCustomNetworkEvent.

Additional context: Examples of usage would be


[Networked] // Target implicitly set to All
public void Bonk() {}

[Networked(All)] // Target explicitly set to All
public void Bonk() {}

Since we can define parameters for U# methods, this will also need to check for those and drop an error if you're trying to define a networked method with a parameter. But I think its a fair tradeoff for nicer code style and better refactoring support.

orels1 avatar May 26 '20 13:05 orels1

This is mostly waiting on VRC to better define what they are going to be doing with network events for what targets they'll be able to have, if/how they'll support parameters, how or if network events will be protected from "malicious" events sent by modified clients, etc.

MerlinVR avatar May 26 '20 17:05 MerlinVR

how or if network events will be protected from "malicious" events sent by modified clients, etc.

🙏

owlboy avatar May 26 '20 18:05 owlboy