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] [nethacklauncher]
loglevel = "debug" loglevel = "debug"
serverdisplay = "unixvoid.com underground nethack server" serverdisplay = "unixvoid.com underground nethack server"
nethackversion = "3.7.0-nightly" nethackversion = "3.6.3"
hackdir = "/hack" hackdir = "/hack"
nhdatlocation = "/NetHack/dat/nhdat" nhdatlocation = "/NetHack/dat/nhdat"
recoverbinary = "/NetHack/util/recover" recoverbinary = "/NetHack/util/recover"

3
deps/Dockerfile vendored

@ -5,7 +5,6 @@ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \ DEBIAN_FRONTEND=noninteractive apt-get install -y \
redis-server \ redis-server \
openssh-server \ openssh-server \
curl \
autoconf \ autoconf \
bison \ bison \
bsdmainutils \ bsdmainutils \
@ -32,13 +31,13 @@ RUN apt-get clean
# #
RUN git clone https://github.com/NetHack/NetHack.git RUN git clone https://github.com/NetHack/NetHack.git
RUN cd NetHack && \ RUN cd NetHack && \
git checkout NetHack-3.6 && \
sed -i 's/#ifndef SYSCF/#ifdef SYSCF/g' include/config.h && \ sed -i 's/#ifndef SYSCF/#ifdef SYSCF/g' include/config.h && \
sys/unix/setup.sh sys/unix/hints/linux && \ sys/unix/setup.sh sys/unix/hints/linux && \
sed -i '/POSTINSTALL=/d' Makefile && \ sed -i '/POSTINSTALL=/d' Makefile && \
sed -i 's/.*-DSYSCF -DSYSCF_FILE=.*/CFLAGS+=-DSECURE/' Makefile && \ sed -i 's/.*-DSYSCF -DSYSCF_FILE=.*/CFLAGS+=-DSECURE/' Makefile && \
sed -i 's/#CFLAGS+=-DSCORE_ON_BOTL/CFLAGS+=-DSCORE_ON_BOTL/' Makefile && \ sed -i 's/#CFLAGS+=-DSCORE_ON_BOTL/CFLAGS+=-DSCORE_ON_BOTL/' Makefile && \
cat Makefile && \ cat Makefile && \
make fetch-Lua && \
make all && \ make all && \
make install make install
RUN find /* -name nethack 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 // set ttyrec path
ttyName, _ := redisClient.Get(fmt.Sprintf("inprogress:%s", user[0])).Result() 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) 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 // restart display
exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run() exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run()
clearScreen() clearScreen()
nh := exec.Command("ttyplay", "-p", ttyrecPath) nh := exec.Command("bash", "-c", fullCommand)
nh.Stdout = os.Stdout nh.Stdout = os.Stdout
nh.Stdin = os.Stdin nh.Stdin = os.Stdin
nh.Stderr = os.Stderr nh.Stderr = os.Stderr

Loading…
Cancel
Save