예제 #1
0
        /** {@inheritDoc} */
        public override void onHttpStatusOK(QQHttpResponse response)
        {
            //{"retcode":0,"result":{"uin":236557647,"cip":1991953329,"index":1075,"port":51494,"status":"online","vfwebqq":"41778677efd86bae2ed575eea02349046a36f3f53298a34b97d75297ec1e67f6ee5226429daa6aa7","psessionid":"8368046764001d636f6e6e7365727665725f77656271714031302e3133332e342e31373200005b9200000549016e04004f95190e6d0000000a4052347371696a62724f6d0000002841778677efd86bae2ed575eea02349046a36f3f53298a34b97d75297ec1e67f6ee5226429daa6aa7","user_state":0,"f":0}}
            JSONObject json    = new JSONObject(new JSONTokener(new StringReader(response.getResponseMessage())));
            QQSession  session = getContext().getSession();
            QQAccount  account = (QQAccount)getContext().getAccount();

            if (json.getInt("retcode") == 0)
            {
                JSONObject ret = json.getJSONObject("result");
                account.setUin(ret.getLong("uin"));
                account.setQQ(ret.getLong("uin"));
                session.setSessionId(ret.getString("psessionid"));
                session.setVfwebqq(ret.getString("vfwebqq"));
                account.setStatus(QQStatus.ONLINE);
                session.setState(QQSession.State.ONLINE);
                session.setIndex(ret.getInt("index"));
                session.setPort(ret.getInt("port"));
                notifyActionEvent(QQActionEvent.Type.EVT_OK, null);
            }
            else
            {
                notifyActionEvent(QQActionEvent.Type.EVT_ERROR, new QQException(QQWpfApplication1.action.QQException.QQErrorCode.INVALID_RESPONSE));            //TODO ..
            }
        }