1
This commit is contained in:
@@ -89,9 +89,9 @@ namespace BITKit.Net
|
||||
_netProviderImplementation.ClientCommand(id, command);
|
||||
}
|
||||
|
||||
public UniTask<T> GetFromServer<T>(string path=default,T command = default)=>_netProviderImplementation.GetFromServer<T>(path,command);
|
||||
public UniTask<T> GetFromServer<T>(string path=default,params object[] pars)=>_netProviderImplementation.GetFromServer<T>(path,pars);
|
||||
|
||||
public UniTask<T> GetFromClient<T>(int id,string path=default, T command = default)=>_netProviderImplementation.GetFromClient(id,path, command);
|
||||
public UniTask<T> GetFromClient<T>(int id,string path=default, params object[] pars)=>_netProviderImplementation.GetFromClient<T>(id,path, pars);
|
||||
|
||||
public void AddRpcHandle(object rpcHandle)
|
||||
{
|
||||
|
@@ -96,6 +96,16 @@ namespace BITKit.Net.Kcp
|
||||
_netProviderImplementation.ClientCommand(id, command);
|
||||
}
|
||||
|
||||
public UniTask<T> GetFromServer<T>(string path = null, params object[] pars)
|
||||
{
|
||||
return client.GetFromServer<T>(path, pars);
|
||||
}
|
||||
|
||||
public UniTask<T> GetFromClient<T>(int id, string path = null, params object[] pars)
|
||||
{
|
||||
return client.GetFromClient<T>(id, path, pars);
|
||||
}
|
||||
|
||||
public UniTask<T> GetFromServer<T>(string path=null,T command = default)
|
||||
{
|
||||
return _netProviderImplementation.GetFromServer<T>(path,command);
|
||||
@@ -232,6 +242,21 @@ namespace BITKit.Net.Kcp
|
||||
StartTime = DateTime.Now
|
||||
});
|
||||
BIT4Log.Log<MonoKcpClient>($"已返回\n开始:{value.StartTime}\n结束:{value.EndTime}\n延迟:{(value.EndTime-value.StartTime).TotalMilliseconds}ms");
|
||||
|
||||
var hello =
|
||||
await GetFromServer<string>(
|
||||
nameof(KCPNetServer.MyRpcTest),
|
||||
"hello"
|
||||
);
|
||||
|
||||
BIT4Log.Log<MonoKcpClient>($"已返回\n{hello}");
|
||||
var helloAsync =
|
||||
await GetFromServer<string>(
|
||||
nameof(KCPNetServer.MyRpcTestAsync),
|
||||
"hello"
|
||||
);
|
||||
|
||||
BIT4Log.Log<MonoKcpClient>($"已返回\n{helloAsync}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -113,14 +113,14 @@ namespace BITKit.Net.Kcp
|
||||
_server.ClientCommand(id, command);
|
||||
}
|
||||
|
||||
public UniTask<T> GetFromServer<T>(string path = null,T command = default)
|
||||
public UniTask<T> GetFromServer<T>(string path = null, params object[] pars)
|
||||
{
|
||||
return _serverInstance.GetFromServer(path,command);
|
||||
return _serverInstance.GetFromServer<T>(path, pars);
|
||||
}
|
||||
|
||||
public UniTask<T> GetFromClient<T>(int id,string path = null, T command = default)
|
||||
public UniTask<T> GetFromClient<T>(int id, string path = null, params object[] pars)
|
||||
{
|
||||
return _serverInstance.GetFromClient(id,path, command);
|
||||
return _serverInstance.GetFromClient<T>(id, path, pars);
|
||||
}
|
||||
public void AddRpcHandle(object rpcHandle)
|
||||
{
|
||||
|
Reference in New Issue
Block a user