From c10635be99def53d0058699b0bc9fc4d2eb8a5d2 Mon Sep 17 00:00:00 2001 From: Matthew Faltys Date: Wed, 13 Nov 2019 04:08:24 +0000 Subject: [PATCH] Set players home dir on start --- nethack-launcher.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nethack-launcher.go b/nethack-launcher.go index 3813b7d..234a6fc 100644 --- a/nethack-launcher.go +++ b/nethack-launcher.go @@ -442,7 +442,9 @@ func printProgressScreen(redisClient *redis.Client, username string) { } func runGame(username, timestamp string) { - nhCommand := fmt.Sprintf("nethack -d %s -u %s\n", config.NethackLauncher.HackDir, username) + // put together users home dir + homeDir := fmt.Sprintf("%s/user/%s/", config.NethackLauncher.HackDir, username) + nhCommand := fmt.Sprintf("HOME=%s nethack -d %s -u %s\n", homeDir, config.NethackLauncher.HackDir, username) ttyrecPath := fmt.Sprintf("%s/user/%s/ttyrec/%s.ttyrec", config.NethackLauncher.HackDir, username, timestamp) exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run() clearScreen()