void OnUpdateList() { if (null == m_PVPFindList) { return; } FindTips.SetActive(false); Utils.CleanGrid(m_OpListGrid); m_curSelectItem = null; foreach (ulong opInfoKey in PVPData.OpponentMap.Keys) { PVPOpListItem item = PVPOpListItem.CreateItem(m_OpListGrid, m_PVPFindList, opInfoKey.ToString(), this, PVPData.OpponentMap[opInfoKey]); if (null == m_curSelectItem) { OnOpItemClick(item); } } m_OpListGrid.GetComponent <UIGrid>().Reposition(); m_OpListGrid.GetComponent <UITopGrid>().Recenter(true); // 新手指引 if (ActivityController.Instance()) { if (35 == ActivityController.Instance().NewPlayerGuide_Step) { if (PVPData.OpponentMap.Count > 0 && m_OpListGrid.transform.childCount > 0) { PVPOpListItem temPVPOpListItem = m_OpListGrid.transform.GetChild(0).gameObject.GetComponent <PVPOpListItem>(); if (temPVPOpListItem) { temPVPOpListItem.NewGuildPvp(); } } ActivityController.Instance().NewPlayerGuide_Step = -1; } } // CurOpInfo.SetActive(PVPData.OpponentMap.Count > 0); #if BOBJOYSTICK UIRootJoyControllerHelper.Instance.ACT_JIANGHU_SUBSTATE = UIRootJoyControllerHelper.ActJianghuSubState.ACT_JIANGHU_PIPEI; UIRootJoyControllerHelper.Instance.ACT_SUBSTAT = UIRootJoyControllerHelper.ActivitySubState.ACT_UI_JIANGHU; #endif // 新手指引 /* if (ActivityController.Instance()) * { * if (1 == ActivityController.Instance().NewPlayerGuide_Step) * { * if (PVPData.OpponentMap.Count > 0) * { * NewPlayerGuidLogic.OpenWindow(m_FightButton, 200, 70, "", "left", 0, true, true); * } * ActivityController.Instance().NewPlayerGuide_Step = -1; * } * } * */ }
public void DetailsHasHttpGetAttribute() { var sut = new ActivityController(null, null); var attribute = sut.GetAttributesOn(x => x.Details(It.IsAny <int>())).OfType <HttpGetAttribute>().SingleOrDefault(); Assert.NotNull(attribute); }
/// <summary> /// /// </summary> /// <param name="bSuccess"></param> /// <param name="param"></param> void ChangeToCopyScene(bool bSuccess, object param) { if (ActivityController.Instance()) { ActivityController.Instance().m_TabDungeon.ChangeTab("Tab8"); } }
public static void ShowRegisterMemberList(GC_HUASHAN_PVP_MEMBERLIST msg) { RegisterMemberList.Clear(); HuaShanPosition = msg.SelfPos; // if (msg.guidCount <= 0) { if (null != ActivityController.Instance()) { ActivityController.Instance().ChangeToHSPvPShowDefault(); } } else { if (null != ActivityController.Instance()) { ActivityController.Instance().ChangeToHSPvPShowMemberList(); } for (int i = 0; i < msg.guidCount; i++) { RegisterMemberList.Add(new RegisterMemberInfo( msg.GetGuid(i), msg.GetName(i), (CharacterDefine.PROFESSION)msg.GetProfession(i), msg.GetLevel(i), msg.GetCombatnum(i), msg.GetPos(i))); } // .... if (null != delegateShowRegisterMemberList) { delegateShowRegisterMemberList(); } } }
public uint Execute(PacketDistributed ipacket) { GC_WORLDBOSS_OPEN packet = (GC_WORLDBOSS_OPEN )ipacket; if (null == packet) return (uint)PACKET_EXE.PACKET_EXE_ERROR; //enter your logic HuaShanPVPData.WorldBossOpen = 0; WorldMapWindow.WorldBossOpen = 0; if (packet.State == 2) { HuaShanPVPData.WorldBossOpen = 1; WorldMapWindow.WorldBossOpen = 1; } if ( packet.State == 3) { HuaShanPVPData.WorldBossOpen = 1; } if (FunctionButtonLogic.Instance() != null) FunctionButtonLogic.Instance().OnWorldBossStateChange(packet.State); if (ActivityController.Instance() != null) { ActivityController.Instance().UpdateWorldBossState(); } return (uint)PACKET_EXE.PACKET_EXE_CONTINUE; }
public uint Execute(PacketDistributed ipacket) { GC_RET_AUTOTEAM packet = (GC_RET_AUTOTEAM)ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } //enter your logic GameManager.gameManager.PlayerDataPool.AutoTeamState = packet.Result == (int)GC_RET_AUTOTEAM.RESULTTYPE.TYPE_WAIT; if (packet.HasSceneid) { GameManager.gameManager.PlayerDataPool.AutoTeamCopySceneId = packet.Sceneid; } if (packet.HasDifficult) { GameManager.gameManager.PlayerDataPool.AutoTeamCopySceneDifficult = packet.Difficult; } if (DungeonWindow.Instance() != null) { DungeonWindow.Instance().OnButtonAutoTeamLabel(); } if (FunctionButtonLogic.Instance() != null) { FunctionButtonLogic.Instance().UpdateAutoTeamCue(); } if (ActivityController.Instance() != null) { ActivityController.Instance().UpdateAutoTeam(); } if (CangJingGeWindow.Instance() != null) { CangJingGeWindow.Instance().UpdateButtonAutoTeamLabel(); } if (packet.Result == (int)GC_RET_AUTOTEAM.RESULTTYPE.TYPE_FINISH) { /*if (packet.Sceneid == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_FOURVILLAIN) * { * //四大恶人副本在组队平台组好队伍之后,不直接开启副本 * return (uint)PACKET_EXE.PACKET_EXE_CONTINUE; * }*/ if (packet.HasSceneid) { m_nSceneID = packet.Sceneid; } if (packet.HasDifficult) { m_nDifficult = packet.Difficult; } Tab_SceneClass pSceneClass = TableManager.GetSceneClassByID(m_nSceneID, 0); if (pSceneClass != null) { string strNaDu = StrDictionary.GetClientDictionaryString("#{" + CharacterDefine.COPYSCENE_DIFFICULTY[m_nDifficult - 1].ToString() + "}"); string dicStr = StrDictionary.GetClientDictionaryString("#{2958}", strNaDu, pSceneClass.Name); MessageBoxLogic.OpenOKCancelBox(dicStr, "", OpenCopySceneOK, OpenCopySceneNO); } } return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }
private void InitializeMovie(Image image, int id) { movieImage.Image = image; _movie = MovieController.MovieViewerQuery(id); titleLabel.Text = _movie.Name; descriptionText.Text = _movie.Description; directorValueLabel.Text = _movie.Director; writerValueLabel.Text = _movie.Writer; starsValueLabel.Text = _movie.Stars; dateValueLabel.Text = _movie.ReleaseDate; genreValueLabel.Text = _movie.Genre; _starsCount = _movie.Rating; SetStars(); if (ActivityController.IsActivityType("favorite", id)) { FillImage(favoriteImage, _favorite); } if (ActivityController.IsActivityType("history", id)) { FillImage(watchedImage, _watched); } if (ActivityController.IsActivityType("watchlist", id)) { FillImage(watchlistImage, _watchlist); } }
public void CreateActivityWithNoName_ShouldReturnModelStateNotValid() { var controller = new ActivityController(_activityManager, _personManager, _utilityManager); var model = new ActivityViewModel() { Name = "" }; //Init ModelState var modelBinder = new ModelBindingContext() { ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType( () => model, model.GetType()), ValueProvider = new NameValueCollectionValueProvider( new NameValueCollection(), CultureInfo.InvariantCulture) }; var binder = new DefaultModelBinder().BindModel( new ControllerContext(), modelBinder); controller.ModelState.Clear(); controller.ModelState.Merge(modelBinder.ModelState); var controllerResult = controller.CreateActivity(model); ViewResult result = (ViewResult)controllerResult; Assert.IsTrue(result.ViewData.ModelState["Name"].Errors.Count > 0); Assert.IsTrue(!result.ViewData.ModelState.IsValid); }
internal virtual bool Rebind(ActivityController activityController) { activityController.StartConnection(); try { this.localPushServerProxy.ResyncSession(); return(true); } catch (PushServerException exception) { protLogger.Debug("Error in rebinding to the session", exception); sessionLogger.Error("Error while trying to rebind to session " + this.localPushServerProxy.SessionId); this.serverListener.OnFailure(exception); } catch (PushConnException exception2) { streamLogger.Debug("Error in connection", exception2); sessionLogger.Error("Error while trying to rebind to session " + this.localPushServerProxy.SessionId); this.serverListener.OnFailure(exception2); } catch (PhaseException) { sessionLogger.Info("Listening loop closed for session " + this.localPushServerProxy.SessionId); } finally { activityController.StopConnection(); } return(false); }
void SetCopySceneNumberEx(int nSceneClassID, CopySceneNumberEx copyInfo /* int nDayCount, int nDayTeamCount, int nTotalCount1, int nTotalCount2, int nTotalCount3, int nTeamTotalCount1, int nTeamTotalCount2, int nTeamTotalCount3, int nMultiple*/) { //m_CopySceneNumberEx // CopySceneNumberEx info; if (m_CopySceneNumberEx.ContainsKey(nSceneClassID)) { m_CopySceneNumberEx[nSceneClassID] = copyInfo; } else { m_CopySceneNumberEx.Add(nSceneClassID, copyInfo); } if (DungeonWindow.Instance() != null) { DungeonWindow.Instance().UpdateCopySceneInfo(nSceneClassID); } if (ActivityController.Instance() != null) { ActivityController.Instance().UpdateTabTips(false); } if (FunctionButtonLogic.Instance()) { FunctionButtonLogic.Instance().UpdateActionButtonTip(); } if (RebuyWindow.Instance()) { RebuyWindow.Instance().UpdateData(); } }
void OpenUI(Tab_UIPath uiPath) { if (UIPathData.m_DicUIInfo.ContainsKey(uiPath.Path)) { UIPathData curData = UIPathData.m_DicUIInfo[uiPath.Path]; // 科技院单独处理 if (uiPath.Path == "Prefab/UI/Restaurant") { RestaurantController.OpenWindow(true); } else { UIManager.ShowUI(curData, (bSuccess, param) => { if (!string.IsNullOrEmpty(uiPath.Param)) { switch (uiPath.Path) { case "Prefab/UI/ActivityController": ActivityController.Instance().m_HuoDongControl.ChangeTab(uiPath.Param); break; case "Prefab/UI/PartnerFrameRoot": PartnerFrameLogic.Instance().m_TabController.ChangeTab(uiPath.Param); break; } } }); } } }
void SetCommonData(int nIndex, int nValue) { if (nIndex < 0 || nIndex >= MAX_CHAR_COMMON_DATA_NUM) { LogModule.DebugLog("SetCommonData: Index out of Range!!!"); return; } int nData = m_CommonData[nIndex]; m_CommonData[nIndex] = nValue; // 特殊添加 其他 更改 加在 OnCommonDataChange()中 if (nIndex == (int)Games.UserCommonData.USER_COMMONDATA.CD_COPYSCENE_CANGJINGGE_SWEEP) { if (ActivityController.Instance() != null) { ActivityController.Instance().UpdateTabTips(); } if (FunctionButtonLogic.Instance()) { FunctionButtonLogic.Instance().UpdateActionButtonTip(); } if (CangJingGeWindow.Instance() != null) { CangJingGeWindow.Instance().UpdateInfo(); if (nData < nValue)//开始扫荡 { CangJingGeWindow.Instance().StartSweep(); } } } // 更新 操作 OnCommonDataChange(nIndex, nValue); }
public async Task Activity_Controller_Post_Should_Return_Accepted() { var busClientMock = new Mock <IBusClient>(); var controller = new ActivityController(busClientMock.Object); var userId = Guid.NewGuid(); controller.ControllerContext = new ControllerContext { HttpContext = new DefaultHttpContext { User = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, userId.ToString()), }, "test")) } }; var command = new CreateActivity { Id = Guid.NewGuid(), UserId = userId }; var result = await controller.Post(command); var contentResult = result.AsOrDefault <AcceptedResult>(); contentResult.Should().NotBeNull(); contentResult.Location.Should().IsSameOrEqualTo($"activity/{command.Id}"); }
public static void ShowOppoentViewInfo(GC_WULIN_OPPONENTVIEW msg) { if (null != ActivityController.Instance()) { ActivityController.Instance().ChangeToWuLinShowOppoentView(); } OppoViewInfo.Clean(); OppoViewInfo.guid = msg.Guid; OppoViewInfo.name = msg.Name; OppoViewInfo.profession = (CharacterDefine.PROFESSION)msg.Profession; OppoViewInfo.level = msg.Level; OppoViewInfo.combat = msg.Combatnum; OppoViewInfo.pos = msg.Pos; OppoViewInfo.hp = msg.Hp; OppoViewInfo.mp = msg.Mp; OppoViewInfo.atk = msg.Attack; OppoViewInfo.def = msg.Defense; OppoViewInfo.cri = msg.Critical; OppoViewInfo.spd = msg.Speed; OppoViewInfo.dge = msg.Dodge; if (null != delegateShowOpponentViewInfo) { delegateShowOpponentViewInfo(); } }
internal ServerManager(ConnectionInfo info, IServerListener asyncListener) { this.connInfo = info; this.localPushServerProxy = new PushServerProxy(info); this.activityController = new ActivityController(this); this.serverListener = asyncListener; }
public void ControllerHasAreaAuthorizeAttributeWithCorrectPolicy() { var sut = new ActivityController(null, null); var attribute = sut.GetAttributes().OfType <AuthorizeAttribute>().SingleOrDefault(); Assert.NotNull(attribute); Assert.Equal(attribute.Policy, "OrgAdmin"); }
internal ServerManager(ConnectionInfo info, IServerListener asyncListener) { this.connInfo = info; this.localPushServerProxy = new PushServerProxy(info); this.activityController = new ActivityController(this); this.mexParallelizer = new MessageParallelizer(this.mexBatchMonitor, this); this.serverListener = asyncListener; }
public void ControllerHasAreaAtttributeWithTheCorrectAreaName() { var sut = new ActivityController(null, null); var attribute = sut.GetAttributes().OfType <AreaAttribute>().SingleOrDefault(); Assert.NotNull(attribute); Assert.Equal(attribute.RouteValue, "Admin"); }
public void DetailsHasRouteAttributeWithCorrectRoute() { var sut = new ActivityController(null, null); var routeAttribute = sut.GetAttributesOn(x => x.Details(It.IsAny <int>())).OfType <RouteAttribute>().SingleOrDefault(); Assert.NotNull(routeAttribute); Assert.Equal(routeAttribute.Template, "Admin/Activity/Details/{id}"); }
public void OpenActivityWithIndex(int index) { if (m_bOpening) { return; } ActivityController.SetStartTab("Tab" + index); UIManager.ShowUI(UIInfo.Activity); }
public void Verify_ActivityIndex_Method_Is_Decorated_With_Authorize_Attribute() { ActivityController controller = new ActivityController(_activityManager, _personManager, _utilityManager); var type = controller.GetType(); var methodInfo = type.GetMethod("ActivityIndex", new Type[] { typeof(string) }); var attributes = methodInfo.GetCustomAttributes(typeof(AuthorizeAttribute), true); Assert.IsTrue(attributes.Any(), "No AuthorizeAttribute found on ActivityIndex(string searchString) method"); }
void CloseWindow() { UIManager.CloseUI(UIInfo.StoryCopySceneInfoRoot); UIManager.ShowUI(UIInfo.Activity); if (ActivityController.Instance() != null) { ActivityController.Instance().m_HuoDongControl.ChangeTab("Button2-JuQing"); } }
public void close() { UIManager.CloseUI(UIInfo.PvPShopRoot); //add 关闭pvpShop的时候,打开竞技场界面 gzq if (NewFunctionLogic.Instance() != null) { ActivityController.RequireOpenPVPTab(); NewFunctionLogic.Instance().OpenActivityWithIndex(3); } }
private void InitiateActivityWarning(Room room, ActivityVariety variety) { ActivityController activity = ahc.SearchByVariety(room, variety); if (activity == null) { return; } activity.ToggleWarning(true); }
public void TestInitialize() { var activityService = new Mock <IActivityService>().Object; var defaults = new Mock <IDefaults>().Object; var mapperConfig = new MapperConfiguration(config => { config.ConfigureMvc(); }); var mapper = mapperConfig.CreateMapper(); var tenantService = new Mock <ITenantService>().Object; _controller = new ActivityController(activityService, defaults, mapper, tenantService); }
public void Index_ShouldReturnViewResult() { // Arrange ActivityController controller = new ActivityController(_activityManager, _personManager, _utilityManager); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.IsNotNull(result); }
private dynamic InstanceActivityController(Mock <IActivityFacade> mockActivityFacade) { var controller = new ActivityController(mockActivityFacade.Object, _mockLogger.Object, _mockContextPersonStore.Object) { ControllerContext = new ControllerContext { HttpContext = _mockHttpContext.Object } }; return(controller); }
public static void UpdateChallengeReward(GC_CHALLENGE_REWARD data) { Obj_MainPlayer mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer; if (mainPlayer != null && data.IsLose > 0) { // int nPlayerMaxHP = mainPlayer.BaseAttr.MaxHP; /*if (PlayerFrameLogic.Instance() != null && //TT8816 * GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_WUDAOZHIDIAN) * { * PlayerFrameLogic.Instance().ChangeHP(0, nPlayerMaxHP); * }*/ } // TT7092 // if (data.IsLose != 1) ChallengeAutoShow = false; /*if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_WUDAOZHIDIAN) * { * if (false == GameManager.gameManager.MissionManager.IsHaveMission(38)) * { * ChallengeAutoShow = true; * } * }*/ ChallengeIsLose = data.IsLose; ChallengeSpirit = data.SpiritVal; ChallengeReputation = 0; if (data.HasReputationVal) { ChallengeReputation = data.ReputationVal; } //TT 4438 从竞技场退出后应该主动打开竞技场界面 if (GameManager.gameManager.ActiveScene.IsCopyScene() == false) //不是副本 { ActiveShowChallengeUI(); } else { ActivityController.RequireOpenPVPTab(); if (ChallengeIsLose == 0) { //胜利 ChallengeRewardLogic.ShowRewardUI((int)ChallegeRewardUIType.Challenge); } else { //失败 UIManager.ShowUI(UIInfo.FailRoot); } } //TT 4436 新需求 从竞技场中主动退出 在回到主场景时不再弹出竞技场结算界面 //ChallengeRewardLogic.ShowRewardUI((int)ChallegeRewardUIType.Challenge); }
public void RemoveActivity() { // Arrange var controller = new ActivityController(); // Act ViewResult result = controller.RemoveActivity() as ViewResult; // Assert Assert.IsNotNull(result); }
public void CanViewEdit() { // Arrange var controller = new ActivityController(); // Act ViewResult result = controller.Edit(1) as ViewResult; // Assert Assert.IsNotNull(result); }
public void CanViewDeleteConfirmed() { // Arrange var controller = new ActivityController(); // Act ViewResult result = controller.DeleteConfirmed(1) as ViewResult; // Assert Assert.IsNotNull(result); }
public void CanViewActivityDup() { // Arrange var controller = new ActivityController(); // Act ViewResult result = controller.Duplicate() as ViewResult; // Assert Assert.IsNotNull(result); }
public override void OnAppLoad() { Title = "Fitness Assistant"; ActivityController activityController = new ActivityController(); NavigationMap.Add("Activity", activityController); NavigationMap.Add("Activity/{Action}", activityController); NavigationMap.Add("Activity/{SeriesId}/{Action}", activityController); NavigationMap.Add("Activity/{WeekId},{DayId}/{Action}", activityController); NavigationMap.Add("Weeks", new WeeksListController()); NavigationMap.Add("Weeks/{WeekId}", new WeekController()); NavigationMap.Add("Day/{WeekId},{DayId}", new DayController()); NavigateOnLoad = "Activity"; }
internal virtual bool Rebind(ActivityController activityController) { activityController.StartConnection(false); try { this.localPushServerProxy.ResyncSession(); return true; } catch (PushEndException e) { streamLogger.Debug("Forced connection end", e); sessionLogger.Error("Connection forcibly closed by the Server while trying to rebind to session " + this.localPushServerProxy.SessionId); this.serverListener.OnEnd(e.EndCause); } catch (PushServerException e) { protLogger.Debug("Error in rebinding to the session", e); sessionLogger.Error("Error while trying to rebind to session " + this.localPushServerProxy.SessionId); this.serverListener.OnFailure(e); } catch (PushConnException e) { streamLogger.Debug("Error in connection", e); sessionLogger.Error("Error while trying to rebind to session " + this.localPushServerProxy.SessionId); this.serverListener.OnFailure(e); } catch (PhaseException) { sessionLogger.Info("Listening loop closed for session " + this.localPushServerProxy.SessionId); } finally { activityController.StopConnection(); } return false; }
internal virtual void WaitEvents() { long num = 0L; try { Lightstreamer.DotNet.Client.ServerUpdateEvent event2; bool flag; ActivityController activityController = new ActivityController(this); activityController.StartKeepalives(); sessionLogger.Info("Listening for updates on session " + this.localPushServerProxy.SessionId); goto Label_0162; Label_0038:; try { event2 = this.localPushServerProxy.WaitUpdate(activityController); } catch (PushServerException exception) { protLogger.Debug("Error in received data", exception); sessionLogger.Error("Error while listening for data in session " + this.localPushServerProxy.SessionId); this.serverListener.OnDataError(exception); goto Label_0162; } catch (PushLengthException exception2) { long holdingMillis = exception2.HoldingMillis; if (holdingMillis > 0L) { try { Thread.Sleep((int) holdingMillis); } catch (ThreadInterruptedException) { } } if (!this.Rebind(activityController)) { return; } activityController.StartKeepalives(); goto Label_0162; } ITableManager updatedTable = this.GetUpdatedTable(event2); if (updatedTable == null) { if (!this.localPushServerProxy.IsWindowCodeConsumed(event2.WinCode)) { this.serverListener.OnDataError(new PushServerException(1)); } } else { this.serverListener.OnUpdate(updatedTable, event2); } long totalBytes = this.localPushServerProxy.TotalBytes; this.serverListener.OnNewBytes(totalBytes - num); num = totalBytes; Label_0162: flag = true; goto Label_0038; } catch (PushConnException exception3) { streamLogger.Debug("Error in connection", exception3); sessionLogger.Error("Error while listening for data in session " + this.localPushServerProxy.SessionId); this.serverListener.OnFailure(exception3); } catch (PhaseException) { sessionLogger.Info("Listening loop closed for session " + this.localPushServerProxy.SessionId); } }
public QuantivComActivityControllerWrapper(ActivityController activityController) { ActivityController = activityController; }
public void CreateAnActivity() { var session = new SessionModel { FromTime = new TimeSpan(12, 00, 00), ToTime = new TimeSpan(14, 00, 00), VolunteersNeeded = 1 }; var sessions = new List<SessionModel> { session }; var createActivityModel = new CreateActivityModel { Information = "Henrik testar", Name = "Henrik", Date = DateTime.Now.AddDays(1), Sessions = sessions }; var activityController = new ActivityController(SecurityService, _activityRepository.Object, _teamRepository.Object, EmailServices.Object,null); var id = activityController.Create(createActivityModel) as ActionResult; }
private void CreateActivity() { ActivityController = ActivityControllerPooler.AllocateController(_controllerPool); Activity = ActivityController.StartActivity(_activityRef); }