protected override string ServerReadValue() { var currentValue = ServerRatesApi.Get(this.Id, this.ValueDefault, this.Description); if (string.IsNullOrEmpty(currentValue) || currentValue == "0") { // most server owners will likely configure this setting to empty string or simple "0" // with intent to disable the time gates currentValue = ValueNoTimeGates; } try { sharedTimeGateDurations = ParseTimeGating(currentValue); } catch { Api.Logger.Error($"Incorrect format for server rate: {this.Id} current value {currentValue}"); ServerRatesApi.Reset(this.Id, this.ValueDefault, this.Description); currentValue = this.ValueDefault; sharedTimeGateDurations = ParseTimeGating(currentValue); } return(currentValue); }
static RatePvPTimeGates() { if (Api.IsClient) { // init placeholder value sharedTimeGateDurations = new PvPTechTimeGateDurations( timeGates: new double[PvPTimeGatesCount]); } }
protected override void ClientOnValueChanged() { sharedTimeGateDurations = ParseTimeGating(SharedValue); }