upgpkg: minecraft-server 1.13.2-3
Adapt the `is_player_online` function to be a little more generic. This fixes detecting players on cuberite even with the most recent version. upgpkg: cuberite 1.12b1014-1 upgpkg: spigot 1.13.2+b93-1
This commit is contained in:
parent
fc300f4fd6
commit
53426af2a7
4
.SRCINFO
4
.SRCINFO
|
@ -1,7 +1,7 @@
|
||||||
pkgbase = minecraft-server
|
pkgbase = minecraft-server
|
||||||
pkgdesc = Minecraft server unit files, script, and jar
|
pkgdesc = Minecraft server unit files, script, and jar
|
||||||
pkgver = 1.13.2
|
pkgver = 1.13.2
|
||||||
pkgrel = 2
|
pkgrel = 3
|
||||||
url = https://minecraft.net/
|
url = https://minecraft.net/
|
||||||
install = minecraft-server.install
|
install = minecraft-server.install
|
||||||
arch = any
|
arch = any
|
||||||
|
@ -29,6 +29,6 @@ pkgbase = minecraft-server
|
||||||
sha512sums = 19ee3646bfbace353b65c0373594edb654de11c9671f29cebad3b31109f29f94ade1d529d9f409b0989c376bef9b451585b22a1e0ac4295fcc92d9565f808418
|
sha512sums = 19ee3646bfbace353b65c0373594edb654de11c9671f29cebad3b31109f29f94ade1d529d9f409b0989c376bef9b451585b22a1e0ac4295fcc92d9565f808418
|
||||||
sha512sums = 5203f6331f740ecfcea2a2cc653603ae97419baa89e08512f9d8feb63e4a52978442a69b313eccd9037b676a62ab528e2b533c0fb95a9c7177318279fe0cde79
|
sha512sums = 5203f6331f740ecfcea2a2cc653603ae97419baa89e08512f9d8feb63e4a52978442a69b313eccd9037b676a62ab528e2b533c0fb95a9c7177318279fe0cde79
|
||||||
sha512sums = 73132ec613e05c8ed7ebe4eda2395f1ea0733ffe94ba7e203e06246d5852139bbfb7a9073b2b01891282339a2f85676699cd889cde79d6317066e27fd65b1d67
|
sha512sums = 73132ec613e05c8ed7ebe4eda2395f1ea0733ffe94ba7e203e06246d5852139bbfb7a9073b2b01891282339a2f85676699cd889cde79d6317066e27fd65b1d67
|
||||||
sha512sums = 0c7a3f96cff73d164a77d8eaca5848e39063c3e82f146e927cf950f2d934b17672fe7e4eb7612af48d10372658a81ccc41deab176fd373950561bd711ec85dfe
|
sha512sums = ae63eeab451637b924762a6887c47d7bdffecacae61ea6e1fe1a280da2eb10ea3cc6dd1fbf2a1c395be97ec56ee67da795445c167d1cdb85664e3e0e3871d607
|
||||||
|
|
||||||
pkgname = minecraft-server
|
pkgname = minecraft-server
|
||||||
|
|
4
PKGBUILD
4
PKGBUILD
|
@ -5,7 +5,7 @@
|
||||||
pkgname=minecraft-server
|
pkgname=minecraft-server
|
||||||
pkgver=1.13.2
|
pkgver=1.13.2
|
||||||
_nonce=3737db93722a9e39eeada7c27e7aca28b144ffa7
|
_nonce=3737db93722a9e39eeada7c27e7aca28b144ffa7
|
||||||
pkgrel=2
|
pkgrel=3
|
||||||
pkgdesc="Minecraft server unit files, script, and jar"
|
pkgdesc="Minecraft server unit files, script, and jar"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
url="https://minecraft.net/"
|
url="https://minecraft.net/"
|
||||||
|
@ -28,7 +28,7 @@ sha512sums=('c9a98f1d224519369d6c4882cfe93a94983661c0c0b8a7f0b2f271af752fde56930
|
||||||
'19ee3646bfbace353b65c0373594edb654de11c9671f29cebad3b31109f29f94ade1d529d9f409b0989c376bef9b451585b22a1e0ac4295fcc92d9565f808418'
|
'19ee3646bfbace353b65c0373594edb654de11c9671f29cebad3b31109f29f94ade1d529d9f409b0989c376bef9b451585b22a1e0ac4295fcc92d9565f808418'
|
||||||
'5203f6331f740ecfcea2a2cc653603ae97419baa89e08512f9d8feb63e4a52978442a69b313eccd9037b676a62ab528e2b533c0fb95a9c7177318279fe0cde79'
|
'5203f6331f740ecfcea2a2cc653603ae97419baa89e08512f9d8feb63e4a52978442a69b313eccd9037b676a62ab528e2b533c0fb95a9c7177318279fe0cde79'
|
||||||
'73132ec613e05c8ed7ebe4eda2395f1ea0733ffe94ba7e203e06246d5852139bbfb7a9073b2b01891282339a2f85676699cd889cde79d6317066e27fd65b1d67'
|
'73132ec613e05c8ed7ebe4eda2395f1ea0733ffe94ba7e203e06246d5852139bbfb7a9073b2b01891282339a2f85676699cd889cde79d6317066e27fd65b1d67'
|
||||||
'0c7a3f96cff73d164a77d8eaca5848e39063c3e82f146e927cf950f2d934b17672fe7e4eb7612af48d10372658a81ccc41deab176fd373950561bd711ec85dfe')
|
'ae63eeab451637b924762a6887c47d7bdffecacae61ea6e1fe1a280da2eb10ea3cc6dd1fbf2a1c395be97ec56ee67da795445c167d1cdb85664e3e0e3871d607')
|
||||||
|
|
||||||
_game="minecraft"
|
_game="minecraft"
|
||||||
_server_root="/srv/minecraft"
|
_server_root="/srv/minecraft"
|
||||||
|
|
|
@ -82,14 +82,16 @@ game_command() {
|
||||||
# Check whether there are player on the server through list
|
# Check whether there are player on the server through list
|
||||||
is_player_online() {
|
is_player_online() {
|
||||||
response="$(sleep_time=0.6 return_stdout=true game_command list)"
|
response="$(sleep_time=0.6 return_stdout=true game_command list)"
|
||||||
|
# Delete leading line and free response string from fancy characters
|
||||||
|
response="$(echo "${response}" | sed -r -e '$!d' -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[JKmsuG]//g')"
|
||||||
# The list command prints a line containing the usernames after the last occurrence of ": "
|
# The list command prints a line containing the usernames after the last occurrence of ": "
|
||||||
# and since playernames may not contain this string the clean player-list can easily be retrieved.
|
# and since playernames may not contain this string the clean player-list can easily be retrieved.
|
||||||
# Otherwiese check the first digit after the last occurrence of "There are". If it is 0 then there
|
# Otherwiese check the first digit after the last occurrence of "There are". If it is 0 then there
|
||||||
# are no players on the server. Should this test fail as well. Assume that a player is online.
|
# are no players on the server. Should this test fail as well. Assume that a player is online.
|
||||||
if [[ $(echo "${response}" | grep ":" | sed -r -e '$!d' -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[JKmsuG]//g' -e 's/.*\: //' | tr -d '\n' | wc -c) -le 1 ]]; then
|
if [[ $(echo "${response}" | grep ":" | sed -e 's/.*\: //' | tr -d '\n' | wc -c) -le 1 ]]; then
|
||||||
# No player is online
|
# No player is online
|
||||||
return 0
|
return 0
|
||||||
elif [[ $(echo "${response}" | grep "There are" | sed -r -e '$!d' -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[JKmsuG]//g' -e 's/.*\: //' -e 's/^([^.]+).*$/\1/; s/^[^0-9]*([0-9]+).*$/\1/' | tr -d '\n') -eq 0 ]]; then
|
elif [[ "x$(echo "${response}" | grep "There are" | sed -r -e 's/.*\: //' -e 's/^([^.]+).*$/\1/; s/^[^0-9]*([0-9]+).*$/\1/' | tr -d '\n')" == "x0" ]]; then
|
||||||
# No player is online
|
# No player is online
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user