public static void AutoFinish(WWW www, OnNetFinished onFinish) { NetTask tempTask = new NetTask(www, onFinish); mTasks.Add(tempTask); tempTask.AutoFinish(); }
/// <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); } }
/// <summary> /// 请求注册账号 /// FromType:来源的账号体系 AccountFromType /// Account:账号 /// Password:密码 /// </summary> static void OnRequestRegist(QKCommand cmd) { string fromType = (string)cmd.Params["FromType"]; mCurrAccount = (string)cmd.Params["Account"]; mCurrPassword = (string)cmd.Params["Password"]; // 上传的参数 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(RegistUrl, upParams.TryToString().TrySecEncode().TryToBytes()), OnUserLoginFinished); }