diff --git a/app/Services/ReplayParser.php b/app/Services/ReplayParser.php index 8600f330fd0ab6849fefaa23c1fe6faec1675de0..45d6bcc5801dc13707d7b146bd4aef5224ea977b 100644 --- a/app/Services/ReplayParser.php +++ b/app/Services/ReplayParser.php @@ -80,11 +80,13 @@ class ReplayParser protected function validateVersion(int $version, int $subVersion, int $demoVersion) : void { - if ($version !== 100 || $demoVersion !== 1) { + $cfg = config('app.replay_version'); + + if ($version != $cfg['major'] || $demoVersion != $cfg['demo']) { throw new ReplayException('This replay is not supported by the records site'); } - if ($subVersion < 0) { + if ($subVersion < $cfg['sub']) { throw new ReplayException('This replay was recorded on too old of a version'); } } diff --git a/config/app.php b/config/app.php index 57ee5b75d3eef3a9f3fe6c4d04d94f6b1d2b5a08..53f2f13f5a4fc573cdf2ee8ca1392e1937fafd2c 100644 --- a/config/app.php +++ b/config/app.php @@ -226,4 +226,9 @@ return [ ], + 'replay_version' => [ + 'major' => env('REPLAY_MAJOR_VERSION', 100), + 'sub' => env('REPLAY_SUB_VERSION', 0), + 'demo' => env('REPLAY_DEMO_VERSION', 0), + ], ];