接口更新

This commit is contained in:
CortexCore
2023-06-07 03:26:55 +08:00
parent ddf0f7ada0
commit 93292b1a59
5 changed files with 148 additions and 62 deletions

View File

@@ -4,6 +4,7 @@
* ⭐INetServer 服务端接口的基本定义
* ⭐INetClient 客户端接口的基本定义
*/
using System;
using Cysharp.Threading.Tasks;
namespace BITKit
{
@@ -24,19 +25,21 @@ namespace BITKit
/// <summary>
/// 向服务端发送指令
/// </summary>
/// <typeparam name="T"></typeparam>
void ServerCommand<T>();
/// <typeparam name="T">远程指令类型</typeparam>
void ServerCommand<T>(T command=default);
/// <summary>
/// 向所有客户端发送指令
/// </summary>
/// <typeparam name="T">远程指令类型</typeparam>
void RpcClientCommand<T>();
void RpcClientCommand<T>(T command=default);
/// <summary>
/// 向单个客户端发送指令
/// </summary>
/// <param name="id">客户端ID</param>
/// <param name="command">指令实例</param>
/// <typeparam name="T">远程指令类型</typeparam>
void ClientCommand<T>(int id);
void ClientCommand<T>(int id,T command);
/// <summary>
/// 从服务端获取数据
/// </summary>
@@ -123,6 +126,7 @@ namespace BITKit
public interface INetClient
{
public event Action OnStartConnect;
public event Action OnConnected;
public event Action OnDisconnected;
public event Action OnConnectedFailed;