Esempio n. 1
0
        private void SharedOnStageCompleted()
        {
            this.SharedTryClaimObject();

            this.currentStageDurationSeconds     = this.CalculateStageDurationSeconds(this.Character, isFirstStage: false);
            this.currentStageTimeRemainsSeconds += this.currentStageDurationSeconds;

            if (Api.IsServer)
            {
                this.protoHackableContainer.ServerOnHackingStage(
                    this.WorldObject,
                    this.Character);
            }

            if (Api.IsClient) // client will simply always progress until finished
            {
                // hacking progressed
                this.UpdateProgress();
                return;
            }

            // server-side code
            if (!this.WorldObject.IsDestroyed)
            {
                return;
            }

            Logger.Important(
                $"Hacking completed: {this.WorldObject} by {this.Character}");

            this.SetCompleted(isCancelled: false);
            HackingSystem.SharedActionCompleted(this.Character, this);
        }
Esempio n. 2
0
        public override void SharedUpdate(double deltaTime)
        {
            if (!HackingSystem.SharedCheckCanInteract(
                    this.Character,
                    this.WorldObject,
                    writeToLog: true))
            {
                this.AbortAction();
                return;
            }

            this.currentStageTimeRemainsSeconds -= deltaTime;
            if (this.currentStageTimeRemainsSeconds <= 0)
            {
                this.SharedOnStageCompleted();
            }

            this.UpdateProgress();
        }
Esempio n. 3
0
 protected override void AbortAction()
 {
     HackingSystem.SharedAbortAction(this.Character,
                                     this.WorldObject);
 }