Show Dialog On Crash + Add Troubleshooting Information To README

This commit is contained in:
TheBrokenRail 2020-12-10 17:16:44 -05:00
parent c1490a9685
commit 46cb46d6a1
4 changed files with 54 additions and 12 deletions

View File

@ -34,6 +34,16 @@ sudo apt update
sudo apt install -t buster-backports libseccomp2
```
## Troubleshooting Crashes
Game logs are located in ``/tmp/minecraft-pi``.
### ``Error response from daemon: error gathering device information while adding custom device "/dev/dri": no such file or directory``
Make sure you are using the correct GPU drivers for your system. If you are using a Raspberry Pi, make sure you have set your GPU driver to ``Full KMS`` or ``Fake KMS`` in ``raspi-config``.
### ``Segmentation Fault``
1. Attempt To Reproduce Issue And Record Instructions
2. Report On Issue Tracker Including The Instructions To Reproduce
## Dedicated Server
The dedicated server is a version of Minecraft: Pi Edition modified to run in a headless environment. It loads settings from a ``server.properties`` file.

View File

@ -26,12 +26,16 @@ if [ "$1" = "--print-features" ]; then
exit 0
fi
# Export Important Variables
export ZENITY_CLASS='Minecraft - Pi edition'
export DOCKER_COMPOSE="docker-compose -f /usr/share/minecraft-pi/client/docker-compose.yml"
# Ensure Features Are Selected
if [ -z "${MCPI_FEATURES+x}" ]; then
MCPI_FEATURES="$(sh -c "zenity --class 'Minecraft - Pi edition' --list --checklist --column 'Enabled' --column 'Feature' ${AVAILABLE_FEATURES}")"
MCPI_FEATURES="$(sh -c "zenity --class \"${ZENITY_CLASS}\" --list --checklist --column 'Enabled' --column 'Feature' ${AVAILABLE_FEATURES}")"
fi
if [ -z "${MCPI_USERNAME+x}" ]; then
MCPI_USERNAME="$(zenity --class 'Minecraft - Pi edition' --entry --text 'Minecraft Username:' --entry-text 'StevePi')"
MCPI_USERNAME="$(zenity --class "${ZENITY_CLASS}" --entry --text 'Minecraft Username:' --entry-text 'StevePi')"
fi
export MCPI_FEATURES
export MCPI_USERNAME
@ -44,8 +48,5 @@ fi
# Allow X11 Connections From Root
xhost local:root
# Update Docker Container
export DOCKER_COMPOSE="docker-compose -f /usr/share/minecraft-pi/client/docker-compose.yml"
# Run
exec sg docker /usr/lib/minecraft-pi/run.sh
sg docker /usr/lib/minecraft-pi/pre-launch.sh

View File

@ -0,0 +1,29 @@
#!/bin/sh
set -e
# Create Log Folder
rm -rf /tmp/minecraft-pi
mkdir -p /tmp/minecraft-pi
# Start Logging
LOG="$(mktemp -u)"
mkfifo "${LOG}"
tee /tmp/minecraft-pi/main.log < "${LOG}" &
TEE_PID=$!
# Run
set +e
/usr/lib/minecraft-pi/run.sh > "${LOG}" 2>&1
RET=$?
set -e
# Kill Logging
kill ${TEE_PID}
rm "${LOG}"
# Handle Crash
if [ $RET -ne 0 ]; then
zenity --class "${ZENITY_CLASS}" --error --no-wrap --text 'Minecraft: Pi Edition has crashed!\nLogs are located in /tmp/minecraft-pi.'
exit $RET
fi

View File

@ -3,14 +3,16 @@
set -e
# Start VirGL
virgl_test_server > /tmp/virgl.log 2>&1 &
VIRGL_PID="$!"
virgl_test_server > /tmp/minecraft-pi/virgl.log 2>&1 &
VIRGL_PID=$!
# Launch Minecraft
${DOCKER_COMPOSE} run --rm minecraft-pi || :
RET="$?"
set +e
${DOCKER_COMPOSE} run --rm minecraft-pi
RET=$?
set -e
# Kill VirGL
kill "${VIRGL_PID}"
kill ${VIRGL_PID}
exit "${RET}"
exit ${RET}