Пример #1
0
        /// <summary>
        /// 快速登录
        /// </summary>
        static void OnQuickLogin(QKCommand cmd)
        {
            string fromType = AccountFromType.QK;

            // 有临时的账号密码
            if (SDKCookie.ContainKey("TempAccount") && SDKCookie.ContainKey("TempPassword"))
            {
                mCurrAccount  = SDKCookie.GetValue("TempAccount");
                mCurrPassword = SDKCookie.GetValue("TempPassword");

                // 上传的参数
                Dictionary <string, string> upParams = new Dictionary <string, string>();
                upParams["AppKey"]   = SDKConfig.AppKey;
                upParams["Account"]  = mCurrAccount;
                upParams["Password"] = mCurrPassword;
                upParams["FromType"] = fromType;
                upParams["Sign"]     = String.Format("AppKey={0}&Account={1}&FromType={2}&{3}",
                                                     SDKConfig.AppKey, mCurrAccount, fromType, SDKConfig.AppSecret).TryToQKMD5();

                NetTask.AutoFinish(new WWW(LoginUrl, upParams.TryToString().TrySecEncode().TryToBytes()), OnUserLoginFinished);
            }
            else
            {
                // 上传的参数
                Dictionary <string, string> upParams = new Dictionary <string, string>();
                upParams["AppKey"]   = SDKConfig.AppKey;
                upParams["FromType"] = fromType;
                upParams["Sign"]     = String.Format("AppKey={0}&FromType={1}&{2}",
                                                     SDKConfig.AppKey, fromType, SDKConfig.AppSecret).TryToQKMD5();

                NetTask.AutoFinish(new WWW(QuickRegistUrl, upParams.TryToString().TrySecEncode().TryToBytes()), OnUserLoginFinished);
            }
        }
Пример #2
0
 /// <summary>
 /// 加载账号缓存
 /// </summary>
 static void LoadAccountCache()
 {
     if (SDKCookie.ContainKey("SDKAccountList"))
     {
         AccountCache.Clear();
         Dictionary <string, string> temp = SDKCookie.GetValue("SDKAccountList").TryToDictionary();
         if (null != temp)
         {
             AccountCache = new Dictionary <string, string>(temp);
         }
     }
 }