private void ShowSelectServer(PhpBackObj phpBackObj) { if (phpBackObj != null) { switch (phpBackObj.ErrorCode) { case "1": //正常 //转到服务器选择界面 phpBackObj.ServerInfo是一个Server类的数组,里面是Server列表信息。 //TraceUtil.Log(phpBackObj.ServerInfo.Length); LoginManager.Instance.GotoHttpServerButtonEnable = true; LoginManager.Instance.ServerInfo = phpBackObj.ServerInfo; UIEventManager.Instance.TriggerUIEvent(UIEventType.ShowLodingUI, UI.Login.LoginUIType.ServerList); break; case "2": //平台验证不通过 UI.MessageBox.Instance.Show(3, "", phpBackObj.ErrorDesc, LanguageTextManager.GetString("IDS_H2_13"), null); break; case "3": //服务器维护,发公告 var phpNoticeBoard = CreatObjectToNGUI.InstantiateObj(PhpNoticeBoard, transform); Transform noticeLabel; phpNoticeBoard.transform.RecursiveFindObject("Notice", out noticeLabel); noticeLabel.GetComponent <UILabel>().text = phpBackObj.ErrorDesc; //隐藏按钮 LocalLoginParentGO.SetActive(false); break; } } }
/// <summary> /// 请求PHP服务器回调 /// </summary> /// <param name="phpBackObj"></param> private void RequestPHPBackHandler(PhpBackObj phpBackObj) { if (phpBackObj == null) { MessageBox.Instance.Show(3, "", "network is bad, try it again", "Cancel", "Sure", null, () => JHPlatformConnManager.Instance.RequestPHP(RequestPHPBackHandler)); } if (phpBackObj != null) { switch (phpBackObj.ErrorCode) { case "1": //正常 LoginManager.Instance.ServerInfo = phpBackObj.ServerInfo; //转到服务器选择界面 phpBackObj.ServerInfo是一个Server类的数组,里面是Server列表信息。 if (m_curUIType == LoginUIType.Login || m_curUIType == LoginUIType.LoginPlatformFail) { OpenMainUI(LoginUIType.ServerList); //m_curUIPanel.GetComponent<PlatformLoginPanel>().ShowServerList(null); } break; case "2": //平台验证不通过 UI.MessageBox.Instance.Show(3, "", phpBackObj.ErrorDesc, LanguageTextManager.GetString("IDS_H2_13"), OnLoginFaildMessageBox); break; case "3": //服务器维护,发公告 var phpNoticeBoard = CreatObjectToNGUI.InstantiateObj(PhpNoticeBoard, transform); Transform noticeLabel; phpNoticeBoard.transform.RecursiveFindObject("Notice", out noticeLabel); noticeLabel.GetComponent <UILabel>().text = phpBackObj.ErrorDesc; break; } } }