Update regex checking for minecraft services

closes #193
This commit is contained in:
Dane Everitt 2016-12-02 19:06:14 -05:00
parent e39c750563
commit 777e7138e6
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 88 additions and 7 deletions

View file

@ -0,0 +1,79 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CorrectServiceVariables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::transaction(function () {
// Modify Default Spigot Startup Line
DB::table('service_options')->where([
['name', 'Spigot'],
['tag', 'spigot'],
['startup', '-Xms128M -Xmx{{SERVER_MEMORY}}M -Djline.terminal=jline.UnsupportedTerminal -jar {{SERVER_JARFILE}}'],
])->update([
'startup' => null,
]);
// Correct Spigot Version Checking
DB::table('service_variables')->where([
['name', 'Spigot Version'],
['env_variable', 'DL_VERSION'],
['default_value', 'latest'],
['regex', '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/'],
])->update([
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{3,7})$/',
]);
// Correct Vanilla Version Checking (as well as naming)
DB::table('service_variables')->where([
['name', 'Server Jar File'],
['env_variable', 'VANILLA_VERSION'],
['default_value', 'latest'],
['regex', '/^(latest|[a-zA-Z0-9_\.-]{5,6})$/']
])->update([
'name' => 'Server Version',
'regex' => '/^(latest|[a-zA-Z0-9_\.-]{3,7})$/',
]);
// Update Sponge Version Checking and Update Default Version
DB::table('service_variables')->where([
['name', 'Sponge Version'],
['env_variable', 'SPONGE_VERSION'],
['default_value', '1.8.9-4.2.0-BETA-351'],
['regex', '/^(.*)$/'],
])->update([
'default_value' => '1.10.2-5.1.0-BETA-359',
'regex' => '/^([a-zA-Z0-9.\-_]+)$/',
]);
// Update Bungeecord Version Checking
DB::table('service_variables')->where([
['name', 'Bungeecord Version'],
['env_variable', 'BUNGEE_VERSION'],
['default_value', 'latest'],
['regex', '/^(latest|[\d]{3,5})$/'],
])->update([
'regex' => '/^(latest|[\d]{1,6})$/',
]);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// do nothing
}
}