1
This commit is contained in:
@@ -29,9 +29,9 @@ namespace BITKit.Net
|
||||
client.Disconnect();
|
||||
OnDisconnected?.Invoke();
|
||||
}
|
||||
|
||||
public async UniTask<bool> Connect(string address = "localhost", ushort port = 27014)
|
||||
{
|
||||
OnStartConnect?.Invoke();
|
||||
await UniTask.SwitchToThreadPool();
|
||||
try
|
||||
{
|
||||
@@ -50,11 +50,11 @@ namespace BITKit.Net
|
||||
private void OnData(ArraySegment<byte> bytes, KcpChannel channel)
|
||||
{
|
||||
var command = BITBinary.ReadAsValue(bytes.ToArray());
|
||||
BIT4Log.Log<KCPNetServer>($"已收到指令:command");
|
||||
BIT4Log.Log<KCPNetServer>($"已收到指令:{command}");
|
||||
}
|
||||
private void OnConnectedInternal()
|
||||
{
|
||||
OnConnected?.Invoke();;
|
||||
OnConnected?.Invoke();
|
||||
BIT4Log.Log<KcpNetClient>("已连接");
|
||||
}
|
||||
private void OnDisconnectInternal()
|
||||
@@ -126,7 +126,7 @@ namespace BITKit.Net
|
||||
{
|
||||
var bytes = BinaryBuilder
|
||||
.Create()
|
||||
.Write((byte)NetCommandType.TargetCommand)
|
||||
.Write((byte)commandType)
|
||||
.Write(values)
|
||||
.Build();
|
||||
client.Send(bytes, KcpChannel.Reliable);
|
||||
|
Reference in New Issue
Block a user