void DoReconnect() { m_IsAskConnecting = false; m_bAskConnecting = false; NetWorkLogic.SetConcnectDelegate(Ret_Reconnect); NetWorkLogic.GetMe().ReConnectToServer(); }
/// <summary> /// 连接服务器 /// </summary> /// <param name="_ip"></param> /// <param name="_port"></param> /// <param name="delConnect"></param> public void ConnectToServer(string _ip, int _port, Action <bool, string> delConnect) { m_connectIP = _ip; m_connectPort = _port; m_delConnect = delConnect; LogModule.DebugLog("Connect to Server... ip:" + m_connectIP + " port :" + m_connectPort.ToString()); NetWorkLogic.SetConcnectDelegate(m_delConnect); NetWorkLogic.GetMe().ConnectToServer(m_connectIP, m_connectPort, 500); }
public void OnCYUserLogin(string param) { LogModule.DebugLog("----OnCYUserLogin:"******"data"]; JsonData dataObj = JsonMapper.ToObject(data); string strValidateInfo = (string)dataObj["validateInfo"]; #else //param = "{\"uid\":\"514001613706505\",\"token\":\"9f38e276d3d758b5\",\"deviceid\":\"10001\",\"userip\":\"10001\",\"type\":\"c\",\"appid\":\"101005256\"},4001,10001" //LogModule.DebugLog(param); string keyValidateInfo = "\"validateInfo\":"; int validateInfoPos = param.IndexOf(keyValidateInfo) + keyValidateInfo.Length + 1; string strValidateInfo = param.Substring(validateInfoPos, param.IndexOf("\"", validateInfoPos) - validateInfoPos); //int opCodePos = param.LastIndexOf(",") + 1; //string opCode = param.Substring(opCodePos); //int channelPos = param.LastIndexOf("},") + 2; //string stringChannel = param.Substring(channelPos, opCodePos - 1 - channelPos); #endif LoginData.accountData.SetCYData(strValidateInfo); if (PlatformHelper.GetChannelType() == PlatformHelper.ChannelType.IOS_XY) { m_bReceiveNewLoginData = true; } if (ServerChooseController.Instance() == null) { // 只允许在登陆界面登陆 return; } #if UNITY_WP8 NetWorkLogic.SetConcnectDelegate(WpLoginReconnect); NetWorkLogic.GetMe().ReConnectToServer(); #else SendLoginInfo(); #endif }
private void DoConnectToServer() { LogModule.DebugLog("Connect to Server... ip:" + m_connectIP + " port :" + m_connectPort.ToString()); NetWorkLogic.SetConcnectDelegate(m_delConnect); NetWorkLogic.GetMe().ConnectToServer(m_connectIP, m_connectPort, 500); }