Skip to content

Commit 736a323

Browse files
committed
Merge branch 'develop' into feature/PTDL-472
2 parents bc3366b + 0def417 commit 736a323

File tree

6 files changed

+634
-1
lines changed

6 files changed

+634
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ This file is a running track of new features and fixes to each version of the pa
33

44
This project follows [Semantic Versioning](http://semver.org) guidelines.
55

6+
## Unreleased
7+
### Added
8+
* Support for CS:GO as a default service option selection.
9+
* Support for GMOD as a default service option selection.
10+
611
## v0.6.4 (Courageous Carniadactylus)
712
### Fixed
813
* Fixed the console rendering on page load, I guess people don't like watching it load line-by-line for 10 minutes. Who would have guessed...

database/seeds/DatabaseSeeder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function run()
1616

1717
$this->call(MinecraftServiceTableSeeder::class);
1818
$this->call(SourceServiceTableSeeder::class);
19+
$this->call(RustServiceTableSeeder::class);
1920
$this->call(TerrariaServiceTableSeeder::class);
2021
$this->call(VoiceServiceTableSeeder::class);
2122

database/seeds/MinecraftServiceTableSeeder.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,43 @@ private function addCoreOptions()
243243
'startup' => null,
244244
'script_install' => $script,
245245
]);
246+
247+
$script = <<<'EOF'
248+
#!/bin/ash
249+
# Forge Installation Script
250+
#
251+
# Server Files: /mnt/server
252+
apk update
253+
apk add curl
254+
255+
GET_VERSIONS=$(curl -sl http://files.minecraftforge.net/maven/net/minecraftforge/forge/ | grep -A1 Latest | grep -o -e '[1]\.[0-9][0-9] - [0-9][0-9]\.[0-9][0-9]\.[0-9]\.[0-9][0-9][0-9][0-9]')
256+
LATEST_VERSION=$(echo $GET_VERSIONS | sed 's/ //g')
257+
258+
cd /mnt/server
259+
260+
curl -sS http://files.minecraftforge.net/maven/net/minecraftforge/forge/$LATEST_VERSION/forge-$LATEST_VERSION-installer.jar -o installer.jar
261+
curl -sS http://files.minecraftforge.net/maven/net/minecraftforge/forge/$LATEST_VERSION/forge-$LATEST_VERSION-universal.jar -o server.jar
262+
263+
java -jar installer.jar --installServer
264+
rm -rf installer.jar
265+
EOF;
266+
267+
$this->option['forge'] = ServiceOption::updateOrCreate([
268+
'service_id' => $this->service->id,
269+
'tag' => 'forge',
270+
], [
271+
'name' => 'Forge Minecraft',
272+
'description' => 'Minecraft Forge Server. Minecraft Forge is a modding API (Application Programming Interface), which makes it easier to create mods, and also make sure mods are compatible with each other.',
273+
'docker_image' => 'quay.io/pterodactyl/core:java',
274+
'config_startup' => '{"done": ")! For help, type ", "userInteraction": [ "Go to eula.txt for more info."]}',
275+
'config_logs' => '{"custom": false, "location": "logs/latest.log"}',
276+
'config_files' => '{"server.properties":{"parser": "properties", "find":{"server-ip": "0.0.0.0", "enable-query": "true", "server-port": "{{server.build.default.port}}", "query.port": "{{server.build.default.port}}"}}}',
277+
'config_stop' => 'stop',
278+
'config_from' => null,
279+
'startup' => 'java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}',
280+
'script_install' => $script,
281+
'script_container' => 'frolvlad/alpine-oraclejdk8:cleaned',
282+
]);
246283
}
247284

248285
private function addVariables()
@@ -251,6 +288,7 @@ private function addVariables()
251288
$this->addSpigotVariables();
252289
$this->addSpongeVariables();
253290
$this->addBungeecordVariables();
291+
$this->addForgeVariables();
254292
}
255293

256294
private function addVanillaVariables()
@@ -372,4 +410,19 @@ private function addBungeecordVariables()
372410
'rules' => 'required|regex:/^([\w\d._-]+)(\.jar)$/',
373411
]);
374412
}
413+
414+
private function addForgeVariables()
415+
{
416+
ServiceVariable::updateOrCreate([
417+
'option_id' => $this->option['forge']->id,
418+
'env_variable' => 'SERVER_JARFILE',
419+
], [
420+
'name' => 'Server Jar File',
421+
'description' => 'The name of the Jarfile to use when running Forge Mod.',
422+
'default_value' => 'server.jar',
423+
'user_viewable' => 1,
424+
'user_editable' => 1,
425+
'rules' => 'required|regex:/^([\w\d._-]+)(\.jar)$/',
426+
]);
427+
}
375428
}

0 commit comments

Comments
 (0)