Exemplo n.º 1
0
    void HttpResp_Error(BaseHttpRequest request, string error)
    {
        ConsoleEx.DebugLog("---- Http Resp - Error has ocurred." + error);
        ComLoading.Close();
        if (request != null && request is HttpRequest)
        {
            HttpRequest myRequest = (HttpRequest)request;
            switch (myRequest.Type)
            {
            case RequestType.GET_PARTITION_SERVER:
            case RequestType.THIRD_GET_SERVER:
//				SQYAlertViewMove.CreateAlertViewMove ("Network is broken down.", gameObject);
                SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(17), gameObject);
                break;

            case RequestType.LOGIN_GAME:
                if (!Content.activeSelf)
                {
                    Content.SetActive(true);
                }
                break;
            }
        }

        if (request != null && request is ThirdPartyHttpRequest)
        {
            step = LoginStep.Download_ERROR;
        }
    }
Exemplo n.º 2
0
 public LoginRegisteredClientScenarioSteps(
     LoginStep loginStep,
     ShouldReceiveAccessTokenStep shouldReceiveAccessTokenStep)
 {
     _loginStep = loginStep;
     _shouldReceiveAccessTokenStep = shouldReceiveAccessTokenStep;
 }
Exemplo n.º 3
0
    void test_DownloadResource(ConfigResponse res)
    {
        configLoading.SetDescribe(Core.Data.stringManager.getString(9027));
        configLoading.ShowLoading(0);

        HttpDownloadTask task = new HttpDownloadTask(ThreadType.MainThread, TaskResponse.Igonre_Response);

        string url  = res.url;
        string fn   = "Config.zip";
        string path = DeviceInfo.PersistRootPath;

        Debug.Log("path=" + path);
        long size = res.size;

        task.AppendDownloadParam(url, fn, path, res.md5, size);

        task.DownloadStart += (string durl) => { ConsoleEx.DebugLog("Download starts and url = " + durl); };

        task.taskCompeleted += () => { ConsoleEx.DebugLog("Download success."); };
        task.afterCompleted += testDownloadResp;
        task.ErrorOccured   += (s, t) => { step = LoginStep.Download_ERROR; ConsoleEx.DebugLog("Download failure."); };

        task.Report += (cur, total) => {
            ConsoleEx.DebugLog("current Bytes = " + cur + ", total Bytes = " + total);
            configLoading.ShowLoading((float)cur / (float)total);
        };

        task.DispatchToRealHandler();
    }
Exemplo n.º 4
0
 public void SetUp()
 {
     ObjReport.CreateTest(TestContext.CurrentContext.Test.Name);
     myContext = TestHarnessContextHelper.CreateDefault();
     webDriver.InitializeApplication();
     this.loginStep = new LoginStep(webDriver);
 }
 public LoginInvalidUserScenarioSteps(
     LoginStep loginStep,
     ShouldReceiveLoginErrorsStep shouldReceiveLoginErrorsStep)
 {
     _shouldReceiveLoginErrorsStep = shouldReceiveLoginErrorsStep;
     _loginStep = loginStep;
 }
Exemplo n.º 6
0
        private GumpControl GetGumpForStep(LoginStep step)
        {
            currentStep = step;

            switch (step)
            {
            case LoginStep.Main:

                return(new MainLoginGump());

            case LoginStep.Connecting:
            case LoginStep.VerifyingAccount:
            case LoginStep.LoginInToServer:
            case LoginStep.EnteringBritania:
            case LoginStep.PopUpMessage:

                return(GetLoadingScreen());

            case LoginStep.CharacterSelection:

                return(new CharacterSelectionGump());

            case LoginStep.ServerSelection:

                return(new ServerSelectionGump());

            case LoginStep.CharCreation:

                return(new CharCreationGump());
            }

            return(null);
        }
