Skip to content

Commit 9d69f47

Browse files
committed
Here ya go @ET-Bent support for Ark ⛵
1 parent 0741ab6 commit 9d69f47

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
use Pterodactyl\Models\Service;
8+
use Pterodactyl\Models\ServiceOptions;
9+
use Pterodactyl\Models\ServiceVariables;
10+
11+
class AddArkServiceOption extends Migration
12+
{
13+
/**
14+
* Run the migrations.
15+
*
16+
* @return void
17+
*/
18+
public function up()
19+
{
20+
DB::transaction(function () {
21+
$service = Service::select('id')->where('author', 'ptrdctyl-v040-11e6-8b77-86f30ca893d3')->where('name', 'Source Engine')->first();
22+
if (!$service) {
23+
exit('No service could be found.');
24+
}
25+
26+
$option = ServiceOptions::create([
27+
'parent_service' => $service->id,
28+
'name' => 'Ark: Survival Evolved',
29+
'description' => 'As a man or woman stranded, naked, freezing, and starving on the unforgiving shores of a mysterious island called ARK, use your skill and cunning to kill or tame and ride the plethora of leviathan dinosaurs and other primeval creatures roaming the land. Hunt, harvest resources, craft items, grow crops, research technologies, and build shelters to withstand the elements and store valuables, all while teaming up with (or preying upon) hundreds of other players to survive, dominate... and escape! — Gamepedia: ARK',
30+
'tag' => 'ark',
31+
'docker_image' => 'quay.io/pterodactyl/srcds:ark',
32+
'executable' => './ShooterGameServer',
33+
'startup' => 'TheIsland?listen?ServerPassword={{ARK_PASSWORD}}?ServerAdminPassword={{ARK_ADMIN_PASSWORD}}?Port={{SERVER_PORT}}?MaxPlayers={{SERVER_MAX_PLAYERS}}'
34+
]);
35+
36+
ServiceVariables::create([
37+
'option_id' => $option->id,
38+
'name' => 'Server Password',
39+
'description' => 'If specified, players must provide this password to join the server.',
40+
'env_variable' => 'ARK_PASSWORD',
41+
'default_value' => '',
42+
'user_viewable' => 1,
43+
'user_editable' => 1,
44+
'required' => 0,
45+
'regex' => '/^(\w\.*)$/'
46+
]);
47+
48+
ServiceVariables::create([
49+
'option_id' => $option->id,
50+
'name' => 'Admin Password',
51+
'description' => 'If specified, players must provide this password (via the in-game console) to gain access to administrator commands on the server.',
52+
'env_variable' => 'ARK_ADMIN_PASSWORD',
53+
'default_value' => '',
54+
'user_viewable' => 1,
55+
'user_editable' => 1,
56+
'required' => 0,
57+
'regex' => '/^(\w\.*)$/'
58+
]);
59+
60+
ServiceVariables::create([
61+
'option_id' => $option->id,
62+
'name' => 'Maximum Players',
63+
'description' => 'Specifies the maximum number of players that can play on the server simultaneously.',
64+
'env_variable' => 'SERVER_MAX_PLAYERS',
65+
'default_value' => 20,
66+
'user_viewable' => 1,
67+
'user_editable' => 1,
68+
'required' => 1,
69+
'regex' => '/^(\d{1,4})$/'
70+
]);
71+
});
72+
73+
}
74+
75+
/**
76+
* Reverse the migrations.
77+
*
78+
* @return void
79+
*/
80+
public function down()
81+
{
82+
DB::transaction(function () {
83+
$service = Service::select('id')->where('author', 'ptrdctyl-v040-11e6-8b77-86f30ca893d3')->where('name', 'Source Engine')->first();
84+
$option = ServiceOptions::where('parent_service', $service->id)->where('tag', 'ark')->delete();
85+
$variables = ServiceVariables::where('option_id', $option->id)->delete();
86+
});
87+
}
88+
}

0 commit comments

Comments
 (0)