Package Details: cuberite 1.12b1014-2

Git Clone URL: https://aur.archlinux.org/cuberite.git (read-only)
Package Base: cuberite
Description: A Minecraft-compatible multiplayer game server that is written in C++ and designed to be efficient with memory and CPU, as well as having a flexible Lua Plugin API. It is compatible with the vanilla Minecraft client.
Upstream URL: https://cuberite.org/
Keywords: C C++ efficient load minecraft optimized plugin server speed
Licenses: Apache
Provides: minecraft-server=1.12, spigot=1.12
Submitter: edh
Maintainer: edh
Last Packager: edh
Votes: 7
Popularity: 0.001093
First Submitted: 2016-05-28 18:48
Last Updated: 2019-03-29 11:41

Dependencies (8)

Required by (0)

Sources (8)

Pinned Comments

edh commented on 2016-12-11 20:51

You can quit the console without shutting down the server by press ctrl+a d (first ctrl+a and after releasing the buttons press d). This will detach your input from the server console. The attaching and detaching is done with GNU screen since it lets you view and type into the console, sent single commands to it and keep it alive without a connected user. Take a look at the the command overview at the ArchWiki [1] to get a feel for its power.

[1] https://wiki.archlinux.org/index.php/GNU_Screen#Common_Commands

Latest Comments

1 2 Next › Last »

edh commented on 2019-04-05 08:48

@carey The management script would ideally work for more than just those three servers. Note, the regex is not that complicated and is properly explained in comments surrounding the expressions. Surely it is not more complex than the regex which you proposed disregarding the removal of colors from the string. It is juts more general. Imagine if I were to introduce the change. The three if statements would basically all look the same and I would probably be asked the question why I do not merge them.

carey commented on 2019-04-05 02:22

@edh Sorry, but honestly, I'm just going to stick with my patch. I know it works and I trust it more than the huge regexes currently in the script.

Since it seems like trying to use the same script for multiple servers is where most of the regex complexity comes from, it might be better to set it up something like this:

# change this line depending on the server you're using
server_type="cuberite"

is_player_online(){
  if [ "$server_type" == "cuberite" ]; then
    # do cuberite check
  elif [ "$server_type" == "spigot" ]; then
    # do spigot check
  # ...
  fi
}

That way you can still use the same script for all the packages you maintain (thank you!), but can have simpler code where they differ.

edh commented on 2019-03-27 13:08

@carey I think I found the bug; I made a mistake during a string comparison. The following change should fix the observed problem:

@@ -82,14 +82,16 @@ game_command() {
 # Check whether there are player on the server through list
 is_player_online() {
        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 ": "
        # 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
        # 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
                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
                return 0
        else

The first check should always have reported that there are indeed players online but the second check probably passed without being supposed to do so. This should now be fixed. I would be thrilled if you could test the change and report back to me, whether this indeed solved the problem. If it does, I will roll out the change immediately.

edh commented on 2019-03-27 12:30

@carey The script is intended to serve minecraft, spigot and cuberite. All of them are quite different and like to print fancy output strings. As such it is not possible to just replace the is_player_online check with one simple query. Can you please send me the full output of the list command, and I will do my best to incorporate it into the script.

For now, the following change should work for you:

@@ -92,6 +92,9 @@ is_player_online() {
        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
                # No player is online
                return 0
+       elif [[ $(echo "${response}" | sed -n -e 's/^.*Players (\(.*\)):.*$/\1/p') -eq 0 ]]; then
+               # No player is online
+               return 0
        else
                # A player is online (or it could not be determined)
                return 1

carey commented on 2019-03-26 17:35

The player detection currently isn't working for me. This causes the server to always shut down after $IDLE_IF_TIME seconds regardless of if any players were connected. I had a look at the launch script and the comments make it seem like the format of the "list" command response has changed.

I've updated the is_player_online function to work with the current version. The code is available here: https://pastebin.com/r4i0WMUU

@edh: Would you me able to integrate this change into the package?

edh commented on 2017-11-04 10:20

@rumbah
Done.

rumbah commented on 2017-11-04 00:03

Would you mind to update the package to the latest build (908 at the moment). Then the server would support client version 1.12.2 .

Thanks

edh commented on 2017-06-27 15:56

@Alpaone
Done.
However I would encourage you to increase the build tag yourself for small releases. The variable (_build) is easily editable and there are no further changes required.

Alpaone commented on 2017-06-27 15:41

I would appreciate it if you could update the package to a build newer than 784.

Thank you :)

edh commented on 2017-06-18 09:36

@steadybright
Done. Unfortunately AFAIK they do not provide tagged release but only refer to the last successful builds and it is therefore hard to keep track of.