void LoginGetTick() { getTask.Tick(); if (!getTask.Completed) { return; } if (getTask.Success) { postTask = new SignInTask(); postTask.Username = Get(0); postTask.Password = Get(1); postTask.Token = getTask.Token; postTask.RunAsync(game); } else { DisplayWebException(getTask.WebEx, "sign in"); } getTask = null; game.RedrawBackground(); Resize(); }
void LoginAsync(int mouseX, int mouseY) { if (String.IsNullOrEmpty(Get(0))) { SetStatus("&eUsername required"); return; } if (String.IsNullOrEmpty(Get(1))) { SetStatus("&ePassword required"); return; } if (getTask != null) { return; } game.Username = Get(0); UpdateSignInInfo(Get(0), Get(1)); CheckboxWidget skip = widgets[view.sslIndex] as CheckboxWidget; if (skip != null && skip.Value) { ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); }; Options.Set("skip-ssl-check", true); } else { ServicePointManager.ServerCertificateValidationCallback = null; } getTask = new GetCSRFTokenTask(); getTask.RunAsync(game); game.RedrawBackground(); Resize(); SetStatus("&eSigning in.."); signingIn = true; }