private void _onPacketArrived(Int32 _stream_id, PacketType _packet_type, GC_LoginFailedMsg _msg) { switch ((GC_LoginFailedMsg.ReasonInfo)_msg.Reason) { case GC_LoginFailedMsg.ReasonInfo.RET_SUCCESS: case GC_LoginFailedMsg.ReasonInfo.RET_SUCCESS_WITH_ITEM: break; case GC_LoginFailedMsg.ReasonInfo.ERROR_HAS_LOGINED: { string tip = Locale.Instance[string.Format("Login@{0}", (GC_LoginFailedMsg.ReasonInfo)(_msg.Reason)).ToString()]; NetManager.Instance.RequestDisConnect(); UI_MessageBox.Show(tip, Locale.Instance["Common@Confirm"], Locale.Instance["Common@Cancel"], () => { SignalSystem.FireSignal(SignalId.Login_ForceLogin); }); } break; default: { string tip = Locale.Instance[string.Format("Login@{0}", (GC_LoginFailedMsg.ReasonInfo)(_msg.Reason)).ToString()]; if (tip == string.Empty) { UI_MessageBox.Show(((GC_LoginFailedMsg.ReasonInfo)(_msg.Reason)).ToString()); } else { UI_MessageBox.Show(tip); } } break; } WaitForResponse.Release(); }
private void _onLoginButtonClick() { if (m_edit_account.text == string.Empty) { UI_MessageBox.Show(Locale.Instance["Login@PleaseInputAccount"]); return; } if (m_edit_password.text == string.Empty) { UI_MessageBox.Show(Locale.Instance["Login@PleaseInputPassword"]); return; } CG_LoginRequestMsg msg = new CG_LoginRequestMsg(); msg.PlatformID = 0; msg.PlayerName = m_edit_account.text; msg.PlayerPassword = m_edit_password.text; var bt = Encoding.UTF8.GetBytes(UnityEngine.SystemInfo.deviceUniqueIdentifier); msg.Mac = BitConverter.ToUInt64(bt, 0); msg.Md5 = MD5Helper.GetMD5Hash(bt); msg.NameType = 0; msg.Version = 17696793; NetManager.Instance.SendMsg(msg); LoginSystem.Instance.CurAccount = msg.PlayerName; LoginSystem.Instance.CurPassword = msg.PlayerPassword; WaitForResponse.Retain(); }
private void _onPacketArrived(Int32 _stream_id, PacketType _packet_type, GC_LoginOKNoPlayer _msg) { WaitForResponse.Release(); UI_MessageBox.Show(Locale.Instance["Login@NoPlayer"]); //登陆成功后更新本地配置中的账户名 LocalConfigSystem.Instacne.UpdateCurAccount(CurAccount); LocalConfigSystem.Instacne.Update("CurrentPassword", CurPassword); }
/// <summary> /// 更新下载失败提示(包括部分失败) /// </summary> private void showDownloadFailTip() { String tip = String.Format(Locale.Instance["Download@Continue"], (float)(mUpdateTotalSize - mDownloadedSize) / 1024f / 1024f); UI_MessageBox.Show(tip, Locale.Instance["Common@Confirm"], Locale.Instance["Common@Cancel"], () => { StartCoroutine(downloadRes()); }); }
/// <summary> /// 显示检查更新失败提示 /// </summary> private void showCheckUpdateFailTip() { UI_MessageBox.Show(Locale.Instance["Download@Error"], Locale.Instance["Common@Confirm"], () => { StartCoroutine(checkUpdate()); }); }
public static void ShowSelectMsgBox(string _tip, string _button1_tip, string _button2_tip, Action _button1_action, Action _button2_action, Action _close_action) { UI_MessageBox.Show(_tip, _button1_tip, _button2_tip, _button1_action, _button2_action, _close_action); }
public static void ShowSingleMsgBox(string _tip, string _button_tip, Action _button_action, Action _close_action) { UI_MessageBox.Show(_tip, _button_tip, _button_action, _close_action); }