Skip to content

Commit 2afd3e4

Browse files
committed
Add Terraria seeder, update voice servers seeder
1 parent ec969ec commit 2afd3e4

File tree

2 files changed

+130
-1
lines changed

2 files changed

+130
-1
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<?php
2+
/**
3+
* Pterodactyl - Panel
4+
* Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com>
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
use Illuminate\Database\Seeder;
25+
26+
use Pterodactyl\Models;
27+
28+
class TerrariaServiceTableSeeder extends Seeder
29+
{
30+
/**
31+
* The core service ID.
32+
*
33+
* @var Models\Service
34+
*/
35+
protected $service;
36+
37+
/**
38+
* Stores all of the option objects
39+
*
40+
* @var array
41+
*/
42+
protected $option = [];
43+
44+
/**
45+
* Run the database seeds.
46+
*
47+
* @return void
48+
*/
49+
public function run()
50+
{
51+
$this->addCoreService();
52+
$this->addCoreOptions();
53+
$this->addVariables();
54+
}
55+
56+
private function addCoreService()
57+
{
58+
$this->service = Models\Service::create([
59+
'author' => 'ptrdctyl-v040-11e6-8b77-86f30ca893d3',
60+
'name' => 'Terraria',
61+
'description' => 'Terraria is a land of adventure! A land of mystery! A land that\'s yours to shape, defend, and enjoy. Your options in Terraria are limitless. Are you an action gamer with an itchy trigger finger? A master builder? A collector? An explorer? There\'s something for everyone.',
62+
'file' => 'terraria',
63+
'executable' => 'TerrariaServer.exe',
64+
'startup' => '-port {{SERVER_PORT}} -autocreate 2 -worldname World'
65+
]);
66+
}
67+
68+
private function addCoreOptions()
69+
{
70+
$this->option['tshock'] = Models\ServiceOptions::create([
71+
'parent_service' => $this->service->id,
72+
'name' => 'Terraria Server (TShock)',
73+
'description' => 'TShock is a server modification for Terraria, written in C#, and based upon the Terraria Server API. It uses JSON for configuration management, and offers several features not present in the Terraria Server normally.',
74+
'tag' => 'tshock',
75+
'docker_image' => 'quay.io/pterodactyl/terraria:tshock',
76+
'executable' => '',
77+
'startup' => ''
78+
]);
79+
}
80+
81+
private function addVariables()
82+
{
83+
Models\ServiceVariables::create([
84+
'option_id' => $this->option['tshock']->id,
85+
'name' => 'TShock Version',
86+
'description' => 'Which version of TShock to install and use.',
87+
'env_variable' => 'T_VERSION',
88+
'default_value' => '4.3.17',
89+
'user_viewable' => 1,
90+
'user_editable' => 1,
91+
'required' => 1,
92+
'regex' => '/^([0-9_\.-]{5,10})$/'
93+
]);
94+
95+
Models\ServiceVariables::create([
96+
'option_id' => $this->option['vanilla']->id,
97+
'name' => 'Maximum Slots',
98+
'description' => 'Total number of slots to allow on the server.',
99+
'env_variable' => 'MAX_SLOTS',
100+
'default_value' => '20',
101+
'user_viewable' => 1,
102+
'user_editable' => 0,
103+
'required' => 1,
104+
'regex' => '/^(\d){1,3}$/'
105+
]);
106+
}
107+
}

database/seeds/VoiceServiceTableSeeder.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ private function addCoreOptions()
7676
'executable' => './murmur.x86',
7777
'startup' => '-fg'
7878
]);
79+
80+
$this->option['ts3'] = Models\ServiceOptions::create([
81+
'parent_service' => $this->service->id,
82+
'name' => 'Teamspeak3 Server',
83+
'description' => 'VoIP software designed with security in mind, featuring crystal clear voice quality, endless customization options, and scalabilty up to thousands of simultaneous users.',
84+
'tag' => 'ts3',
85+
'docker_image' => 'quay.io/pterodactyl/voice:ts3',
86+
'executable' => './ts3server_minimal_runscript.sh',
87+
'startup' => 'default_voice_port={{SERVER_PORT}} query_port={{SERVER_PORT}}'
88+
]);
7989
}
8090

8191
private function addVariables()
@@ -93,7 +103,7 @@ private function addVariables()
93103
]);
94104

95105
Models\ServiceVariables::create([
96-
'option_id' => $this->option['vanilla']->id,
106+
'option_id' => $this->option['mumble']->id,
97107
'name' => 'Server Version',
98108
'description' => 'Version of Mumble Server to download and use.',
99109
'env_variable' => 'MUMBLE_VERSION',
@@ -103,5 +113,17 @@ private function addVariables()
103113
'required' => 1,
104114
'regex' => '/^([0-9_\.-]{5,8})$/'
105115
]);
116+
117+
Models\ServiceVariables::create([
118+
'option_id' => $this->option['ts3']->id,
119+
'name' => 'Server Version',
120+
'description' => 'The version of Teamspeak 3 to use when running the server.',
121+
'env_variable' => 'T_VERSION',
122+
'default_value' => '3.0.13.4',
123+
'user_viewable' => 1,
124+
'user_editable' => 1,
125+
'required' => 1,
126+
'regex' => '/^([0-9_\.-]{5,10})$/'
127+
]);
106128
}
107129
}

0 commit comments

Comments
 (0)