-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNestSeeder.php
524 lines (487 loc) · 17.4 KB
/
NestSeeder.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Pterodactyl\Services\Nests\NestCreationService;
use Pterodactyl\Contracts\Repository\NestRepositoryInterface;
class NestSeeder extends Seeder
{
/**
* @var \Pterodactyl\Services\Nests\NestCreationService
*/
private $creationService;
/**
* @var \Pterodactyl\Contracts\Repository\NestRepositoryInterface
*/
private $repository;
/**
* NestSeeder constructor.
*/
public function __construct(
NestCreationService $creationService,
NestRepositoryInterface $repository
) {
$this->creationService = $creationService;
$this->repository = $repository;
}
/**
* Run the seeder to add missing nests to the Panel.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
public function run()
{
$items = $this->repository->findWhere([
'author' => '[email protected]',
])->keyBy('name')->toArray();
$this->createSourceEngineNest(array_get($items, 'Source Engine'));
$this->createVoiceServersNest(array_get($items, 'Voice Servers'));
$this->createRustNest(array_get($items, 'Rust'));
$this->createAmongUsNest(array_get($items, 'Among Us'));
$this->createBeamMPNest(array_get($items, 'BeamMP'));
$this->createBeamNGNest(array_get($items, 'BeamNG'));
$this->createBotsNest(array_get($items, 'Bots'));
$this->createCallofDutyNest(array_get($items, 'Call of Duty'));
$this->createCryoFallNest(array_get($items, 'CryoFall'));
$this->createDatabaseNest(array_get($items, 'Database'));
$this->createETLegacyNest(array_get($items, 'Enemy Territory'));
$this->createFactorioNest(array_get($items, 'Factorio'));
$this->createFasterThanLightNest(array_get($items, 'Faster Than Light'));
$this->createGrandTheftAutoNest(array_get($items, 'Grand Theft Auto'));
$this->createLeagueSandboxNest(array_get($items, 'League Sandbox'));
$this->createMindustryNest(array_get($items, 'Mindustry'));
$this->createMinetestNest(array_get($items, 'Minetest'));
$this->createOpenarenaNest(array_get($items, 'Openarena'));
$this->createOpenRANest(array_get($items, 'OpenRA'));
$this->createRedDeadRedemptionNest(array_get($items, 'Red Dead Redemption'));
$this->createSoftwareNest(array_get($items, 'Software'));
$this->createStarMadeNest(array_get($items, 'StarMade'));
$this->createStorageNest(array_get($items, 'Storage'));
$this->createTeeworldsNest(array_get($items, 'Teeworlds'));
$this->createTerrariaNest(array_get($items, 'Terraria'));
$this->createTycoonGamesNest(array_get($items, 'Tycoon Games'));
$this->createUnrealEngineNest(array_get($items, 'Unreal Engine'));
$this->createVelorenNest(array_get($items, 'Veloren'));
$this->createVintageStoryNest(array_get($items, 'Vintage Story'));
$this->createXonoticNest(array_get($items, 'Xonotic'));
}
/**
* Create the Source Engine Games nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createSourceEngineNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Source Engine',
'description' => 'Includes support for most Source Dedicated Server games.',
], '[email protected]');
}
}
/**
* Create the Voice Servers nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createVoiceServersNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Voice Servers',
'description' => 'Voice servers such as Mumble and Teamspeak 3.',
], '[email protected]');
}
}
/**
* Create the Rust nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createRustNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Rust',
'description' => 'Rust - A game where you must fight to survive.',
], '[email protected]');
}
}
/**
* Create the Among Us nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createAmongUsNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Among Us',
'description' => 'Among Us - A 2D game where you are either a crewmate completing tasks or an impostor sabotaging the crewmates.',
], '[email protected]');
}
}
/**
* Create the BeamMP nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createBeamMPNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'BeamMP',
'description' => 'BeamMP - Allows for stable servers, with a variety of servers located accross the globe.',
], '[email protected]');
}
}
/**
* Create the BeamNG nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createBeamNGNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'BeamNG',
'description' => 'BeamNG.drive - An incredibly realistic driving game with near-limitless possibilities.',
], '[email protected]');
}
}
/**
* Create the Bots nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createBotsNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Bots',
'description' => 'Bots - A variety of different bots to fulfill your needs.',
], '[email protected]');
}
}
/**
* Create the COD nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createCallofDutyNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Call of Duty',
'description' => 'Call of Duty - A first-person shooter video game franchise published by Activision.',
], '[email protected]');
}
}
/**
* Create the CryoFall nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createCryoFallNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'CryoFall',
'description' => 'CryoFall - A 2D Sci-Fi online survival game set on a forgotten planet in the distant future.',
], '[email protected]');
}
}
/**
* Create the Database nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createDatabaseNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Database',
'description' => 'Database - A range of different database options to choose from.',
], '[email protected]');
}
}
/**
* Create the Enemy Territory nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createETLegacyNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Enemy Territory',
'description' => 'Enemy Territory - A free and open-source multiplayer first-person shooter video game set during World War II.',
], '[email protected]');
}
}
/**
* Create the Factorio nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createFactorioNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Factorio',
'description' => 'Factorio - A 2D construction and management simulation game.',
], '[email protected]');
}
}
/**
* Create the Faster Than Light nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createFasterThanLightNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Faster Than Light',
'description' => 'Faster Than Light - A 2D space-based top-down real-time strategy roguelike game.',
], '[email protected]');
}
}
/**
* Create the Grand Theft Auto nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createGrandTheftAutoNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Grand Theft Auto',
'description' => 'Grand Theft Auto - A series of action-adventure games created by David Jones and Mike Dailly.',
], '[email protected]');
}
}
/**
* Create the League Sandbox nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createLeagueSandboxNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'League Sandbox',
'description' => 'League Sandbox - A gameserver for League Of Legends.',
], '[email protected]');
}
}
/**
* Create the Mindustry nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createMindustryNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Mindustry',
'description' => 'Mindustry - A sandbox tower-defense game.',
], '[email protected]');
}
}
/**
* Create the Minetest nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createMinetestNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Minetest',
'description' => 'Minetest - A free and open-source sandbox video game.',
], '[email protected]');
}
}
/**
* Create the Openarena nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createOpenarenaNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Openarena',
'description' => 'Openarena - A first-person shooter, and a video game clone of Quake III Arena.',
], '[email protected]');
}
}
/**
* Create the OpenRA nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createOpenRANest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'OpenRA',
'description' => 'OpenRA - An open source project that recreates and modernizes classic real time strategy games',
], '[email protected]');
}
}
/**
* Create the Red Dead Redemption nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createRedDeadRedemptionNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Red Dead Redemption',
'description' => 'Red Dead Redemption - An action-adventure game.',
], '[email protected]');
}
}
/**
* Create the Software nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createSoftwareNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Software',
'description' => 'Software - A range of different software to host.',
], '[email protected]');
}
}
/**
* Create the StarMade nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createStarMadeNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'StarMade',
'description' => 'StarMade - An effectively infinite open-universe space simulation sandbox game.',
], '[email protected]');
}
}
/**
* Create the Storage nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createStorageNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Storage',
'description' => 'Storage - A range of storage solutions for your needs.',
], '[email protected]');
}
}
/**
* Create the Teeworlds nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createTeeworldsNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Teeworlds',
'description' => 'Teeworlds - A free, open-source sidescrolling multiplayer shooting game.',
], '[email protected]');
}
}
/**
* Create the Terraria nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createTerrariaNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Terraria',
'description' => 'Terraria - A 2D action-adventure sandbox game.',
], '[email protected]');
}
}
/**
* Create the Tycoon Games nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createTycoonGamesNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Tycoon Games',
'description' => 'Tycoon Games - A range of different tycoon games.',
], '[email protected]');
}
}
/**
* Create the Unreal Engine nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createUnrealEngineNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Unreal Engine',
'description' => 'Unreal Engine - A range of different Unreal Engine games.',
], '[email protected]');
}
}
/**
* Create the Veloren nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createVelorenNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Veloren',
'description' => 'Veloren - A open-source multi-platform voxel action role-playing game.',
], '[email protected]');
}
}
/**
* Create the Vintage Story nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createVintageStoryNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Vintage Story',
'description' => 'Vintage Story - A sandbox survival game.',
], '[email protected]');
}
}
/**
* Create the Xonotic nest to be used later on.
*
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
*/
private function createXonoticNest(array $nest = null)
{
if (is_null($nest)) {
$this->creationService->handle([
'name' => 'Xonotic',
'description' => 'Xonotic - A free and open-source first-person shooter video game.',
], '[email protected]');
}
}
}