Inheritance: global::ProtoBuf.IExtensible
Ejemplo n.º 1
0
        private void AccountLoginLobby(string account, string passwd, string clientInfo)
        {
            try {
                m_AccountId  = account;
                m_Password   = passwd;
                m_ClientInfo = clientInfo;

                m_IsWaitStart = false;
                m_HasLoggedOn = false;

                if (!IsConnected)
                {
                    ConnectIfNotOpen();
                }
                else
                {
                    NodeMessage loginMsg = new NodeMessage(LobbyMessageDefine.AccountLogin, m_AccountId);
                    GameFrameworkMessage.AccountLogin protoMsg = new GameFrameworkMessage.AccountLogin();
                    loginMsg.m_ProtoData  = protoMsg;
                    protoMsg.m_AccountId  = account;
                    protoMsg.m_Password   = passwd;
                    protoMsg.m_ClientInfo = clientInfo;

                    if (null != m_AccountId)
                    {
                        SendMessage(loginMsg);
                    }
                }
            } catch (Exception ex) {
                LogSystem.Error("Exception:{0}\n{1}", ex.Message, ex.StackTrace);
            }
        }
Ejemplo n.º 2
0
        //------------------------------------------------------------------------------------------------------
        private void HandleAccountLogin(NodeMessage msg, int handle, uint seq)
        {
            StringBuilder stringBuilder = new StringBuilder(1024);
            int           size          = stringBuilder.Capacity;

            CenterHubApi.TargetName(UserServerConfig.WorldId, handle, stringBuilder, size);
            string node_name = stringBuilder.ToString();

            GameFrameworkMessage.NodeMessageWithAccount loginMsg = msg.m_NodeHeader as GameFrameworkMessage.NodeMessageWithAccount;
            if (null != loginMsg)
            {
                GameFrameworkMessage.AccountLogin protoData = msg.m_ProtoData as GameFrameworkMessage.AccountLogin;
                if (null != protoData)
                {
                    m_UserProcessScheduler.DefaultUserThread.QueueAction(m_UserProcessScheduler.DoAccountLogin, loginMsg.m_Account, protoData.m_Password, protoData.m_ClientInfo, node_name);
                }
            }
        }
Ejemplo n.º 3
0
        private void HandleVersionVerifyResult(NodeMessage lobbyMsg)
        {
            GameFrameworkMessage.VersionVerifyResult verifyResult = lobbyMsg.m_ProtoData as GameFrameworkMessage.VersionVerifyResult;
            if (null == verifyResult)
            {
                return;
            }
            int ret       = verifyResult.m_Result;
            int enableLog = verifyResult.m_EnableLog;

            //GlobalVariables.Instance.ShopMask = verifyResult.m_ShopMask;
            if (0 == ret)
            {
                //版本校验失败,提示用户需要更新版本。
                StopLoginLobby();
                GfxStorySystem.Instance.SendMessage("version_verify_failed");
            }
            else
            {
                if (enableLog == 0)
                {
                    GameControler.FileLogger.Enabled = false;
                }
                else
                {
                    GameControler.FileLogger.Enabled = true;
                }
                //向服务器发送登录消息
                NodeMessage loginMsg = new NodeMessage(LobbyMessageDefine.AccountLogin, m_AccountId);
                GameFrameworkMessage.AccountLogin protoMsg = new GameFrameworkMessage.AccountLogin();
                loginMsg.m_ProtoData  = protoMsg;
                protoMsg.m_AccountId  = m_AccountId;
                protoMsg.m_Password   = m_Password;
                protoMsg.m_ClientInfo = m_ClientInfo;

                if (null != m_AccountId)
                {
                    SendMessage(loginMsg);
                }
            }
        }
        private void HandleVersionVerifyResult(NodeMessage lobbyMsg)
        {
            GameFrameworkMessage.VersionVerifyResult verifyResult = lobbyMsg.m_ProtoData as GameFrameworkMessage.VersionVerifyResult;
            if (null == verifyResult)
                return;
            int ret = verifyResult.m_Result;
            int enableLog = verifyResult.m_EnableLog;
            //GlobalVariables.Instance.ShopMask = verifyResult.m_ShopMask;
            if (0 == ret) {
                //�汾У��ʧ�ܣ���ʾ�û���Ҫ���°汾��
                StopLoginLobby();
                GfxStorySystem.Instance.SendMessage("version_verify_failed");
            } else {
                if (enableLog == 0) {
                    GameControler.FileLogger.Enabled = false;
                } else {
                    GameControler.FileLogger.Enabled = true;
                }
                //����������͵�¼��Ϣ
                NodeMessage loginMsg = new NodeMessage(LobbyMessageDefine.AccountLogin, m_AccountId);
                GameFrameworkMessage.AccountLogin protoMsg = new GameFrameworkMessage.AccountLogin();
                loginMsg.m_ProtoData = protoMsg;
                protoMsg.m_AccountId = m_AccountId;
                protoMsg.m_Password = m_Password;
                protoMsg.m_ClientInfo = m_ClientInfo;

                if (null != m_AccountId) {
                    SendMessage(loginMsg);
                }
            }
        }
        private void AccountLoginLobby(string account, string passwd, string clientInfo)
        {
            try {
                m_AccountId = account;
                m_Password = passwd;
                m_ClientInfo = clientInfo;

                m_IsWaitStart = false;
                m_HasLoggedOn = false;

                if (!IsConnected) {
                    ConnectIfNotOpen();
                } else {
                    NodeMessage loginMsg = new NodeMessage(LobbyMessageDefine.AccountLogin, m_AccountId);
                    GameFrameworkMessage.AccountLogin protoMsg = new GameFrameworkMessage.AccountLogin();
                    loginMsg.m_ProtoData = protoMsg;
                    protoMsg.m_AccountId = account;
                    protoMsg.m_Password = passwd;
                    protoMsg.m_ClientInfo = clientInfo;

                    if (null != m_AccountId) {
                        SendMessage(loginMsg);
                    }
                }
            } catch (Exception ex) {
                LogSystem.Error("Exception:{0}\n{1}", ex.Message, ex.StackTrace);
            }
        }