This commit is contained in:
parent
f46602d4a4
commit
07c8b13bd6
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e6e3dd866bf54704f80f92354da73988
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 97769dbc5bf34414e9034f63f7401d7d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -9,6 +9,7 @@ using Timer = System.Timers.Timer;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -117,6 +118,18 @@ namespace BITKit.Net
|
||||||
|
|
||||||
public async UniTask<bool> Connect(string address = "127.0.0.1", ushort port = 27014)
|
public async UniTask<bool> Connect(string address = "127.0.0.1", ushort port = 27014)
|
||||||
{
|
{
|
||||||
|
//如果address是域名,解析为Ip
|
||||||
|
if (address.Contains("."))
|
||||||
|
{
|
||||||
|
var ip = await Dns.GetHostAddressesAsync(address);
|
||||||
|
if (ip.Length > 0)
|
||||||
|
{
|
||||||
|
address = ip[0].ToString();
|
||||||
|
BIT4Log.Log<KcpNetClient>($"解析域名:{address}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (IsConnecting)
|
if (IsConnecting)
|
||||||
{
|
{
|
||||||
BIT4Log.Warning<KcpNetClient>("正在连接中");
|
BIT4Log.Warning<KcpNetClient>("正在连接中");
|
||||||
|
|
|
@ -350,7 +350,12 @@ namespace BITKit.Net
|
||||||
|
|
||||||
var _bytes = returnMS.ToArray();
|
var _bytes = returnMS.ToArray();
|
||||||
_sendQueue.Enqueue((Id,_bytes));
|
_sendQueue.Enqueue((Id,_bytes));
|
||||||
|
|
||||||
|
if (e is InGameException inGameException)
|
||||||
|
{
|
||||||
|
BIT4Log.Warning<KCPNetServer>(inGameException.Message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
BIT4Log.LogException(e);
|
BIT4Log.LogException(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,7 @@ TabBar Button:disabled {
|
||||||
|
|
||||||
.clear {
|
.clear {
|
||||||
background-color: rgba(0, 0, 0, 0);
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
background-image: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark Button {
|
.theme-dark Button {
|
||||||
|
|
Loading…
Reference in New Issue