mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Fix method rpc registration
This commit is contained in:
3 files changed
+7
-1
No files matched your search
@@ -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; }
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in new issue
Block a user