5
5
6
6
namespace MLAPI . Configuration
7
7
{
8
- #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
8
+ /// <summary>
9
+ /// Represents the length of a var int encoded hash
10
+ /// Note that the HashSize does not say anything about the actual final output due to the var int encoding
11
+ /// It just says how many bytes the maximum will be
12
+ /// </summary>
9
13
public enum HashSize
10
14
{
15
+ /// <summary>
16
+ /// Two byte hash
17
+ /// </summary>
11
18
VarIntTwoBytes ,
19
+ /// <summary>
20
+ /// Four byte hash
21
+ /// </summary>
12
22
VarIntFourBytes ,
23
+ /// <summary>
24
+ /// Eight byte hash
25
+ /// </summary>
13
26
VarIntEightBytes
14
27
}
15
- #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
16
28
}
17
29
18
30
namespace MLAPI
19
31
{
20
32
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
21
33
public delegate void RpcDelegate ( uint clientId , Stream stream ) ;
22
34
23
- public class ReflectionMehtod
35
+ internal class ReflectionMethod
24
36
{
25
- public MethodInfo method ;
26
- public Type [ ] parameterTypes ;
27
- public object [ ] parameterRefs ;
37
+ private MethodInfo method ;
38
+ private Type [ ] parameterTypes ;
39
+ private object [ ] parameterRefs ;
28
40
29
- public ReflectionMehtod ( MethodInfo methodInfo )
41
+ public ReflectionMethod ( MethodInfo methodInfo )
30
42
{
31
43
method = methodInfo ;
32
44
ParameterInfo [ ] parameters = methodInfo . GetParameters ( ) ;
@@ -39,7 +51,7 @@ public ReflectionMehtod(MethodInfo methodInfo)
39
51
}
40
52
}
41
53
42
- public object Invoke ( object instance , Stream stream )
54
+ internal object Invoke ( object instance , Stream stream )
43
55
{
44
56
using ( PooledBitReader reader = PooledBitReader . Get ( stream ) )
45
57
{
@@ -53,16 +65,31 @@ public object Invoke(object instance, Stream stream)
53
65
}
54
66
}
55
67
68
+ /// <summary>
69
+ /// Attribute used on methods to me marked as ServerRPC
70
+ /// ServerRPC methods can be requested from a client and will execute on the server
71
+ /// Remember that a host is a server and a client
72
+ /// </summary>
73
+ [ AttributeUsage ( AttributeTargets . Method , Inherited = true , AllowMultiple = false ) ]
56
74
public class ServerRPC : Attribute
57
75
{
76
+ /// <summary>
77
+ /// Whether or not the ServerRPC should only be run if executed by the owner of the object
78
+ /// </summary>
58
79
public bool RequireOwnership = true ;
59
- internal ReflectionMehtod reflectionMethod ;
80
+ internal ReflectionMethod reflectionMethod ;
60
81
internal RpcDelegate rpcDelegate ;
61
82
}
62
83
84
+ /// <summary>
85
+ /// Attribute used on methods to me marked as ClientRPC
86
+ /// ClientRPC methods can be requested from the server and will execute on a client
87
+ /// Remember that a host is a server and a client
88
+ /// </summary>
89
+ [ AttributeUsage ( AttributeTargets . Method , Inherited = true , AllowMultiple = false ) ]
63
90
public class ClientRPC : Attribute
64
91
{
65
- internal ReflectionMehtod reflectionMethod ;
92
+ internal ReflectionMethod reflectionMethod ;
66
93
internal RpcDelegate rpcDelegate ;
67
94
}
68
95
0 commit comments