Attempt to properly handle new start lines on servers for migration
This commit is contained in:
parent
63029bb396
commit
d67f65bb71
3 changed files with 54 additions and 38 deletions
|
@ -34,20 +34,22 @@ class MigrateToNewServiceSystem extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
$service = Service::where('author', config('pterodactyl.service.core'))->where('folder', 'srcds')->first();
|
||||
if (! $service) {
|
||||
return;
|
||||
}
|
||||
|
||||
$options = ServiceOption::where('service_id', $service->id)->get();
|
||||
$options->each(function ($item) use ($options) {
|
||||
if ($item->tag === 'srcds' && $item->name === 'Insurgency') {
|
||||
$item->tag = 'insurgency';
|
||||
} elseif ($item->tag === 'srcds' && $item->name === 'Team Fortress 2') {
|
||||
$item->tag = 'tf2';
|
||||
} elseif ($item->tag === 'srcds' && $item->name === 'Custom Source Engine Game') {
|
||||
$item->tag = 'source';
|
||||
DB::transaction(function () {
|
||||
$service = Service::where('author', config('pterodactyl.service.core'))->where('folder', 'srcds')->first();
|
||||
if (! $service) {
|
||||
return;
|
||||
}
|
||||
|
||||
$options = ServiceOption::where('service_id', $service->id)->get();
|
||||
$options->each(function ($item) use ($options) {
|
||||
if ($item->tag === 'srcds' && $item->name === 'Insurgency') {
|
||||
$item->tag = 'insurgency';
|
||||
} elseif ($item->tag === 'srcds' && $item->name === 'Team Fortress 2') {
|
||||
$item->tag = 'tf2';
|
||||
} elseif ($item->tag === 'srcds' && $item->name === 'Custom Source Engine Game') {
|
||||
$item->tag = 'source';
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue