public ActionResult Destiny1Index(bool noLayout = false) { if (Destiny1Cache == null || Destiny1Cache.CacheExpired) { Destiny1Cache = new HeroicDailyModel { DailyMission = DailyManager.GetDaily() }; if (Destiny1Cache.DailyMission != null) { Destiny1Cache.DailyModifiers = DailyManager.GetModifiers(Destiny1Cache.DailyMission.missionid); Destiny1Cache.DailyRewards = DailyManager.GetRewards(Destiny1Cache.DailyMission.missionid); } var bounties = BountyManager.GetBounties(); if (bounties != null && bounties.Any()) { Destiny1Cache.DailyBounties = bounties; } Destiny1Cache.TimeDifferenceTime = DailyManager.TodayDate; Destiny1Cache.ExpiryTime = DateTime.Now.AddHours(1); Destiny1Cache.StartTime = DateTime.Now; } if (noLayout) { return(View("Destiny1/PartialIndex", Destiny1Cache)); } ViewBag.HtmlTagOverride = @"data-redirect=""/#daily"""; return(View("Destiny1/Index", Cache)); }
private void Awake() { if (instance == null) { instance = this; } dailyPanel.OnRightClickEvent += RecieveReward; }
/// <summary> /// Send message for the specified chat Id /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { _chatAccess.SendMessage(TextBox.Text, _currentChatId, _user.UserToken); TextBox.Focus(); TextBox.Text = ""; // Daily chat DailyManager.AchieveDaily(EnumsModel.DailyType.ChatOnce); }
/// <summary> /// Check key input in chat box to send the data to the server on a enter key press /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TextBox_KeyDown(object sender, KeyEventArgs e) { if (e.Key != Key.Enter || !(sender is TextBox)) { return; } _chatAccess.SendMessage(((TextBox)sender).Text, _currentChatId, _user.UserToken); TextBox.Text = ""; // Daily chat DailyManager.AchieveDaily(EnumsModel.DailyType.ChatOnce); }
public void Init() { MapObjectMgr = GlobalEnvironment.Instance.Get <MapObjectManager>(); RepresentMgr = GlobalEnvironment.Instance.Get <RepresentManager>(); DailyMgr = GlobalEnvironment.Instance.Get <DailyManager>(); ResourceGameObjectPool = new Dictionary <string, Stack <GameObject> >(); MapObjectResPathDict = new Dictionary <int, string>(); AllMapObjectList = new List <MapObject>(); MapObjctParent = new GameObject("MapObjct"); }
public override void Execute() { MapObjectAttribute mapOjectAttribute = Info.mapObject.GetAttribute <MapObjectAttribute>(); if (mapOjectAttribute.Hp <= 0) { return; } DailyManager dailyManager = GlobalEnvironment.Instance.Get <DailyManager>(); dailyManager.RegisterDailyAction(Info.mapObject, Info.dailyAction); }
private void TabItem_MouseUp(object sender, MouseButtonEventArgs e) { var inputDialog = new ChatCanalInputWindow("Entrez le nom du nouveau canal:"); if (inputDialog.ShowDialog() == true) { var result = inputDialog.Answer; // Send message to create new canal _chatAccess.CreateNewCanal(result, _user.UserToken); // Daily create canal DailyManager.AchieveDaily(EnumsModel.DailyType.CreateCanal); } }
public ProfileEditMenu() { InitializeComponent(); _eventManager = EventManager.Instance; _profileAccess = ProfileAccess.Instance; _profile = Profile.Instance; InitialiseVisual(); // Daily DailyManager.AchieveDaily(EnumsModel.DailyType.UpdateProfile); // Change Title MainWindow.Instance.SwitchTitle("Édition Profile"); }
/// <summary> /// 初始化控件 /// </summary> public void InitControl() { var dailyManager = new DailyManager(); //获取前5条文章列表 var dailyList = dailyManager.GetTopList(5, " Blog_Guid='" + BlogGuid + "' and Is_Home = 1 ", " Is_Stick desc, Create_Time desc "); if (dailyList.Count < 5) { ReadMoreVisible = "display:none"; } rptDaily.DataSource = dailyList; rptDaily.DataBind(); }
private void SetFriendship(IEnumerable selectedItems, bool friend) { foreach (var index in from string selectedItem in selectedItems where selectedItem != null select _users.FirstOrDefault(x => x.Username == selectedItem) into user where user != null select _users.IndexOf(user)) { _users[index].AreFriend = friend; } UpdateFriends(); InitializeUsersList(); // Daily to add friend if (friend) { DailyManager.AchieveDaily(EnumsModel.DailyType.AddFriend); } }
private void BindData() { var dailyBll = new DailyManager(); int recordCount; var strWhere = ""; var blog = HttpContext.Current.Session["BlogInfo"] as BlogInfo; if (blog != null) { strWhere += " Blog_Guid='" + blog.Guid + "'"; } var list = dailyBll.GetList(PageIndex, PageSize, out recordCount, strWhere, "Create_Time desc"); base.BindRepeater(recordCount, list); }
private void StartBtn_Click(object sender, RoutedEventArgs e) { if (_config.SingleMapConfig.SelectedZone == null) { MessageHelper.ShowMessage("Patiente petite!", "Tu dois d'abord sélectionner une danse(carte)"); return; } // Daily DailyManager.AchieveDaily(EnumsModel.DailyType.PlayFastGame); if (_config == null) { throw new NullReferenceException("The config parameter should be set with SetContect() and therefor should not be null"); } EventManager.Instance.Notice(new CreateGameRequestEvent() { Config = _config }); }
private void StartBtn_Click(object sender, RoutedEventArgs e) { if (_config.MapConfig.SelectedZones.Count <= 1) { MessageHelper.ShowMessage("Une long bal demande préparation", "Tu dois sélectionner au moins 2 danses (cartes)"); return; } // Daily DailyManager.AchieveDaily(EnumsModel.DailyType.PlayCampain); if (_config == null) { throw new NullReferenceException("The config parameter should be set with SetContect() and therefor should not be null"); } EventManager.Instance.Notice(new CreateGameRequestEvent() { Config = _config }); }
public DailyController() { DailyManager = new DailyManager(); BountyManager = new BountyManager(); }
private void SetupProfile() { Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() => { // enter information from _currentProfile if (_profile.Description.Length > 100) { Description.Text = _profile.Description.Substring(0, 100) + " ... "; } else { Description.Text = _profile.Description; } Username.Content = _profile.Username; // Title var princessRank = _profile.PrincessTitle; PrincessRank.Content = _profile.PrincessTitle.ToString(); InitImageRectangle(GetRankBitmap(princessRank), PrincessRankImg); // Set stats var stats = new Dictionary <EnumsModel.Stats, int>(); if (_friendProfile) { stats = ProfileModelHelper.GetStats(_profile); } else { stats = StatsManager.CurrentUserStats; } if (stats.ContainsKey(EnumsModel.Stats.SucessUnlocked)) { Sucessunlocked.Content = stats[EnumsModel.Stats.SucessUnlocked] + " %"; } if (stats.ContainsKey(EnumsModel.Stats.TotalGamePlayed)) { GamePlayed.Content = stats[EnumsModel.Stats.TotalGamePlayed]; } if (stats.ContainsKey(EnumsModel.Stats.TotalGameWon)) { GameWon.Content = stats[EnumsModel.Stats.TotalGameWon]; } if (stats.ContainsKey(EnumsModel.Stats.TotalMapCreated)) { MapCreated.Content = stats[EnumsModel.Stats.TotalMapCreated]; } if (stats.ContainsKey(EnumsModel.Stats.TotalPoints)) { Points.Content = stats[EnumsModel.Stats.TotalPoints]; } if (stats.ContainsKey(EnumsModel.Stats.TotalTimePlayed)) { TimeInGame.Content = stats[EnumsModel.Stats.TotalTimePlayed]; } // Set Achievements Dictionary <EnumsModel.Achievement, bool> achievements = null; if (_friendProfile) { achievements = ProfileModelHelper.GetAchievements(_profile); } else { achievements = AchievementManager.CurrentUserAchievements ?? new Dictionary <EnumsModel.Achievement, bool>(); } if (achievements.ContainsKey(EnumsModel.Achievement.FirstTimeConnect) && achievements[EnumsModel.Achievement.FirstTimeConnect]) { LoginImageLock.Visibility = Visibility.Collapsed; } if (achievements.ContainsKey(EnumsModel.Achievement.AddAvatar) && achievements[EnumsModel.Achievement.AddAvatar]) { AvatarImageLock.Visibility = Visibility.Collapsed; } if (achievements.ContainsKey(EnumsModel.Achievement.FastGamePoints) && achievements[EnumsModel.Achievement.FastGamePoints]) { FastGameLock.Visibility = Visibility.Collapsed; } if (achievements.ContainsKey(EnumsModel.Achievement.GamePoints) && achievements[EnumsModel.Achievement.GamePoints]) { GameLock.Visibility = Visibility.Collapsed; } if (achievements.ContainsKey(EnumsModel.Achievement.FirstOnlineGame) && achievements[EnumsModel.Achievement.FirstOnlineGame]) { NetworkLock.Visibility = Visibility.Collapsed; } if (achievements.ContainsKey(EnumsModel.Achievement.FirstMapCreated) && achievements[EnumsModel.Achievement.FirstMapCreated]) { Maplock.Visibility = Visibility.Collapsed; } if (achievements.ContainsKey(EnumsModel.Achievement.FirstOnlineGameWon) && achievements[EnumsModel.Achievement.FirstOnlineGameWon]) { GameWonOnceLock.Visibility = Visibility.Collapsed; } if (achievements.ContainsKey(EnumsModel.Achievement.PlayWithAFriend) && achievements[EnumsModel.Achievement.PlayWithAFriend]) { FriendZoneLock.Visibility = Visibility.Collapsed; } if (achievements.ContainsKey(EnumsModel.Achievement.FinishCampain) && achievements[EnumsModel.Achievement.FinishCampain]) { CampainDoneLock.Visibility = Visibility.Collapsed; } if (achievements.ContainsKey(EnumsModel.Achievement.FinishOtherSucess) && achievements[EnumsModel.Achievement.FinishOtherSucess]) { AchievementAllLock.Visibility = Visibility.Collapsed; } // Profile Picture var profilePic = _profile.Picture; ProfileImg.Source = ImageHelper.LoadBitmap(GetAvatarBitmap(profilePic)); // Public / Private InitImageRectangle(GetPrivateBitmap(_profile.IsPrivate), PrivateImage); // Experience var experience = "Expérience : " + _profile.Experience + "/" + ProgressManager.LevelExperience[_profile.Level]; PlayerExperience.Content = experience; // Daily if (_friendProfile) { DailyDiv.Visibility = Visibility.Collapsed; } else { DailyDiv.Visibility = Visibility.Visible; DailyText.Text = "Le défis journalier est de : " + DailyManager.GetDailyDescription(Profile.Instance.Daily.DailyType); DailyDoneImage.Visibility = Profile.Instance.Daily.IsDone ? Visibility.Visible : Visibility.Collapsed; } // No modif if not our profile if (_friendProfile) { UserProfileButtons.Visibility = Visibility.Collapsed; SeeFriendsButton.Visibility = Visibility.Collapsed; FriendProfileButtons.Visibility = Visibility.Visible; } else { UserProfileButtons.Visibility = Visibility.Visible; SeeFriendsButton.Visibility = Visibility.Visible; FriendProfileButtons.Visibility = Visibility.Collapsed; } })); }