remove required default value, update descriptions in seeder

This commit is contained in:
Dane Everitt 2016-09-14 15:19:59 -04:00
parent c2d0a5adb3
commit fcae6b5f15
3 changed files with 4 additions and 2 deletions

View file

@ -100,7 +100,7 @@ class Variable
'name' => 'sometimes|required|string|min:1|max:255',
'description' => 'sometimes|required|string',
'env_variable' => 'sometimes|required|regex:/^[\w]{1,255}$/',
'default_value' => 'sometimes|required|string|max:255',
'default_value' => 'sometimes|string|max:255',
'user_viewable' => 'sometimes|required|numeric|size:1',
'user_editable' => 'sometimes|required|numeric|size:1',
'required' => 'sometimes|required|numeric|size:1',
@ -114,7 +114,7 @@ class Variable
$data['default_value'] = (isset($data['default_value'])) ? $data['default_value'] : $variable->default_value;
$data['regex'] = (isset($data['regex'])) ? $data['regex'] : $variable->regex;
if (!preg_match($data['regex'], $data['default_value'])) {
if ($data['default_value'] !== '' && !preg_match($data['regex'], $data['default_value'])) {
throw new DisplayException('The default value you entered cannot violate the regex requirements.');
}

View file

@ -58,6 +58,7 @@ class MinecraftServiceTableSeeder extends Seeder
$this->service = Models\Service::create([
'author' => 'ptrdctyl-v040-11e6-8b77-86f30ca893d3',
'name' => 'Minecraft',
'description' => 'Minecraft - the classic game from Mojang. With support for Vanilla MC, Spigot, and many others!',
'file' => 'minecraft',
'executable' => 'java',
'startup' => '-Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}'

View file

@ -58,6 +58,7 @@ class SourceServiceTableSeeder extends Seeder
$this->service = Models\Service::create([
'author' => 'ptrdctyl-v040-11e6-8b77-86f30ca893d3',
'name' => 'Source Engine',
'description' => 'Includes support for most Source Dedicated Server games.',
'file' => 'srcds',
'executable' => './srcds_run',
'startup' => '-game {{SRCDS_GAME}} -console -port {{SERVER_PORT}} -strictportbind -norestart'