public override void Start() { // Add game object to AI SceneInfo class. if (Category == CharacterCategory.CC_SPIRIT) { SceneInfo.Spirits.Add(GameObject); } if (Category == CharacterCategory.CC_PRIEST) { SceneInfo.Priests.Add(GameObject); } if (Category == CharacterCategory.CC_GUARD) { SceneInfo.Guards.Add(GameObject); } if (SceneInfo.ResetInfoSealed == false) { var resetInfo = new ResetInfo(); resetInfo.Category = Category; resetInfo.Layer = GameObject.Layer; resetInfo.Scene = GameObject.Scene; resetInfo.Position = GameObject.Position; resetInfo.Name = GameObject.Name; resetInfo.Facing = GetComponent <AnimationComponent>().Facing; resetInfo.IsPlayer = GetComponent <PlayerInput>() != null; SceneInfo.ResetInfos.Add(resetInfo); ResetInfoIdx = SceneInfo.ResetInfos.Count - 1; _resetHealth = Health; } }
public async Task <ActionResult> IndexAsync(ResetInfo model) { object token = Session["Token"]; if (token == null) { return(Redirect("/")); } if (model.Token != token.ToString()) { return(Redirect("/")); } model.Browser = this.RemoteUser.Browser; model.IpAddress = this.RemoteUser.IpAddress; if (DAL.Reset.HasActiveResetRequest(model.Email)) { return(Json(true)); } DTO.Reset result = DAL.Reset.Request(model); if (result.UserId <= 0) { return(Redirect("/")); } ResetEmail email = new ResetEmail(result); await email.SendAsync(); return(Json(true)); }
public async Task <ActionResult> IndexAsync(ResetInfo model) { var token = this.Session["Token"]; if (token == null) { return(this.Redirect("/")); } if (model.Token != token.ToString()) { return(this.Redirect("/")); } model.Browser = this.RemoteUser.Browser; model.IpAddress = this.RemoteUser.IpAddress; if (await ResetRequests.HasActiveResetRequestAsync(this.Tenant, model.Email).ConfigureAwait(false)) { return(this.Json(true)); } var result = await ResetRequests.RequestAsync(this.Tenant, model).ConfigureAwait(false); if (result.UserId <= 0) { return(this.Redirect("/")); } var email = new ResetEmail(result); await email.SendAsync(this.Tenant).ConfigureAwait(true); return(this.Json(true)); }
public static DTO.Reset Request(ResetInfo model) { string sql = FrapidDbServer.GetProcedureCommand("account.reset_account", new[] { "@0", "@1", "@2" }); return (Factory.Get <DTO.Reset>(AppUsers.GetTenant(), sql, model.Email, model.Browser, model.IpAddress) .FirstOrDefault()); }
public static DTO.Reset Request(ResetInfo model) { const string sql = "SELECT * FROM account.reset_account(@0::text, @1::text, @2::text);"; return (Factory.Get <DTO.Reset>(AppUsers.GetCatalog(), sql, model.Email, model.Browser, model.IpAddress) .FirstOrDefault()); }
public static async Task <Reset> RequestAsync(string tenant, ResetInfo model) { string sql = FrapidDbServer.GetProcedureCommand(tenant, "account.reset_account", new[] { "@0", "@1", "@2" }); return ((await Factory.GetAsync <Reset>(tenant, sql, model.Email, model.Browser, model.IpAddress).ConfigureAwait(false)) .FirstOrDefault()); }
public virtual void RunWithNewTempRoot(Type docType, Action a) { var snapshot = new ResetInfo(DocType, HasTranslatedId, HasTranslatedRev); try { DocType = docType; Level = 0; HasTranslatedId = false; HasTranslatedRev = false; a(); } finally { DocType = snapshot.DocType; HasTranslatedId = snapshot.HasTranslatedId; HasTranslatedRev = snapshot.HasTranslatedRev; } }