环
描述
一个社区驱动的多人模组,适用于Rimworld。
127 浏览
5 下载
2026-07-01
更新于 21 小时前
预设配置详情
registry.cn-shanghai.aliyuncs.com/pterodactyl-images/yolks:dotnet_7
./GameServer
| 变量名 | 变量 | 描述 | 默认值 | 规则 | 可查看 | 可编辑 |
|---|---|---|---|---|---|---|
| 版本 | VERSION |
latest |
required|string|max:20
必填 字符串 最大 20
|
|||
| 最大玩家数 | MAX_PLAYERS |
可以加入的最大玩家数量。默认值:100 | 100 |
required|numeric|between:1,150
必填 数字 介于 1-150 之间
|
||
| 详细 | VERBOSE |
控制台输出是否应详细显示。 | false |
required|string|in:false,true
必填 字符串 选项: false,true
|
镜像
registry.cn-shanghai.aliyuncs.com/pterodactyl-images/installers:debian
入口
bash
#!/usr/bin/env bash
set -euo pipefail
# 1. Set repository variables
OWNER="RimWorldTogether"
REPO="Rimworld-Together"
# 2. Detect architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64) MATCH="linux-x64" ;;
aarch64) MATCH="linux-arm64" ;;
arm) MATCH="linux-arm" ;;
*) echo "Architecture '$ARCH' not supported"; exit 1 ;;
esac
# 3. Collect API data
if [[ -z "${VERSION:-}" ]] || [[ "${VERSION}" == "latest" ]]; then
# Latest release
JSON=$(curl -sSL "https://api.github.com/repos/$OWNER/$REPO/releases/latest")
else
# All releases (to check if the tag exists)
ALL=$(curl -sSL "https://api.github.com/repos/$OWNER/$REPO/releases")
# Checks the existence of the tag
TAG_EXISTS=$(echo "$ALL" | jq -r --arg V "$VERSION" '.[] | select(.tag_name==$V) | .tag_name')
if [[ -z "$TAG_EXISTS" ]]; then
echo "Tag '$VERSION' not found; using latest"
JSON=$(curl -sSL "https://api.github.com/repos/$OWNER/$REPO/releases/latest")
else
JSON=$(echo "$ALL" | jq -r --arg V "$VERSION" '.[] | select(.tag_name==$V)')
fi
fi
# 4. Extract correct asset download URL
DOWNLOAD_URL=$(echo "$JSON" \
| jq -r '.assets[].browser_download_url' \
| grep -i "$MATCH")
if [[ -z "$DOWNLOAD_URL" ]]; then
echo "No assets found for architecture '$MATCH'"
exit 1
fi
# 5. Prepare directory and download
mkdir -p /mnt/server
cd /mnt/server
echo "Downloading: $DOWNLOAD_URL"
curl -sSL -o server.zip "$DOWNLOAD_URL"
unzip -o server.zip
rm server.zip
# 6. Adjust permissions
chmod +x GameServer
# 7. Generate configuration if needed
CONFIG="/mnt/server/Configs/ServerConfig.json"
if [[ -f "$CONFIG" ]]; then
echo "Config file exists"
else
mkdir -p /mnt/server/Configs
# Use jq -n to create JSON from environment variables
jq -n \
--argjson port "${SERVER_PORT:-0}" \
--argjson maxPlayers "${MAX_PLAYERS:-0}" \
--argjson verboseLogs "${VERBOSE:-false}" \
'{
Port: $port,
MaxPlayers: $maxPlayers,
verboseLogs: $verboseLogs
}' > "$CONFIG"
echo "Config file created in $CONFIG"
fi
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v2",
"update_url": "https://eggs.pterodactyl.top/eggs/245/download/egg-rimworld-together.json"
},
"exported_at": "2025-05-03T06:57:38-04:00",
"name": "Rimworld Together",
"author": "josdekurk@gmail.com",
"description": "一个社区驱动的多人模组,适用于Rimworld。",
"features": null,
"docker_images": {
"registry.cn-shanghai.aliyuncs.com/pterodactyl-images/yolks:dotnet_7": "registry.cn-shanghai.aliyuncs.com/pterodactyl-images/yolks:dotnet_7"
},
"file_denylist": [],
"startup": "./GameServer",
"config": {
"files": "{\r\n \"Configs/ServerConfig.json\": {\r\n \"parser\": \"json\",\r\n \"find\": {\r\n \"IP\": \"0.0.0.0\",\r\n \"Port\": \"{{server.build.default.port}}\",\r\n \"MaxPlayers\": \"{{server.build.env.MAX_PLAYERS}}\",\r\n \"verboseLogs\": \"{{server.build.env.VERBOSE}}\"\r\n }\r\n }\r\n}",
"startup": "{\r\n \"done\": \"Server launched\"\r\n}",
"logs": "{}",
"stop": "quit"
},
"scripts": {
"installation": {
"script": "#!/usr/bin/env bash\r\nset -euo pipefail\r\n\r\n# 1. Set repository variables\r\nOWNER=\"RimWorldTogether\"\r\nREPO=\"Rimworld-Together\"\r\n\r\n# 2. Detect architecture\r\nARCH=$(uname -m)\r\ncase \"$ARCH\" in\r\n x86_64) MATCH=\"linux-x64\" ;;\r\n aarch64) MATCH=\"linux-arm64\" ;;\r\n arm) MATCH=\"linux-arm\" ;;\r\n *) echo \"Architecture '$ARCH' not supported\"; exit 1 ;;\r\nesac\r\n\r\n# 3. Collect API data\r\nif [[ -z \"${VERSION:-}\" ]] || [[ \"${VERSION}\" == \"latest\" ]]; then\r\n # Latest release\r\n JSON=$(curl -sSL \"https://api.github.com/repos/$OWNER/$REPO/releases/latest\")\r\nelse\r\n # All releases (to check if the tag exists)\r\n ALL=$(curl -sSL \"https://api.github.com/repos/$OWNER/$REPO/releases\")\r\n # Checks the existence of the tag\r\n TAG_EXISTS=$(echo \"$ALL\" | jq -r --arg V \"$VERSION\" '.[] | select(.tag_name==$V) | .tag_name')\r\n if [[ -z \"$TAG_EXISTS\" ]]; then\r\n echo \"Tag '$VERSION' not found; using latest\"\r\n JSON=$(curl -sSL \"https://api.github.com/repos/$OWNER/$REPO/releases/latest\")\r\n else\r\n JSON=$(echo \"$ALL\" | jq -r --arg V \"$VERSION\" '.[] | select(.tag_name==$V)')\r\n fi\r\nfi\r\n\r\n# 4. Extract correct asset download URL\r\nDOWNLOAD_URL=$(echo \"$JSON\" \\\r\n | jq -r '.assets[].browser_download_url' \\\r\n | grep -i \"$MATCH\")\r\n\r\nif [[ -z \"$DOWNLOAD_URL\" ]]; then\r\n echo \"No assets found for architecture '$MATCH'\"\r\n exit 1\r\nfi\r\n\r\n# 5. Prepare directory and download\r\nmkdir -p /mnt/server\r\ncd /mnt/server\r\n\r\necho \"Downloading: $DOWNLOAD_URL\"\r\ncurl -sSL -o server.zip \"$DOWNLOAD_URL\"\r\nunzip -o server.zip\r\nrm server.zip\r\n\r\n# 6. Adjust permissions\r\nchmod +x GameServer\r\n\r\n# 7. Generate configuration if needed\r\nCONFIG=\"/mnt/server/Configs/ServerConfig.json\"\r\nif [[ -f \"$CONFIG\" ]]; then\r\n echo \"Config file exists\"\r\nelse\r\n mkdir -p /mnt/server/Configs\r\n\r\n # Use jq -n to create JSON from environment variables\r\n jq -n \\\r\n --argjson port \"${SERVER_PORT:-0}\" \\\r\n --argjson maxPlayers \"${MAX_PLAYERS:-0}\" \\\r\n --argjson verboseLogs \"${VERBOSE:-false}\" \\\r\n '{\r\n Port: $port,\r\n MaxPlayers: $maxPlayers,\r\n verboseLogs: $verboseLogs\r\n }' > \"$CONFIG\"\r\n\r\n echo \"Config file created in $CONFIG\"\r\nfi\r\n\r\n\r\necho \"-----------------------------------------\"\r\necho \"Installation completed...\"\r\necho \"-----------------------------------------\"",
"container": "registry.cn-shanghai.aliyuncs.com/pterodactyl-images/installers:debian",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "版本",
"description": "",
"env_variable": "VERSION",
"default_value": "latest",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|max:20",
"field_type": "text"
},
{
"name": "最大玩家数",
"description": "可以加入的最大玩家数量。默认值:100",
"env_variable": "MAX_PLAYERS",
"default_value": "100",
"user_viewable": true,
"user_editable": true,
"rules": "required|numeric|between:1,150",
"field_type": "text"
},
{
"name": "详细",
"description": "控制台输出是否应详细显示。",
"env_variable": "VERBOSE",
"default_value": "false",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|in:false,true",
"field_type": "text"
}
]
}附属文件
暂无附属文件
Fork 关系
查看关系图暂无 Fork,成为第一个 Fork 的人吧!
统计
127
浏览
5
下载
0
星标
0
复刻
作者
飒
飒爽师叔
UID: 1
279 预设
·
2026-06