diff --git a/Assets/CRC/game.asset b/Assets/CRC/game.asset index 10b4d3772f..36ca48c9f8 100644 --- a/Assets/CRC/game.asset +++ b/Assets/CRC/game.asset @@ -11583,8 +11583,8 @@ MonoBehaviour: size: 1244 - id: 2893 fileName: lzma/luabytes.unity3d - crc: 993108505 - size: 6098678 + crc: 2306403141 + size: 6100161 - id: 2894 fileName: lzma/resconfigs.unity3d crc: 4059228276 diff --git a/Assets/LuaFramework/Scenes/Logo.unity b/Assets/LuaFramework/Scenes/Logo.unity index 2958b78073..7a76573ed7 100644 --- a/Assets/LuaFramework/Scenes/Logo.unity +++ b/Assets/LuaFramework/Scenes/Logo.unity @@ -912,8 +912,8 @@ MonoBehaviour: settingInfo: logLevel: 0 isDebug: 0 - bundleMode: 0 - luaBundleMode: 0 + bundleMode: 1 + luaBundleMode: 1 isUpdate: 0 isSDK: 0 isSDKLogin: 0 diff --git a/Assets/LuaFramework/Scripts/Network/SocketClient.cs b/Assets/LuaFramework/Scripts/Network/SocketClient.cs index 88ba6c1e18..02534b6f2c 100644 --- a/Assets/LuaFramework/Scripts/Network/SocketClient.cs +++ b/Assets/LuaFramework/Scripts/Network/SocketClient.cs @@ -132,10 +132,8 @@ public class SocketClient /// public void Connect() { - //Debug.Log("****Socket*********************Connect ---" + IpAddress); Close(); - try { var ipType = GetIPAddressType(IpAddress); @@ -354,7 +352,7 @@ public class SocketClient /// void OnReceivedMessage(ByteBuffer buffer) { - MixCode.Command_Switch(13); + MixCode.Command_Switch(13); //user id buffer.ReadIntToByte(); //token @@ -633,15 +631,6 @@ public class SocketClient float _LastReconectime = 0; public void TryReconnect() { - //if (m_isConnecting) - // return; - - if (client != null && client.Connected) - { - _DoReconnected(); - return; - } - if (Time.time - _LastReconectime < AppConst.ConnectTimeout+1) return; @@ -735,27 +724,30 @@ public class SocketClient void OnReconnect(IAsyncResult result) { m_isConnecting = false; - if (!client.Connected) + + //检测是否成功的建立了链接。.. + if (client==null || !client.Connected) { Debug.Log("****Socket*********************OnReconnect FAILED ---" + IpAddress); return; - } - Debug.Log("****Socket*********************OnReconnect SUCCESS ---" + IpAddress); - - WAIT.AddWait(1f).Wait(()=> + } + try { - _DoReconnected(); - }); + //完成本次链接 + client.EndConnect(result); + // 记录链接的成功事件。 + outStream = client.GetStream(); + client.GetStream().BeginRead(byteBuffer, 0, MAX_READ, new AsyncCallback(OnRead), null); + AddStateInfo(NetworkStateType.Reconnected, null); + Debug.Log("****Socket*********************OnReconnect SUCCESS ---" + IpAddress); + } + catch(Exception e) + { + Debug.Log("****Socket*********************OnReconnect FAILED ---" + e.Message); + } } - void _DoReconnected() - { - Debug.Log("****Socket*********************AddStateInfo NetworkStateType.Reconnected-" + IpAddress); - outStream = client.GetStream(); - client.GetStream().BeginRead(byteBuffer, 0, MAX_READ, new AsyncCallback(OnRead), null); - AddStateInfo(NetworkStateType.Reconnected, null); - } /// /// 发送消息 diff --git a/Assets/ManagedResources/~Lua/Logic/Network.lua b/Assets/ManagedResources/~Lua/Logic/Network.lua index 48e457b091..f9a7a94867 100644 --- a/Assets/ManagedResources/~Lua/Logic/Network.lua +++ b/Assets/ManagedResources/~Lua/Logic/Network.lua @@ -88,19 +88,20 @@ function Network:OnReconnect() self.socket:SendMessageWithCallBack(MessageTypeProto_pb.RECONNECT_REQUEST, MessageTypeProto_pb.RECONNECT_RESPONSE, nil, function(b) - -- Log("已经重连!!") - -- RequestPanel.Hide() - -- self.isConnected = true - -- self.bIsStartListenHeartBeat = true - -- Game.GlobalEvent:DispatchEvent(Protocal.Connect, self) + Log("已经重连!!") + RequestPanel.Hide() + self.isConnected = true + self.bIsStartListenHeartBeat = true + Game.GlobalEvent:DispatchEvent(Protocal.Connect, self) end) - Log("已经重连!!") - RequestPanel.Hide() - self.isConnected = true - self.bIsStartListenHeartBeat = true - Game.GlobalEvent:DispatchEvent(Protocal.Connect, self) - + coroutine.start(function() + coroutine.wait(2) + Log("没有收到 重连信息,重新设置链接!!") + if not self.isConnected then + self.socket:Disconnect() + end + end) end function Network:Reset() diff --git a/Assets/Resources/version.txt b/Assets/Resources/version.txt index e7e73835a5..d252578df2 100644 --- a/Assets/Resources/version.txt +++ b/Assets/Resources/version.txt @@ -1 +1 @@ -{"subChannel":"1", "buglyId":"261348dcd3", "channel":"pc", "resUrl":"http://60.1.1.12/jieling_dl/dev/assetBundles/subChannal094-test/", "packageVersion":"0.2", "version":"0.15.0", "serverUrl":"http://60.1.1.23:8080/"} \ No newline at end of file +{"buglyId":"261348dcd3", "channel":"pc", "resUrl":"http://60.1.1.12/jieling_dl/dev/assetBundles/subChannal094-test/", "packageVersion":"0.2", "subChannel":"1", "version":"0.15.0", "serverUrl":"http://60.1.1.23:8080/"} \ No newline at end of file diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 5f1cff1860..007da9c8e4 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -120,7 +120,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 0.1F + bundleVersion: 0.1G preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0