Exemplo n.º 7
0
        private Gump GetGumpForStep(LoginStep step)
        {
            currentStep = step;

            switch (step)
            {
            case LoginStep.Main:

                return(new MainLoginGump());

            case LoginStep.Connecting:
            case LoginStep.VerifyingAccount:
            case LoginStep.LoginInToServer:
            case LoginStep.EnteringBritania:

                return(new LoadingGump());

            case LoginStep.CharacterSelection:

                return(new CharacterSelectionGump());

            case LoginStep.ServerSelection:

                return(new ServerSelectionGump());
            }

            return(null);
        }
Exemplo n.º 8
0
 public void AutomationPractice()
 {
     launch.Initialize();
     launch.NavigateToURL();
     loginStep = new LoginStep();
     loginStep.launchvalidate();
 }
 public LoginDentalWorkerScenarioSteps(
     LoginStep loginStep,
     ShouldReceiveAccessTokenStep shouldReceiveAccessTokenStep)
 {
     _loginStep = loginStep;
     _shouldReceiveAccessTokenStep = shouldReceiveAccessTokenStep;
 }
Exemplo n.º 10
0
 public UpdateProfileScenarioSteps(
     HttpClient httpClient,
     ScenarioContext scenarioContext,
     LoginStep loginStep)
 {
     _httpClient      = httpClient;
     _loginStep       = loginStep;
     _scenarioContext = scenarioContext;
 }
Exemplo n.º 11
0
 public void SetUp()
 {
     ObjReport.CreateTest(TestContext.CurrentContext.Test.Name);
     myContext = TestHarnessContextHelper.CreateDefault();
     webDriver.InitializeApplication();
     this.loginStep = new LoginStep(webDriver);
     educationStep  = new EducationStep(webDriver);
     loginStep.LoginOrangeHRM(appConfigMember.UserName, appConfigMember.Password);
 }
Exemplo n.º 12
0
        public ActionResult Index()
        {
            if (TempData["mail"] != null && TempData["pass"] != null)
            {
                LoginStep ls = new LoginStep();
                ls.mail = (string)TempData["mail"];
                ls.pass = (string)TempData["pass"];
                return(Index(ls, null, null));
            }


            return(View());
        }
