This commit is contained in:
CortexCore
2024-06-12 16:01:56 +08:00
parent 01b19130a9
commit 126131b842
8 changed files with 208 additions and 112 deletions

View File

@@ -89,9 +89,9 @@ namespace BITKit.Net
_netProviderImplementation.ClientCommand(id, command);
}
public UniTask<T> GetFromServer<T>(T command = default)=>_netProviderImplementation.GetFromServer<T>(command);
public UniTask<T> GetFromServer<T>(string path=default,T command = default)=>_netProviderImplementation.GetFromServer<T>(path,command);
public UniTask<T> GetFromClient<T>(int id, T command = default)=>_netProviderImplementation.GetFromClient(id, command);
public UniTask<T> GetFromClient<T>(int id,string path=default, T command = default)=>_netProviderImplementation.GetFromClient(id,path, command);
public void AddRpcHandle(object rpcHandle)
{

View File

@@ -96,14 +96,14 @@ namespace BITKit.Net.Kcp
_netProviderImplementation.ClientCommand(id, command);
}
public UniTask<T> GetFromServer<T>(T command = default)
public UniTask<T> GetFromServer<T>(string path=null,T command = default)
{
return _netProviderImplementation.GetFromServer<T>(command);
return _netProviderImplementation.GetFromServer<T>(path,command);
}
public UniTask<T> GetFromClient<T>(int id, T command = default)
public UniTask<T> GetFromClient<T>(int id,string path=null, T command = default)
{
return _netProviderImplementation.GetFromClient<T>(id, command);
return _netProviderImplementation.GetFromClient<T>(id,path, command);
}
public void AddRpcHandle(object rpcHandle)
{
@@ -227,7 +227,7 @@ namespace BITKit.Net.Kcp
private async void Hello()
{
BITAppForUnity.ThrowIfNotPlaying();
var value =await GetFromServer(new SimplePing()
var value =await GetFromServer<SimplePing>(null,new SimplePing()
{
StartTime = DateTime.Now
});

View File

@@ -113,14 +113,14 @@ namespace BITKit.Net.Kcp
_server.ClientCommand(id, command);
}
public UniTask<T> GetFromServer<T>(T command = default)
public UniTask<T> GetFromServer<T>(string path = null,T command = default)
{
return _serverInstance.GetFromServer(command);
return _serverInstance.GetFromServer(path,command);
}
public UniTask<T> GetFromClient<T>(int id, T command = default)
public UniTask<T> GetFromClient<T>(int id,string path = null, T command = default)
{
return _serverInstance.GetFromClient(id, command);
return _serverInstance.GetFromClient(id,path, command);
}
public void AddRpcHandle(object rpcHandle)
{