void Logout(object obj)
        {
            m2c_fortencentrequest m2c = (m2c_fortencentrequest)obj;

            m2s_deltencentrequest msg = new m2s_deltencentrequest();

            if (MachineId == 0)
            {
                return;
            }
            msg.mid = MachineId;
            M2SInfo m2sInfo = new M2SInfo(msg, LogoutSuccess, MsgFailureLogin);

            GameEntry.WebRequestToServerComponent.SendJsonMsg(m2sInfo);
        }
        void QRCodeLoginSuccess(object obj)
        {
            m2c_fortencentrequest msg = (m2c_fortencentrequest)obj;

            if (msg.resultCode == "0")
            {
                GameEntry.WebRequestToServerComponent.SetUserIdAndSession(msg.uid, msg.session, "", "");
                GameEntry.WebRequestToServerComponent.auid = msg.auid;
                GameEntry.WebRequestToServerComponent.SetGameServerUrl("http://47.100.175.248:6077/");
                GameEntry.GameData.WxName   = msg.WxName;
                GameEntry.GameData.WxAvator = msg.WxAvator;

                login = true;
                NetFsnState++;
                NetFSN();
            }
        }
Ejemplo n.º 3
0
        public void MsgAnalysis(JsonData res, Action <object> action)
        {
            m2c_fortencentrequest m2c = new m2c_fortencentrequest();

            m2c.resultCode = res["respVo"]["resultCode"].ToString();
            m2c.resultDesc = res["respVo"]["resultDesc"].ToString();

            if (m2c.resultCode == "0")
            {
                m2c.uid      = res["tencentrequestMap"][0]["openid"].ToString();
                m2c.auid     = res["tencentrequestMap"][0]["uid"].ToString();
                m2c.session  = res["tencentrequestMap"][0]["session"].ToString();
                m2c.WxName   = res["tencentrequestMap"][0]["name"].ToString();
                m2c.WxAvator = res["tencentrequestMap"][0]["imag"].ToString();
            }
            if (action != null)
            {
                action(m2c);
            }
        }