少年修仙传客户端代码仓库
client_linchunjie
2018-08-14 c6689f941359227f0b99b20b9400ccbab81b671c
Core/NetworkPackage/Socket/ClientSocketController.cs
@@ -43,7 +43,7 @@
        }
        catch (Exception e)
        {
            DesignDebug.LogError(e.Message);
            DebugEx.LogError(e.Message);
        }
    }
@@ -53,12 +53,12 @@
        if (ipAddresses[0].AddressFamily == AddressFamily.InterNetworkV6)
        {
            DesignDebug.Log("当前使用的网络: IPV6");
            DebugEx.Log("当前使用的网络: IPV6");
            m_Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
        }
        else
        {
            DesignDebug.Log("当前使用的网络: IPV4");
            DebugEx.Log("当前使用的网络: IPV4");
            m_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        }
@@ -81,14 +81,14 @@
    {
        if (!_result.IsCompleted)
        {
            DesignDebug.Log("链接超时!");
            DebugEx.Log("链接超时!");
            CloseConnect();
        }
        else
        {
            if (m_Socket != null && m_Socket.Connected)
            {
                DesignDebug.Log("确认的链接实现");
                DebugEx.Log("确认的链接实现");
                OnConnectSuccess();
                if (onConnected != null)
@@ -183,7 +183,7 @@
            }
            catch (Exception e)
            {
                DesignDebug.Log(e);
                DebugEx.Log(e);
            }
        }
@@ -236,9 +236,9 @@
                vNetpack = PackageRegedit.TransPack(vPackBytes);
                if (vNetpack != null)
                {
                    if (DesignDebug.EnableNet)
                    if (DebugEx.EnableNetLog)
                    {
                        DesignDebug.LogNetFormat("收包:{0}", vNetpack.GetType().Name);
                        DebugEx.NetLogFormat("收包:{0}", vNetpack.GetType().Name);
                    }
                    GameNetSystem.Instance.PushPackage(vNetpack);
@@ -263,13 +263,13 @@
            return;
        if (vNetPack == null)
        {
            DesignDebug.LogError("要发的信息对象为空");
            DebugEx.LogError("要发的信息对象为空");
            return;
        }
        if (DesignDebug.EnableNet)
        if (DebugEx.EnableNetLog)
        {
            DesignDebug.LogNetFormat("发包:{0}", vNetPack.GetType().Name);
            DebugEx.NetLogFormat("发包:{0}", vNetPack.GetType().Name);
        }
        if (vNetPack.cmd == (ushort)0x03FE || vNetPack.cmd == (ushort)0x1801)
@@ -296,12 +296,12 @@
    {
        if (!Connected)
        {
            DesignDebug.LogError("尚未与该后端链接!无法发送信息");
            DebugEx.LogError("尚未与该后端链接!无法发送信息");
            return;
        }
        if (vBytes == null || vBytes.Length < 2)
        {
            DesignDebug.LogError("要发的信息数据为空或数据不足");
            DebugEx.LogError("要发的信息数据为空或数据不足");
            return;
        }
@@ -324,12 +324,12 @@
    {
        if (!Connected)
        {
            DesignDebug.LogError("尚未与该后端链接!无法发送信息");
            DebugEx.LogError("尚未与该后端链接!无法发送信息");
            return;
        }
        if (vBytes == null || vBytes.Length < 2)
        {
            DesignDebug.LogError("要发的信息数据为空或数据不足");
            DebugEx.LogError("要发的信息数据为空或数据不足");
            return;
        }
@@ -353,7 +353,7 @@
        }
        catch
        {
            DesignDebug.LogError("发送时发生异常");
            DebugEx.LogError("发送时发生异常");
        }
    }
@@ -373,7 +373,7 @@
        }
        catch (Exception ex)
        {
            DesignDebug.Log(ex);
            DebugEx.Log(ex);
        }
    }