Browse Source

Fix spectate screen not loading issue

develop
Matthew Faltys 5 years ago
parent
commit
80a45f4736
  1. 2
      config.gcfg
  2. 3
      deps/Dockerfile
  3. 3
      nethack-launcher/print_progress_screen.go

2
config.gcfg

@ -1,7 +1,7 @@
[nethacklauncher]
loglevel = "debug"
serverdisplay = "unixvoid.com underground nethack server"
nethackversion = "3.7.0-nightly"
nethackversion = "3.6.3"
hackdir = "/hack"
nhdatlocation = "/NetHack/dat/nhdat"
recoverbinary = "/NetHack/util/recover"

3
deps/Dockerfile vendored

@ -5,7 +5,6 @@ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
redis-server \
openssh-server \
curl \
autoconf \
bison \
bsdmainutils \
@ -32,13 +31,13 @@ RUN apt-get clean
#
RUN git clone https://github.com/NetHack/NetHack.git
RUN cd NetHack && \
git checkout NetHack-3.6 && \
sed -i 's/#ifndef SYSCF/#ifdef SYSCF/g' include/config.h && \
sys/unix/setup.sh sys/unix/hints/linux && \
sed -i '/POSTINSTALL=/d' Makefile && \
sed -i 's/.*-DSYSCF -DSYSCF_FILE=.*/CFLAGS+=-DSECURE/' Makefile && \
sed -i 's/#CFLAGS+=-DSCORE_ON_BOTL/CFLAGS+=-DSCORE_ON_BOTL/' Makefile && \
cat Makefile && \
make fetch-Lua && \
make all && \
make install
RUN find /* -name nethack

3
nethack-launcher/print_progress_screen.go

@ -75,11 +75,12 @@ func printProgressScreen(redisClient *redis.Client, username string) {
// set ttyrec path
ttyName, _ := redisClient.Get(fmt.Sprintf("inprogress:%s", user[0])).Result()
ttyrecPath := fmt.Sprintf("%s/user/%s/ttyrec/%s.ttyrec", config.NethackLauncher.HackDir, user[0], ttyName)
fullCommand := fmt.Sprintf("ttyplay -n %s && ttyplay -p %s", ttyrecPath, ttyrecPath)
// restart display
exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run()
clearScreen()
nh := exec.Command("ttyplay", "-p", ttyrecPath)
nh := exec.Command("bash", "-c", fullCommand)
nh.Stdout = os.Stdout
nh.Stdin = os.Stdin
nh.Stderr = os.Stderr

Loading…
Cancel
Save