From c9734b6ceb8a5c966bb969ea3468ae0ed6db8e48 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Sat, 6 Aug 2022 20:55:14 +0200 Subject: [PATCH] Document C# RPC attributes --- .../Core/Attributes/RPCAttributes.cs | 57 ++++++++++++++----- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs index 05082663dc8..7f2ca106783 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs @@ -2,27 +2,58 @@ using System; namespace Godot { + /// + /// RPC calls to methods annotated with this attribute go via the network and execute remotely. + /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] public class RemoteAttribute : Attribute { } - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] - public class SyncAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] - public class MasterAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] - public class PuppetAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] - public class SlaveAttribute : Attribute { } - + /// + /// RPC calls to methods annotated with this attribute go via the network and execute remotely, + /// but will also execute locally (do a normal method call). + /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] public class RemoteSyncAttribute : Attribute { } + /// + /// Same as . + /// + [Obsolete("Use the RemoteSync attribute instead.")] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] - public class MasterSyncAttribute : Attribute { } + public class SyncAttribute : Attribute { } + /// + /// Same as . + /// + [Obsolete("Use the Puppet attribute instead.")] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] + public class SlaveAttribute : Attribute { } + + /// + /// RPC calls to methods annotated with this attribute go via the network and execute only + /// on the peers that are not set as master of the node. + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] + public class PuppetAttribute : Attribute { } + + /// + /// RPC calls to methods annotated with this attribute go via the network and execute only + /// on the peers that are not set as master of the node but will also execute locally (do a normal method call). + /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] public class PuppetSyncAttribute : Attribute { } + + /// + /// RPC calls to methods annotated with this attribute go via the network and execute only + /// on the peer that is set as master of the node. + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] + public class MasterAttribute : Attribute { } + + /// + /// RPC calls to methods annotated with this attribute go via the network and execute only + /// on the peer that is set as master of the node but will also execute locally (do a normal method call). + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)] + public class MasterSyncAttribute : Attribute { } }