Esempio n. 1
0
    private void LoginWithCookie(Msg loginMsg)
    {
        Cookie cookie = CookieData.GetInstance().Load();

        if (cookie == null)
        {
            logReport.OnDebugReport("cookie is null");
            openid  = LoginIniter.getInst().Openid;
            sdkCode = LoginIniter.getInst().SdkCode;
            string pwd = LoginIniter.getInst().Ext1;
            if (openid == null || "".Equals(openid) || 0 == sdkCode)
            {
                logReport.OnWarningReport("openid and sdkid error!");
                return;
            }
            loginMsg.AddParam(AccountSrvCodeMap.Param.ACCOUNT_OPEN_ID, openid);              //设备号
            loginMsg.AddParam(AccountSrvCodeMap.Param.ACCOUNT_SDK_CODE, sdkCode);
            if (!"".Equals(pwd))
            {
                loginMsg.AddParam(AccountSrvCodeMap.Param.ACCOUNT_PWD, pwd);
            }
            loginMsg.AddParam(AccountSrvCodeMap.Param.ACCOUNT_SRV_VERSION, appCfg.PkgVersion);
            sendHttpMessage(appCfg.LoginUrl, loginMsg, OnhttpLoginReturn, AccountSrvTimeOut);
        }
        else
        {
            uid            = cookie.Uid;
            token          = cookie.Token;
            srvid          = cookie.Srvid;
            tokenTimestamp = cookie.TokenTimestamp;
            isBind         = cookie.IsBind;
            openid         = cookie.Openid;
            sdkCode        = cookie.SdkCode;
            string loginfo = "save cookie info(accountid:" + this.uid + ","
                             + "accountToken:" + token + ","
                             + "srvid:" + srvid + ","
                             + "tokenTimestamp:" + tokenTimestamp + ")";
            logReport.OnLogReport(loginfo);
            Msg msg = new Msg(AccountSrvCodeMap.Cmd.CMD_ACCOUNT_GET_SERVER_INFO);
            msg.AddParam(AccountSrvCodeMap.Param.ACCOUNT_SRV_VERSION, appCfg.Version);
            msg.AddParam(AccountSrvCodeMap.Param.ACCOUNT_SRV_ID, srvid);
            msg.AddParam(AccountSrvCodeMap.Param.ACCOUNT_SRV_VERSION, appCfg.PkgVersion);
            sendHttpMessage(appCfg.LoginUrl, msg, srvInfoReturn, AccountSrvTimeOut);
        }
    }
Esempio n. 2
0
 public void VistorLogin(ConnectInternetResultHandler SocketComplete, ConnectInternetResultHandler accountSrvComplete)
 {
     CookieData.GetInstance().Clear();
     LoginIniter.getInst().Init();
     login(SocketComplete, accountSrvComplete);
 }
Esempio n. 3
0
 public void SDKLogin(int sdkCode, string openid, string ext1, ConnectInternetResultHandler SocketComplete, ConnectInternetResultHandler accountSrvComplete)
 {
     LoginIniter.getInst().OnSdkLoginReturn(sdkCode, openid, ext1);
     login(SocketComplete, accountSrvComplete);
 }
Esempio n. 4
0
 public void accountAuthLogin(int sdkCode, String userName, String pwd, ConnectInternetResultHandler SocketComplete, ConnectInternetResultHandler accountSrvComplete)
 {
     CookieData.GetInstance().Clear();
     LoginIniter.getInst().OnSdkLoginReturn(sdkCode, userName, pwd);
     login(SocketComplete, accountSrvComplete);
 }