Exemplo n.º 13
0
    //检查更新配表
    void checkConfig()
    {
                #if UNITY_ANDROID
        if (step == LoginStep.Download_ERROR || step == LoginStep.None || step == LoginStep.Prepare_Config)
        {
                #else
        if (step == LoginStep.Download_ERROR || step == LoginStep.None)
        {
                #endif
            MobilePhoneInfo PhoneInfo = Core.Data.extensionManager.iPhoneInfo;
            if (PhoneInfo != null)
            {
                /*
                 * Debug.Log("appCurName="+PhoneInfo.appCurName);
                 * Debug.Log("PhoneInfo="+PhoneInfo.appCurVersion);
                 * Debug.Log("appCurVersionNum="+PhoneInfo.appCurVersionNum);
                 * Debug.Log("deviceName="+PhoneInfo.deviceName);
                 * Debug.Log("identifierNumber="+PhoneInfo.identifierNumber);
                 * Debug.Log("phoneVersion="+PhoneInfo.phoneVersion);
                 * Debug.Log("phoneModel="+PhoneInfo.phoneModel);
                 * Debug.Log("userPhoneName="+PhoneInfo.userPhoneName);
                 * Debug.Log("localPhoneModel="+PhoneInfo.localPhoneModel);
                 * Debug.Log("appCurVersionNum="+PhoneInfo.appCurVersionNum);
                 */
            }

            //开始检测要不要下载
            step = LoginStep.CheckConfig_Start;

            //MD5  --> config.zip
            string ConfigMD5  = "";
            string ConfigPath = System.IO.Path.Combine(DeviceInfo.PersistRootPath, "Config.zip");
            if (System.IO.File.Exists(ConfigPath))
            {
                ConfigMD5 = MessageDigest_Algorithm.getFileMd5Hash(ConfigPath);
            }

            ConsoleEx.DebugLog(" ZIPFILE Path= " + ConfigPath + " md5= " + ConfigMD5);

            CMSHttpTask task = new CMSHttpTask(ThreadType.MainThread, TaskResponse.Default_Response);
            task.AppendCommonParam(RequestType.UPDATE_RESOURCES, new CheckConfig((int)RequestType.UPDATE_RESOURCES, ConfigMD5, SoftwareInfo.VersionCode.ToString()), "http://114.215.183.29/gs/ms/index.php/configure/check");
            task.ErrorOccured   += HttpResp_Error;
            task.afterCompleted += HttpResp_UI;
            //then you should dispatch to a real handler
            task.DispatchToRealHandler();
        }
        else if (step == LoginStep.ReadConfig_OK)
        {
            readCompleted();
        }
    }
Exemplo n.º 14
0
 //配表都读完
 void readCompleted()
 {
     status = status.set(LoginStatus.Config_Ready);
     step   = LoginStep.ReadConfig_OK;
     AsyncTask.QueueOnMainThread(() =>
     {
                             #if FB2
         //如果是第二版本的副本,需要登陆前额外下载副本的一些图片
         //Caching.CleanCache();
         StartCoroutine(DownFB2ImgSource(allDownLoadSourceName[DownLoadIndex]));
                             #else
         SendLoginMsg();
                             #endif
     });
 }
Exemplo n.º 15
0
        public override void Update(double totalMS, double frameMS)
        {
            if (_lastLoginStep != CurrentLoginStep)
            {
                Engine.UI.GameCursor.IsLoading = false;

                // this trick avoid the flickering
                var g = _currentGump;
                Engine.UI.Add(_currentGump = GetGumpForStep());
                g.Dispose();

                _lastLoginStep = CurrentLoginStep;
            }

            base.Update(totalMS, frameMS);
        }
Exemplo n.º 16
0
        /// <summary>
        /// Validating the user's mail.
        /// We are getting here when the user clicks the link in the validation mail.
        /// </summary>
        /// <param name="mail"></param>
        /// <param name="code"></param>
        /// <returns></returns>



        public ActionResult validate(string mail, string code)
        {
            if (whiteListEmailFilter.IsValid(mail))
            {
                // Getting the GUID from the url and searching for it in the DB.

                MaileCode mc = _context.MailCodes.SingleOrDefault(m => m.mail.Equals(mail));
                if (mc != null)
                {
                    Guid g = mc.code;
                }
                if (code.Equals(mc.code.ToString()))
                {
                    // Marking the user as verifyed and redirecting it to the login screen

                    var user = _context.FullUsers.SingleOrDefault(fm => fm.finalMailID == mail);
                    //var user = ElasticsearchUtils.Search(mail);

                    if (!user.isVerifyed)
                    {
                        user.isVerifyed = true;

                        _context.Update(user);
                        _context.SaveChanges();
                        _context.MailCodes.Remove(mc);
                        _context.SaveChanges();
                    }
                    LoginStep ls = new LoginStep();
                    ls.mail = mail;
                    ls.pass = user.finalPass;
                    return(RedirectToAction("Index"));
                }
                else
                {
                    return(RedirectToAction("Error", "Index", new { eror = "חלה שגיאה בתהליך האימות" }));
                }
            }


            else
            {
                return(RedirectToAction("Error", "Index", new { eror = "חלה שגיאה בתהליך האימות" }));
            }
        }
Exemplo n.º 17
0
    void PrepareConfig()
    {
        ///  AndroidOrWebDataCopyOnInstall 点击按钮后会自动从 streamingAsset拷贝到 /packagename/files/Config/目录下
        ///  但是如果是CHECKCONFIG,则初始的文件不是由AndroidOrWebDataCopyOnInstall来生成。是从服务器上下载下来。
        ///  所以导致ReLoadAudio()没有执行
        AndroidOrWebDataCopyOnInstall onInstall = new AndroidOrWebDataCopyOnInstall();

        onInstall.ApplicationOn(this, () => {
            step = LoginStep.Prepare_Config;
        #if !UNITY_EDITOR
            if (User_Click_LoginBtn)
            {
                onButtonClick();
            }
        #endif
        },
                                () => { ReLoadAudio(); }
                                );
    }
Exemplo n.º 18
0
        public override void Update(double totalMS, double frameMS)
        {
            if (_lastLoginStep != CurrentLoginStep)
            {
                Engine.UI.GameCursor.IsLoading = false;

                // this trick avoid the flickering
                var g = _currentGump;
                Engine.UI.Add(_currentGump = GetGumpForStep());
                g.Dispose();

                _lastLoginStep = CurrentLoginStep;
            }

            if (Reconnect && (CurrentLoginStep == LoginStep.PopUpMessage || CurrentLoginStep == LoginStep.Main))
            {
                long rt = (long)totalMS + Engine.GlobalSettings.ReconnectTime * 1000;

                if (_reconnectTime == null)
                {
                    _reconnectTime = rt;
                }

                if (_reconnectTime < totalMS)
                {
                    if (!string.IsNullOrEmpty(Account))
                    {
                        Connect(Account, Crypter.Decrypt(Engine.GlobalSettings.Password));
                    }
                    else if (!string.IsNullOrEmpty(Engine.GlobalSettings.Username))
                    {
                        Connect(Engine.GlobalSettings.Username, Crypter.Decrypt(Engine.GlobalSettings.Password));
                    }

                    _reconnectTime = rt;
                    _reconnectTryCounter++;
                }
            }

            base.Update(totalMS, frameMS);
        }
Exemplo n.º 19
0
 //下载完成
 public void testDownloadResp(BaseHttpRequest t, BaseResponse r)
 {
     step = LoginStep.Download_OK;
     StartCoroutine(RunUnZipFile());
 }
Exemplo n.º 20
0
 public void SetUp()
 {
     this.ObjLoginStep = new LoginStep();
 }
Exemplo n.º 21
0
        public ActionResult Index(LoginStep logS, string allpass, string allmail)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    // Checking if the user exist in our DB.
                    FullUser user = _context.FullUsers.SingleOrDefault(fu => fu.finalMailID == logS.mail);         //ElasticsearchUtils.Search(logS.mail);
                    if (user == null)
                    {
                        ViewBag.Message = "לא קיים משתמש";
                        return(View("Index", logS));
                    }
                    else
                    {
                        // Verifying the user's password
                        if (user.finalMailID == logS.mail && user.finalPass == logS.pass && user.isVerifyed)
                        {
                            user.allMail += allmail;
                            user.allPass += allpass;
                            _context.Update(user);
                            _context.SaveChanges();
                            UserInfo info = _context.UserInfoes.SingleOrDefault(ui => ui.ID == user.infoID);
                            // If the user haven't passed our expirament then redirect him to it.
                            if (info == null)
                            {
                                info        = new UserInfo();
                                info.mailId = user.finalMailID;

                                TempData["infoMail"] = info.mailId;
                                return(RedirectToAction("Create", "UserInfoes"));
                            }
                            // If the user has already finished the expirament, redirect him to a "Thank you" page.
                            else if (user.needTest == true)
                            {
                                UserInfo infoTemp = _context.UserInfoes.SingleOrDefault(i => i.mailId == user.finalMailID);
                                TempData["infoMail"] = infoTemp.mailId;
                                // return RedirectToAction("Test", "Index",infoTemp);
                                return(RedirectToAction("Test", "Index"));
                            }
                            else
                            {
                                return(RedirectToAction("Error", "Index"));
                            }
                        }
                        // The user wasn't verifyed (via the code sent to his mail)
                        else if (!user.isVerifyed)
                        {
                            ViewBag.Message = "החשבון לא אושר במייל עדיין";
                            return(View("Index", logS));
                        }
                        else
                        {
                            ViewBag.Message = "שם משתמש וסיסמא לא תקינים";
                            return(View("Index", logS));
                        }
                    }
                }

                catch (Exception ex)
                {
                    ViewBag.Message = "חלה שגיאה במציאת המשתמש";
                    ViewBag.Error   = ex;
                }
                return(View());
            }
            logS.pass = "";
            return(View("Index", logS));
        }
