Exemple #1
0
        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();
        }
Exemple #2
0
 public override void Exit()
 {
     WaitForResponse.Release();
     NetManager.Instance.Unregister <ConnectMsg>();
     NetManager.Instance.Unregister <DisconnectMsg>();
     m_time_out.Stop();
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        private void _onPacketArrived(Int32 _stream_id, PacketType _packet_type, GC_LoginOK _msg)
        {
            WaitForResponse.Release();
            Log.Info("收到玩家数据");
            MainPlayer.Instance.InitializePlayerInfo(_msg.PlayerInfo);
            SignalSystem.FireSignal(SignalId.Login_Success);

            //登陆成功后更新本地配置中的账户名
            LocalConfigSystem.Instacne.UpdateCurAccount(CurAccount);
            LocalConfigSystem.Instacne.Update("CurrentPassword", CurPassword);
        }