File tree Expand file tree Collapse file tree
GamesDat/Telemetry/Sources/WarThunder Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ public static class WarThunderSources
1717 /// <returns>A configured StateSource instance.</returns>
1818 public static StateSource CreateStateSource ( string ? baseUrl = null , int hz = 60 )
1919 {
20+ if ( hz <= 0 )
21+ throw new ArgumentOutOfRangeException ( nameof ( hz ) , hz , "Polling frequency must be greater than 0" ) ;
22+
2023 var pollInterval = TimeSpan . FromMilliseconds ( 1000.0 / hz ) ;
2124 return new StateSource ( baseUrl ?? DefaultBaseUrl , pollInterval ) ;
2225 }
@@ -39,6 +42,9 @@ public static StateSource CreateStateSource(HttpPollingSourceOptions options)
3942 /// <returns>A configured IndicatorsSource instance.</returns>
4043 public static IndicatorsSource CreateIndicatorsSource ( string ? baseUrl = null , int hz = 10 )
4144 {
45+ if ( hz <= 0 )
46+ throw new ArgumentOutOfRangeException ( nameof ( hz ) , hz , "Polling frequency must be greater than 0" ) ;
47+
4248 var pollInterval = TimeSpan . FromMilliseconds ( 1000.0 / hz ) ;
4349 return new IndicatorsSource ( baseUrl ?? DefaultBaseUrl , pollInterval ) ;
4450 }
You can’t perform that action at this time.
0 commit comments