private void Awake() { animator = GetComponent <Animator>(); network = Service.Get <INetworkServicesManager>(); targetSpeed = animator.speed; animationLengthsMS = new int[animator.layerCount]; }
private void Start() { network = Service.Get <INetworkServicesManager>(); localizer = Service.Get <Localizer>(); DateDefinition = Service.Get <IGameData>().Get <Dictionary <int, ScheduledEventDateDefinition> >()[DateDefinition.Id]; CheckWithinDateRange(); }
public IglooMediator(EventDispatcher eventDispatcher, CPDataEntityCollection dataEntityCollection, SceneLayoutDataManager sceneLayoutDataManager, SceneLayoutSyncService sceneLayoutSyncService, INetworkServicesManager networkServicesManager) { this.dataEntityCollection = dataEntityCollection; this.networkServicesManager = networkServicesManager; eventDispatcher.AddListener <PlayerStateServiceEvents.LocalPlayerDataReceived>(onLocalPlayerDataReceived); eventDispatcher.AddListener <IglooUIEvents.AddNewDecoration>(onAddNewDecoration); eventDispatcher.AddListener <IglooUIEvents.AddNewStructure>(onAddNewStructure); eventDispatcher.AddListener <IglooUIEvents.DuplicateSelectedObject>(onDuplicateSelectedObject); eventDispatcher.AddListener <IglooUIEvents.ClearCurrentLayout>(onClearCurrentLayout); layoutManager = sceneLayoutDataManager; layoutSyncService = sceneLayoutSyncService; layoutSyncService.AddExtraLayoutInfoLoader(loadSittingLocations); eventDispatcher.AddListener <ZoneTransitionEvents.ZoneTransition>(onZoneTransition); eventDispatcher.AddListener <WorldServiceEvents.SelfRoomJoinedEvent>(onIglooJoined); eventDispatcher.AddListener <IglooServiceEvents.ForceLeave>(onForceLeave, EventDispatcher.Priority.FIRST); eventDispatcher.AddListener <IglooServiceEvents.IglooLayoutCreated>(onIglooCreated, EventDispatcher.Priority.FIRST); eventDispatcher.AddListener <IglooServiceEvents.IglooDataUpdated>(onIglooDataUpdated, EventDispatcher.Priority.FIRST); eventDispatcher.AddListener <IglooServiceEvents.IglooLayoutUpdated>(onIglooLayoutUpdated, EventDispatcher.Priority.FIRST); eventDispatcher.AddListener <IglooServiceEvents.IglooLayoutDeleted>(onIglooLayoutDeleted, EventDispatcher.Priority.FIRST); eventDispatcher.AddListener <ObjectManipulationEvents.RemovingStructureWithItemsEvent>(onRemovingStructureWithItems); eventDispatcher.AddListener <IglooEvents.ChangeZone>(onChangeZone); eventDispatcher.AddListener <IglooEvents.ReloadLayout>(onReloadLayout); eventDispatcher.AddListener <IglooEvents.PlayIglooSound>(onPlayPlacedDecorationSoundEffect); eventDispatcher.AddListener <SceneLayoutEvents.SceneMaxItemsEvent>(onSceneMaxItemsEncountered); eventDispatcher.AddListener <IglooUIEvents.MaxItemsLimitReached>(onMaxLayoutItemsReached); DataEntityHandle activeHandle = layoutManager.GetActiveHandle(); dataEntityCollection.Whenever <SceneLayoutData>(activeHandle, onLayoutAdded, onLayoutRemoved); }
private IEnumerator loadIglooEntity(INetworkServicesManager network, SavedIgloosMetaData savedIgloosMetaData) { yield return(null); network.IglooService.UpdateIglooData(savedIgloosMetaData.IglooVisibility, savedIgloosMetaData.ActiveIglooId); foreach (SavedIglooMetaData savedIgloo in savedIgloosMetaData.SavedIgloos) { network.IglooService.GetIglooLayout(savedIgloo.LayoutId); } }
private void completeObjective(string name) { bool flag = !serverControlledAllTimeCompletedObjectives.Contains(name); INetworkServicesManager networkServicesManager = Service.Get <INetworkServicesManager>(); if (networkServicesManager != null && allObjectiveNames.Contains(name) && flag && !Definition.Prototyped) { networkServicesManager.QuestService.CompleteObjective(name); serverControlledAllTimeCompletedObjectives.Add(name); } }
private bool onLocalPlayerDataReady(NetworkControllerEvents.LocalPlayerDataReadyEvent evt) { if (offlineDatabase.Read <CustomEquipmentCollection>().Equipment.Count == 0) { INetworkServicesManager network = Service.Get <INetworkServicesManager>(); network.InventoryService.GetEquipmentInventory(); network.IglooService.GetDecorations(); dataEntityCollection.When(dataEntityCollection.LocalPlayerHandle, delegate(SavedIgloosMetaData savedIgloosMetaData) { CoroutineRunner.StartPersistent(loadIglooEntity(network, savedIgloosMetaData), this, "loadIglooEntity"); }); } return(false); }
public DateTime PresentTime() { if (Service.IsSet <INetworkServicesManager>()) { INetworkServicesManager networkServicesManager = Service.Get <INetworkServicesManager>(); if (networkServicesManager.GameTimeMilliseconds > 0) { return(networkServicesManager.ServerDateTime); } } if (DateTime.Now.IsDaylightSavingTime()) { return(DateTime.UtcNow.AddHours(FallbackTimeOffsetHours + 1)); } return(DateTime.UtcNow.AddHours(FallbackTimeOffsetHours)); }
public NetworkController(MonoBehaviour ctx, bool offlineMode) { loginController = Service.Get <LoginController>(); NetworkServicesConfig networkServicesConfig = GenerateNetworkServiceConfig(developmentEnvironment); Service.Set((INetworkServicesManager) new NetworkServicesManager(ctx, networkServicesConfig, offlineMode)); dataEntityCollection = Service.Get <CPDataEntityCollection>(); mixCriticalAlertLevel = networkServicesConfig.MixCritialAlertLevel; eventDispatcher = Service.Get <EventDispatcher>(); networkServicesManager = Service.Get <INetworkServicesManager>(); sessionManager = Service.Get <SessionManager>(); loginController.SetNetworkConfig(networkServicesConfig); Service.Get <MixLoginCreateService>().SetNetworkConfig(networkServicesConfig); dataEntityCollection.ResetLocalPlayerHandle(); addListeners(); }
private void Start() { if (isSetupCorrect) { network = Service.Get <INetworkServicesManager>(); if (Service.Get <GameStateController>().IsFTUEComplete) { syncGameState(); return; } PlatformObject.SetActive(value: false); BuoyObject.SetActive(value: false); HelpSign.SetActive(value: false); eventChannel.AddListener <QuestEvents.QuestUpdated>(onQuestUpdated); } }
private void Start() { locomotionTracker = GetComponent <LocomotionTracker>(); locomotionEventBroadcaster = GetComponent <LocomotionEventBroadcaster>(); locomotionEventBroadcaster.OnDoActionEvent += sendDoActionEvent; locomotionEventBroadcaster.OnLocomotionStateChangedEvent += sendLocomotionStateChangedEvent; locomotionEventBroadcaster.OnInteractionStartedEvent += filterSendInteractionEvent; locomotionEventBroadcaster.OnSteerDirectionEvent += onSteerDirectionChanged; locomotionEventBroadcaster.OnSteerRotationDirectionEvent += onSteerRotationDirectionChanged; locomotionEventBroadcaster.OnSteerRotationFlushEvent += onSteerRotationFlush; locomotionEventBroadcaster.OnControllerChangedEvent += onControllerChanged; locomotionEventBroadcaster.OnControlsLocked += onControlsLocked; locomotionEventBroadcaster.OnControlsUnLocked += onControlsUnLocked; networkService = Service.Get <INetworkServicesManager>(); Service.Get <EventDispatcher>().AddListener <WorldServiceEvents.SelfWillLeaveRoomEvent>(onUserLeaving); Service.Get <EventDispatcher>().AddListener <WorldServiceEvents.SelfRoomJoinedEvent>(onUserJoined); }
private void Start() { bool flag = false; networkServiceManager = Service.Get <INetworkServicesManager>(); Button componentInParent = GetComponentInParent <Button>(); if (componentInParent != null) { trayInputButton = componentInParent.GetComponent <TrayInputButton>(); tooltipInputButton = componentInParent.gameObject.AddComponent <TooltipInputButton>(); Transform transform = findLayoutPanel(); if (transform != null) { baitUI = transform.Find("BaitUI").gameObject; baitText = baitUI.GetComponentInChildren <Text>(); clock = transform.Find("ClockPanel").gameObject; clock.SetActive(value: false); timerTooltip = transform.Find("Tooltip").gameObject; timerText = timerTooltip.transform.Find("TimerText").GetComponent <Text>(); timerTooltip.GetComponent <Button>().onClick.AddListener(onTooltipClicked); tooltipInputButton.TooltipAnimator = timerTooltip.GetComponent <Animator>(); tooltipInputButton.TooltipEnabled = false; SubscribeToEvents(); updateTimer = new Timer(1f, repeat: true, delegate { OnTimerTick(); }); CoroutineRunner.Start(updateTimer.Start(), this, "FishingButtonTimer"); updateBaitUI(); flag = true; } } if (!flag) { Log.LogError(this, "Failed to find all the UI components required to initialize FishingButtonUIUpdater. Aborting"); } }
private void Start() { networkServiceManager = Service.Get <INetworkServicesManager>(); rootStateMachine = GetComponent <StateMachine>(); }
private void OnEnable() { network = Service.Get <INetworkServicesManager>(); }
public override void Awake() { base.Awake(); network = Service.Get <INetworkServicesManager>(); }