Skip to content
Snippets Groups Projects
Commit eec1ac28 authored by fickleheart's avatar fickleheart
Browse files

Add config option for allowed replay versions

parent 7368862d
No related branches found
No related tags found
No related merge requests found
......@@ -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');
}
}
......
......@@ -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),
],
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment