示例#1
0
        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);
        }
示例#2
0
 static RatePvPTimeGates()
 {
     if (Api.IsClient)
     {
         // init placeholder value
         sharedTimeGateDurations = new PvPTechTimeGateDurations(
             timeGates: new double[PvPTimeGatesCount]);
     }
 }
示例#3
0
 protected override void ClientOnValueChanged()
 {
     sharedTimeGateDurations = ParseTimeGating(SharedValue);
 }