Fix method rpc registration

This commit is contained in:
js6pak committed 2021-11-06 12:14:14 +01:00
1 parent 6613fb007f
commit f63f1bc884
3 files changed
+7 -1

No files matched your search

+4 -1
View File
@@ -47,7 +47,10 @@ namespace Reactor.Networking
_list.Add(customRpc);
_map[customRpc.InnerNetObjectType].Add(customRpc);
typeof(Rpc<>).MakeGenericType(customRpc.GetType()).GetProperty("Instance")!.SetValue(null, customRpc);
if (customRpc.IsSingleton)
{
typeof(Rpc<>).MakeGenericType(customRpc.GetType()).GetProperty("Instance")!.SetValue(null, customRpc);
}
return customRpc;
}
@@ -51,6 +51,8 @@ namespace Reactor.Networking.MethodRpc
public MethodInfo Method { get; }
public HandleDelegate Handle { get; }
protected internal override bool IsSingleton => false;
public override Type InnerNetObjectType { get; }
public override RpcLocalHandling LocalHandling { get; }
public override SendOption SendOption { get; }
+1
View File
@@ -9,6 +9,7 @@ namespace Reactor.Networking
public abstract class UnsafeCustomRpc
{
internal CustomRpcManager? Manager { get; set; }
protected internal virtual bool IsSingleton => true;
public uint Id { get; }
public BasePlugin UnsafePlugin { get; }