@@ -289,14 +289,12 @@ class Config {
289289 late String channelName;
290290 late int maxLoginLength;
291291 late int maxMessageLength;
292- late int serverChatHistory;
293292 late int totalVideoLimit;
294293 late int userVideoLimit;
295- late bool localAdmins;
296294 late String templateUrl;
297295 late String youtubeApiKey;
298296 // in newer versions
299- late double ? cacheStorageLimitGiB ;
297+ late int serverVersion ;
300298 late Permissions ? permissions;
301299 late List <Emotes > emotes;
302300 late List <Filters > filters;
@@ -308,13 +306,11 @@ class Config {
308306 required this .channelName,
309307 required this .maxLoginLength,
310308 required this .maxMessageLength,
311- required this .serverChatHistory,
312309 required this .totalVideoLimit,
313310 required this .userVideoLimit,
314- required this .localAdmins,
315311 required this .templateUrl,
316312 required this .youtubeApiKey,
317- required this .cacheStorageLimitGiB ,
313+ required this .serverVersion ,
318314 required this .permissions,
319315 required this .emotes,
320316 required this .filters,
@@ -327,13 +323,16 @@ class Config {
327323 channelName = json['channelName' ];
328324 maxLoginLength = json['maxLoginLength' ];
329325 maxMessageLength = json['maxMessageLength' ];
330- serverChatHistory = json['serverChatHistory' ];
331326 totalVideoLimit = json['totalVideoLimit' ];
332327 userVideoLimit = json['userVideoLimit' ];
333- localAdmins = json['localAdmins' ];
334328 templateUrl = json['templateUrl' ];
335329 youtubeApiKey = json['youtubeApiKey' ];
336- cacheStorageLimitGiB = json['cacheStorageLimitGiB' ]? .toDouble ();
330+
331+ int ? version = json['serverVersion' ];
332+ final cacheStorageLimitGiB = json['cacheStorageLimitGiB' ]? .toDouble ();
333+ version ?? = cacheStorageLimitGiB == null ? 1 : 2 ;
334+ serverVersion = version;
335+
337336 permissions = json['permissions' ] != null
338337 ? new Permissions .fromJson (json['permissions' ])
339338 : null ;
@@ -359,13 +358,11 @@ class Config {
359358 data['channelName' ] = this .channelName;
360359 data['maxLoginLength' ] = this .maxLoginLength;
361360 data['maxMessageLength' ] = this .maxMessageLength;
362- data['serverChatHistory' ] = this .serverChatHistory;
363361 data['totalVideoLimit' ] = this .totalVideoLimit;
364362 data['userVideoLimit' ] = this .userVideoLimit;
365- data['localAdmins' ] = this .localAdmins;
366363 data['templateUrl' ] = this .templateUrl;
367364 data['youtubeApiKey' ] = this .youtubeApiKey;
368- data['cacheStorageLimitGiB ' ] = this .cacheStorageLimitGiB ;
365+ data['serverVersion ' ] = this .serverVersion ;
369366 if (this .permissions != null ) {
370367 data['permissions' ] = this .permissions? .toJson ();
371368 }
0 commit comments