Make register callback optional

This commit is contained in:
Mike Nolan 2023-06-12 21:52:21 -05:00
parent 9d2ded9e84
commit 4fa8af7a54
2 changed files with 7 additions and 3 deletions

View File

@ -72,6 +72,10 @@ namespace Tesses.RPC
} }
} }
private event Action<JsonMessage<TEnum>> recv_res; private event Action<JsonMessage<TEnum>> recv_res;
public void Register<T>(TEnum val) where T : TType
{
Register<T>(val,(ctx)=>{});
}
public void Register<T>(TEnum val,Action<MessageReceived<T,TType>> recv) where T : TType public void Register<T>(TEnum val,Action<MessageReceived<T,TType>> recv) where T : TType
{ {

View File

@ -10,9 +10,9 @@
<PackageId>Tesses.RPC</PackageId> <PackageId>Tesses.RPC</PackageId>
<Author>Mike Nolan</Author> <Author>Mike Nolan</Author>
<Company>Tesses</Company> <Company>Tesses</Company>
<Version>1.0.0</Version> <Version>1.0.1</Version>
<AssemblyVersion>1.0.0</AssemblyVersion> <AssemblyVersion>1.0.1</AssemblyVersion>
<FileVersion>1.0.0</FileVersion> <FileVersion>1.0.1</FileVersion>
<Description>A simple RPC library for .NET</Description> <Description>A simple RPC library for .NET</Description>
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression> <PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>