This commit is contained in:
CortexCore
2025-07-11 11:45:45 +08:00
parent fc189b98cc
commit ecae0f809c
76 changed files with 237471 additions and 33136 deletions

View File

@@ -79,7 +79,7 @@ namespace BITKit
/// </summary>
public interface INetProvider
{
public int RpcCount { get; set; }
public uint TickRate { get; set; }
/// <summary>
@@ -99,14 +99,12 @@ namespace BITKit
/// <summary>
/// 远程调用
/// </summary>
void Invoke(Memory<byte> bytes);
void Invoke(int id,byte[] bytes);
/// <summary>
/// 异步远程调用,有返回结果
/// </summary>
/// <param name="bytes"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
UniTask<Memory<byte>> InvokeAsync(Memory<byte> bytes);
UniTask<byte[]> InvokeAsync(int id,byte[] bytes);
}
/// <summary>
@@ -207,11 +205,16 @@ namespace BITKit
public event Action OnConnected;
public event Action OnDisconnected;
public event Action OnConnectedFailed;
public event Action<byte[], int> OnData;
/// <summary>
/// 是否已连接到服务端
/// </summary>
bool IsConnected { get; }
/// <summary>
/// 是否正在连接中
/// </summary>
bool IsConnection { get; }
/// <summary>
/// 手动Tick
/// </summary>
bool ManualTick { get; set; }
@@ -241,7 +244,7 @@ namespace BITKit
/// <param name="message">消息</param>
void SendServerMessage(string message);
}
#if Disabled
public class NetProviderCommon:INetProvider
{
public static readonly BITSharp.ICodeGenerator CodeGenerator = new RemoteInterfaceGenerator();
@@ -504,4 +507,5 @@ namespace BITKit
return await source.Task.AttachExternalCancellation(cancelCts.Token);
}
}
#endif
}