public void OnViewClockTime(float dt) { if (--this.intervalSecondsLeft < 1) { GetPlayerPvpStatusCommand command = new GetPlayerPvpStatusCommand(new PlayerIdRequest { PlayerId = Service.CurrentPlayer.PlayerId }); Service.ServerAPI.Sync(command); this.intervalSecondsLeft = GameConstants.UNDER_ATTACK_STATUS_CHECK_INTERVAL; if (this.intervalSecondsLeft == 0) { this.intervalSecondsLeft = 15; } } else if (--this.totalSecondsLeft < 1) { Service.Engine.Reload(); this.Close(null); } else { this.timeCountLabel.Text = GameUtils.GetTimeLabelFromSeconds(this.totalSecondsLeft); } }
public void OnViewClockTime(float dt) { int num = this.intervalSecondsLeft - 1; this.intervalSecondsLeft = num; if (num < 1) { GetPlayerPvpStatusCommand command = new GetPlayerPvpStatusCommand(new PlayerIdRequest { PlayerId = Service.Get <CurrentPlayer>().PlayerId }); Service.Get <ServerAPI>().Sync(command); this.intervalSecondsLeft = GameConstants.UNDER_ATTACK_STATUS_CHECK_INTERVAL; if (this.intervalSecondsLeft == 0) { this.intervalSecondsLeft = 15; return; } } else { num = this.totalSecondsLeft - 1; this.totalSecondsLeft = num; if (num < 1) { Service.Get <Engine>().Reload(); this.Close(null); return; } this.timeCountLabel.Text = GameUtils.GetTimeLabelFromSeconds(this.totalSecondsLeft); } }