2021-07-05 06:02:30 +03:00
|
|
|
class SettingsPing extends Object
|
2021-06-07 05:04:40 +03:00
|
|
|
dependson(Types)
|
2021-06-20 08:04:22 +03:00
|
|
|
config(YAS);
|
2021-06-07 05:04:40 +03:00
|
|
|
|
2021-06-12 23:11:37 +03:00
|
|
|
`include(Build.uci)
|
|
|
|
`include(Logger.uci)
|
|
|
|
|
2021-06-09 03:58:31 +03:00
|
|
|
var config int Low;
|
|
|
|
var config int High;
|
2021-07-05 06:02:30 +03:00
|
|
|
|
|
|
|
public static function InitConfig(int ConfigVersion)
|
|
|
|
{
|
|
|
|
`callstack_static("InitConfig");
|
|
|
|
|
|
|
|
switch (ConfigVersion)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
WriteSettings(DefaultSettings());
|
|
|
|
|
|
|
|
case 2147483647:
|
|
|
|
StaticSaveConfig();
|
|
|
|
}
|
|
|
|
}
|
2021-06-09 03:58:31 +03:00
|
|
|
|
2021-06-20 23:09:12 +03:00
|
|
|
public static function YASSettingsPing DefaultSettings()
|
2021-06-09 03:58:31 +03:00
|
|
|
{
|
2021-06-20 23:09:12 +03:00
|
|
|
local YASSettingsPing Settings;
|
2021-06-12 23:11:37 +03:00
|
|
|
|
|
|
|
`callstack_static("DefaultSettings");
|
|
|
|
|
2021-06-09 03:58:31 +03:00
|
|
|
return Settings;
|
|
|
|
}
|
|
|
|
|
2021-06-20 23:09:12 +03:00
|
|
|
public static function YASSettingsPing Settings()
|
2021-06-09 03:58:31 +03:00
|
|
|
{
|
2021-06-20 23:09:12 +03:00
|
|
|
local YASSettingsPing Settings;
|
2021-06-09 03:58:31 +03:00
|
|
|
|
2021-06-12 23:11:37 +03:00
|
|
|
`callstack_static("Settings");
|
|
|
|
|
2021-07-05 06:02:30 +03:00
|
|
|
Settings.Low = default.Low;
|
2021-06-09 03:58:31 +03:00
|
|
|
Settings.High = default.High;
|
|
|
|
|
|
|
|
return Settings;
|
|
|
|
}
|
|
|
|
|
2021-06-20 23:09:12 +03:00
|
|
|
public static function WriteSettings(YASSettingsPing Settings)
|
2021-06-09 03:58:31 +03:00
|
|
|
{
|
2021-06-12 23:11:37 +03:00
|
|
|
`callstack_static("WriteSettings");
|
|
|
|
|
2021-07-05 06:02:30 +03:00
|
|
|
default.Low = Settings.Low;
|
2021-06-09 03:58:31 +03:00
|
|
|
default.High = Settings.High;
|
|
|
|
}
|
2021-06-07 05:04:40 +03:00
|
|
|
|
|
|
|
DefaultProperties
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|