This commit is contained in:
CortexCore
2024-07-06 16:14:29 +08:00
parent b3768a7aa8
commit 94de38362e
9 changed files with 111 additions and 21 deletions

View File

@@ -12,6 +12,7 @@ using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Markup;
using BITKit.Net.Examples;
namespace BITKit.Net
@@ -324,7 +325,14 @@ namespace BITKit.Net
{
dynamic result = methodInfo.Invoke(handle, pars)!;
value = await result;
if (methodInfo.ReturnType == typeof(void) || methodInfo.ReturnType == typeof(UniTask))
{
value = 0;
}
else
{
value = await result;
}
}
else
{
@@ -332,7 +340,10 @@ namespace BITKit.Net
}
returnWriter.Write(true);
BITBinary.Write(returnWriter, value);
if (value is not null)
{
BITBinary.Write(returnWriter, value);
}
}
else
{