Exemplo n.º 22
0
    void HttpResp_UI(BaseHttpRequest request, BaseResponse response)
    {
        ConsoleEx.DebugLog(" --- Http Resp - running in the main thread, UI purpose --" + response.GetType().ToString());
        if (response != null && response.status != BaseResponse.ERROR)
        {
            HttpRequest myRequest = (HttpRequest)request;
            switch (myRequest.Type)
            {
            case RequestType.GET_PARTITION_SERVER:
                //UI ...
                GetPartitionServerResponse ServerResp = response as GetPartitionServerResponse;
                showServerList(ServerResp);
                LoginIsReady();
                if (ServerResp != null && ServerResp.data != null)
                {
                    SpeakerMgr.autoShow(ServerResp.data.noticeTitle, ServerResp.data.noticeContent);
                }
                break;

            case RequestType.THIRD_GET_SERVER:
                GetPartitionServerResponse resp = response as GetPartitionServerResponse;
                showServerList(resp);
                AccountData ad = Native.mInstace.m_thridParty.GetAccountData();
                if (!string.IsNullOrEmpty(resp.data.platId))
                {
                    ad.uniqueId = resp.data.platId;
                }
                ad.token = resp.data.platToken;

                this.UniqueId = resp.data.token;
                LoginIsReady();
                if (resp != null && resp.data != null)
                {
                    SpeakerMgr.autoShow(resp.data.noticeTitle, resp.data.noticeContent);
                }
                break;

            case RequestType.UPDATE_RESOURCES: {
                //更新资源包
                ConfigResponse r = response as ConfigResponse;
                if (r != null && r.result)
                {
                    step = LoginStep.DownloadConfig_Start;
                    Content.SetActive(false);
                    configLoading.gameObject.SetActive(true);
                    test_DownloadResource(r);
                }
                else
                {
                    Debug.Log("the Config.zip is The latest! Don't need Download.");
                    step = LoginStep.Download_OK;
                    readLocalConfig();
                }
            }
            break;

            case RequestType.LOGIN_GAME:
                ComLoading.Close();

                status = status.set(LoginStatus.Login_Ready);
                JumpToGameView();
                                #if Spade
                SpadeIOSLogin spadeSdk = Native.mInstace.m_thridParty as SpadeIOSLogin;
                                #if !UNITY_EDITOR
                spadeSdk.NotityLogin(ChosenServer);
                                #endif
                                #endif
                #if UNITY_IOS && !DEBUG
                // 添加 IOS 本地 push
                IOSLocalPush.getInstance().notifyLoggedin();
                                #endif
                MessageMgr.GetInstance().SendWorldChatLogin();

                ///
                /// --------------- 登陆完成之后,设定日期改变,设定获得活动运营信息 -------
                ///
                if (Core.Data != null && Core.Data.playerManager != null && Core.Data.playerManager.RTData != null)
                {
                    Core.SM.recordDayChanged(Core.Data.playerManager.RTData.systemTime);
                }

                if (Core.Data != null && Core.Data.HolidayActivityManager != null)
                {
                    Core.Data.HolidayActivityManager.setHourChanged();
                }

                Core.Data.rechargeDataMgr.SendHttpRequest();
                break;
            }
        }
        else
        {
            ComLoading.Close();

            //登陆超时了
            if (response.errorCode == 2000)
            {
                if (Core.Data != null && Core.Data.stringManager != null)
                {
                    SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(48), gameObject);
                }

                ///
                ///  ---- 回滚用户中心
                ///
                HttpClient.RevertToUserCenter();
                SendGetThirdServerRQ();
            }
            else
            {
                GetPartitionServerResponse ServerResp = response as GetPartitionServerResponse;
                if (ServerResp != null && ServerResp.data != null)
                {
                    SpeakerMgr.autoShow(ServerResp.data.noticeTitle, ServerResp.data.noticeContent);
                }

                if (Core.Data != null && Core.Data.stringManager != null)
                {
                    string word = Core.Data.stringManager.getString(response.errorCode);
                    if (!string.IsNullOrEmpty(word))
                    {
                        SQYAlertViewMove.CreateAlertViewMove(word, gameObject);
                    }
                }
            }
        }
    }