initial commit

This commit is contained in:
Kim, Jimin 2021-10-27 21:24:38 +09:00 committed by pompydev
commit 73032fc6f5
Signed by: pomp
GPG key ID: D3932F82A0667A3B
17 changed files with 311 additions and 0 deletions

13
.gitignore vendored Normal file
View file

@ -0,0 +1,13 @@
/dev/
/master/*
/modules/
/plugins/
/secret/
/servers/*
/test/
cache/
logs/
/waterfall-*.jar
*.log*
!.gitkeep

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 developomp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

83
README.md Normal file
View file

@ -0,0 +1,83 @@
# LPMC
> **THIS PROJECT IS A WORK IN PROGRESS**
[![LICENSE: MIT](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)](./LICENSE)
[![SHELL FORMATTER: SHFMT](https://img.shields.io/badge/shell_formatter-shfmt-darkgrey?style=for-the-badge)](https://github.com/mvdan/sh)
[![MARKDOWN & YML FORMATTER: PRETTIER](https://img.shields.io/badge/markdown_&_yml_formatter-pretiier-ff69b4?style=for-the-badge)](https://github.com/prettier/prettier)
## Setup
version: 1.17.1
assumptions:
- platform: ubuntu 20.04 on ARM processor and username set to ubuntu.
- working directory is project root.
- scripts are executed with user permission and **NOT** with root permission.
### 1. Download waterfall
1. [Download](https://papermc.io/downloads#Waterfall)
2. Put the .jar file in project root (no need to rename it)
### 2. Download paper
1. [Download](https://papermc.io/downloads#Paper-1.17)
2. Put it in [`master`](./master) directory
### 3. Download plugins
| Plugin | Description | Documentation |
| --------------------------------------------------------------------------------------------------------------------: | :--------------------------: | :--------------------------------------------------- |
| [EssentialsX](https://dev.bukkit.org/projects/essentialsx) | | https://essentialsx.net/wiki/Home.html |
| [Dynmap](https://dev.bukkit.org/projects/dynmap) | | https://github.com/webbukkit/dynmap/wiki |
| [Core Protect](https://dev.bukkit.org/projects/coreprotect/files) | Logging & Anti-griefing | https://docs.coreprotect.net |
| [World Guard](https://dev.bukkit.org/projects/worldguard/files) | | https://worldguard.enginehub.org/en/latest |
| [Holographic Displays](https://dev.bukkit.org/projects/holographic-displays/files) | Text without signs | https://filoghost.me/docs/holographic-displays |
| [Illegal Stack](https://www.spigotmc.org/resources/dupe-fixes-illegal-stack-remover.44411) | patch dupes and exploits | https://github.com/dniym/IllegalStack/wiki |
| [Lock Login](https://www.spigotmc.org/resources/gsa-locklogin.75156) | user authentication | https://github.com/KarmaConfigs/LockLoginReborn/wiki |
| [Login Security](https://www.spigotmc.org/resources/loginsecurity.19362) | user authentication | https://github.com/lenis0012/LoginSecurity-2/wiki |
| [ProtocolLib](https://www.spigotmc.org/resources/protocollib.1997) | | https://github.com/dmulloy2/ProtocolLib/wiki |
| [Skin Restorer](https://www.spigotmc.org/resources/skinsrestorer.2124) | skin in offline-mode servers | https://github.com/SkinsRestorer/SkinsRestorerX/wiki |
| [Stack Mob](https://www.spigotmc.org/resources/stackmob-enhance-your-servers-performance-without-the-sacrifice.29999) | lower lag due to mobs | |
| [Multiple worlds](https://ci.md-5.net/job/BungeeCord) | | |
| [Server Monitoring](https://www.spigotmc.org/resources/lagmonitor.21348) | | |
| [World Edit](https://dev.bukkit.org/projects/worldedit/files) | | https://worldedit.enginehub.org/en/latest |
### 4. Generat worlds
seed: `-4172144997902289642` for all worlds (yeah it's 2b2t seed)
### 5. Start servers
## Tools
| Usage | URL |
| ----------------: | :---------------------------------------- |
| Editing chunks | https://github.com/Podshot/MCEdit-Unified |
| Editing NBT files | https://github.com/jaquadro/NBTExplorer |
| Editing world | https://www.universalminecrafteditor.com |
## todo
- destruction protection for main server
- spawn region
- no escape from hub chunks
- plugin for on member join
- file size monitor
- player count monitor
- tps monitor
- faction to anarchy
- site
- how to join
- server guide
- screen shots (gallery)
- server stat
- tps
- player per world and total
- status (online/offline)
## Related projects
- [LPMC website](https://github.com/developomp/lpmc.developomp.com)

56
config.yml Normal file
View file

@ -0,0 +1,56 @@
listeners:
- query_port: 25577
motd: Llamas!
tab_list: GLOBAL_PING
query_enabled: false
proxy_protocol: false
forced_hosts: {}
ping_passthrough: false
priorities:
- lobby
bind_local_address: true
host: 0.0.0.0:25565
max_players: 10
tab_size: 60
force_default_server: true
remote_ping_cache: -1
network_compression_threshold: 256
permissions:
default:
- bungeecord.command.server
- bungeecord.command.list
admin:
- bungeecord.command.alert
- bungeecord.command.end
- bungeecord.command.ip
- bungeecord.command.reload
trusted:
- bungeecord.server.trusted
log_pings: true
connection_throttle_limit: 3
server_connect_timeout: 5000
timeout: 30000
stats: b10526d8-1bb0-4b26-94a5-2d0e965917cd
player_limit: 20
ip_forward: true
groups:
developomp:
- admin
- trusted
remote_ping_timeout: 5000
connection_throttle: 4000
log_commands: true
prevent_proxy_connections: false
online_mode: false
forge_support: true
disabled_commands:
- disabledcommandhere
servers:
lobby:
motd: Llamas!
address: localhost:25566
restricted: false
smp:
motd: Llamas!
address: localhost:25567
restricted: false

0
master/.gitkeep Normal file
View file

8
modules.yml Normal file
View file

@ -0,0 +1,8 @@
version: 2
modules:
- jenkins://cmd_alert
- jenkins://cmd_find
- jenkins://cmd_list
- jenkins://cmd_send
- jenkins://cmd_server
- jenkins://reconnect_yaml

1
scripts/ssh.sh Executable file
View file

@ -0,0 +1 @@
ssh -i secret/ssh-key.key ubuntu@server.lpmc.developomp.com

59
scripts/start.sh Executable file
View file

@ -0,0 +1,59 @@
# usage: scripts/start.sh <OPTION HERE>
AVAILABLE_OPTIONS=(
waterfall
lobby
smp
)
JAVA=/usr/lib/jvm/java-8-openjdk/bin/java
if [ -z ${JAVA+x} ]; then
JAVA=java
fi
start_waterfall() {
echo "starting waterfall"
WATERFALL=$(find . -maxdepth 1 -type f -name waterfall*.jar)
$JAVA -Xmx128M -Xms128M -jar $WATERFALL
}
start_paper() {
# $1: working directory
# $2: RAM
cd $1
echo "$JAVA -Xmx$2 -Xms$2 -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar paper.jar nogui"
}
start_lobby() {
start_paper "servers/lobby" "1G"
}
start_smp() {
start_paper "servers/smp" "2G"
}
# check arguments
if [[ ! " ${AVAILABLE_OPTIONS[*]} " =~ " ${1} " ]]; then
echo "invalid argument: ${1}"
echo "available options are:"
for i in "${AVAILABLE_OPTIONS[@]}"; do
echo " - ${i}"
done
fi
case $1 in
waterfall)
start_waterfall
;;
lobby)
start_lobby
;;
smp)
start_smp
;;
esac

3
scripts/stop.sh Executable file
View file

@ -0,0 +1,3 @@
sudo systemctl stop lpmc_waterfall
sudo systemctl stop lpmc_lobby
sudo systemctl stop lpmc_smp

1
scripts/systemd.sh Executable file
View file

@ -0,0 +1 @@
# make lpmc related systemd services

46
scripts/update.sh Executable file
View file

@ -0,0 +1,46 @@
# update plugins and shit
setup_paperMC() {
# make paper.jar symlink in each server folder
echo "setting up paperMC"
# get the first search result for paper-*.jar
PAPER_FILE=$(find master -type f -name "paper-*.jar" | head -n 1)
# get directories in ./servers directory
SERVER_DIRS=($(find servers -maxdepth 1 -type d -not -path "servers"))
# make/replace symbolic link for paperMC
for SERVER_DIR in "${SERVER_DIRS[@]}"; do
PAPER_SYMLINK_PATH="$SERVER_DIR/paper.jar"
# check if symlink exists
if [ -L $PAPER_SYMLINK_PATH ]; then
rm $PAPER_SYMLINK_PATH
fi
ln -s "$PAPER_FILE" $PAPER_SYMLINK_PATH
done
}
setup_clearlagg() {
# https://dev.bukkit.org/projects/clearlagg/files/latest
:
}
setup_worldedit() {
:
}
### MAIN
# create master directory if it doesn't exist
if [ ! -d master ]; then
mkdir master
fi
LOBBY_SERVER_PLUGINS=()
SMP_SERVER_PLUGINS=()
ANARCHY_SERVER_PLUGINS=()
setup_paperMC

BIN
server-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

0
servers/.gitkeep Normal file
View file

View file

@ -0,0 +1,4 @@
[Service]
ExecStart=/home/ubuntu/LPMC/scripts/start.sh lobby
Restart=on-failure
WorkingDirectory=/home/ubuntu/LPMC

View file

@ -0,0 +1,4 @@
[Service]
ExecStart=/home/ubuntu/LPMC/scripts/start.sh smp
Restart=on-failure
WorkingDirectory=/home/ubuntu/LPMC

View file

@ -0,0 +1,4 @@
[Service]
ExecStart=/home/ubuntu/LPMC/scripts/start.sh waterfall
Restart=on-failure
WorkingDirectory=/home/ubuntu/LPMC

8
waterfall.yml Normal file
View file

@ -0,0 +1,8 @@
use_netty_dns_resolver: true
disable_modern_tab_limiter: true
log_initial_handler_connections: true
throttling:
tab_complete: 1000
game_version: ""
disable_tab_list_rewrite: false
disable_entity_metadata_rewrite: false