Browse Source

Set players home dir on start

master
Matthew Faltys 5 years ago
parent
commit
c10635be99
  1. 4
      nethack-launcher.go

4
nethack-launcher.go

@ -442,7 +442,9 @@ func printProgressScreen(redisClient *redis.Client, username string) {
} }
func runGame(username, timestamp 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) ttyrecPath := fmt.Sprintf("%s/user/%s/ttyrec/%s.ttyrec", config.NethackLauncher.HackDir, username, timestamp)
exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run() exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run()
clearScreen() clearScreen()

Loading…
Cancel
Save