private async void GetUserTier(UserTier userTier) { view.Init(userTier); var countOpenWords = 0; foreach (var word in levelData.words) { if (word.IsOpened) { countOpenWords++; } } Debug.Log("IsAvailable = " + userTier.IsAvailable); Debug.Log("levelData = " + levelData.CheckCompleteOtherWords()); if (!userTier.IsAvailable) { if (countOpenWords == 0) { activeGrafic = true; view.ActiveGrafic(true); await popupManager.ShowPopup(UI.PopupNames.DAILY_PUZZELES_COME_BACK_LATER, null); } } }
public async void Init(UserTier userTier) { TiersResponse tiersResponse = await client.GetTiersSettings(); for (int i = 0; i < tiers.Length; i++) { Tier tier = tiersResponse.Entities[i]; Debug.Log("tier = " + tier); if (tier.Id == userTier.Tier.Id) { tiers[i].Init(i, userTier.Trophies, tier.Trophies, tier.Reward.Amount, false, tiers); } else if (tier.Id < userTier.Tier.Id) { tiers[i].Init(i, tier.Trophies, tier.Trophies, tier.Reward.Amount, false, tiers); } else { tiers[i].Init(i, 0, tier.Trophies, tier.Reward.Amount, true, tiers); } } //For local Testing //for (int i = 0; i < 4; i++) //{ // Tier tier = tiersResponse.Entities[i]; // if (i == 0) // tiers[i].Init(i, 5, 5, 10, false, tiers); // else if (i == 1) // tiers[i].Init(i, 4, 5, 25, false, tiers); // else // tiers[i].Init(i, 0, 10, 30, true, tiers); //} TierView notFullTier = tiers.FirstOrDefault(t => !t.IsFull); if (notFullTier == null) { next.gameObject.SetActive(true); } next.OnClickAsObservable().Subscribe(_ => Next()).AddTo(this); backButton.OnClickAsObservable().Subscribe(_ => BackToMainMenu()).AddTo(this); }
protected void btnSubmit_Click(object sender, EventArgs e) { //take content in session (assigned from UseReg page) Users user = (Users)Session["NewUserInfo"]; Session["UserID"] = null; //add user to database thru function in usertier UserTier theTier = new UserTier(); theTier.insertUser(user); //take username info to assign to session variable later Users me = new Users(); me.user_id = Int32.Parse(theTier.getIdByUser(user.username)); Session["UserID"] = me; Session["NewUserInfo"] = null; Response.Redirect("UserDefault.aspx"); }
protected void btnSubmit_Click(object sender, EventArgs e) { Users user = new Users(); UserTier theTier = new UserTier(); //see if username already exists to avoid duplicate usernames bool exists = theTier.userExists(txtUn.Text); if (exists == true) { Response.Write("<script>alert('This username already exists')</script>"); } //if username is unique, see if password entries match each other for safety else { //if passwords match //create item with user input and assign it to session variable to make accessible by confirmation page if (txtPass.Text == txtPass2.Text) { user.first_name = txtFn.Text; user.last_name = txtLn.Text; user.username = txtUn.Text; user.password = txtPass.Text; //default user type to user user.type = "user"; Session["NewUserInfo"] = user; Response.Redirect("ConfirmUser.aspx"); } else { Response.Write("<script>alert('Passwords must match')</script>"); } } }