This commit is contained in:
CortexCore
2024-06-24 17:30:44 +08:00
parent 07b6fbc2f3
commit cda86975a0
3 changed files with 79 additions and 11 deletions

View File

@@ -500,6 +500,15 @@ namespace BITKit.Net
_rpcMethods.TryAdd(methodInfo.Name, methodInfo);
_rpcHandles.TryAdd(methodInfo.Name, rpcHandle);
}
foreach (var eventInfo in rpcHandle.GetType().GetEvents())
{
var att = eventInfo.GetCustomAttribute<NetRpcAttribute>();
if(att is null)continue;
var handle = eventInfo.EventHandlerType.GetMethod("Invoke");
_rpcMethods.AddOrUpdate(eventInfo.Name, handle, (s, info) => handle);
_rpcHandles.AddOrUpdate(eventInfo.Name, rpcHandle, (s, info) => rpcHandle);
}
}
[NetRpc]
public string MyRpcTest(string hello)