|
|
|
@ -441,8 +441,8 @@ func printProgressScreen(redisClient *redis.Client, username string) {
|
|
|
|
|
// restart display
|
|
|
|
|
exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run() |
|
|
|
|
clearScreen() |
|
|
|
|
//nh := exec.Command("ttyplay", "-p", ttyrecPath)
|
|
|
|
|
nh := exec.Command("termplay", "-f", "live", ttyrecPath) |
|
|
|
|
nh := exec.Command("ttyplay", "-p", ttyrecPath) |
|
|
|
|
//nh := exec.Command("termplay", "-f", "live", ttyrecPath)
|
|
|
|
|
nh.Stdout = os.Stdout |
|
|
|
|
nh.Stdin = os.Stdin |
|
|
|
|
nh.Stderr = os.Stderr |
|
|
|
@ -458,14 +458,14 @@ func printProgressScreen(redisClient *redis.Client, username string) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func runGame(username, timestamp string) { |
|
|
|
|
exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run() |
|
|
|
|
clearScreen() |
|
|
|
|
|
|
|
|
|
// put together users home dir
|
|
|
|
|
homeDir := fmt.Sprintf("%s/user/%s/", 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() |
|
|
|
|
//nh := exec.Command("ttyrec", ttyrecPath, "-e", "nethack")
|
|
|
|
|
nh := exec.Command("termrec", ttyrecPath, "-e", "nethack") |
|
|
|
|
//nh := exec.Command("termrec", ttyrecPath, "-e", "nethack")
|
|
|
|
|
|
|
|
|
|
nh := exec.Command("ttyrec", "-f", ttyrecPath, "--", "nethack") |
|
|
|
|
nh.Env = os.Environ() |
|
|
|
|
nh.Env = append(nh.Env, fmt.Sprintf("HOME=%s", homeDir)) |
|
|
|
|
nh.Env = append(nh.Env, fmt.Sprintf("USER=%s", username)) |
|
|
|
@ -477,9 +477,6 @@ func runGame(username, timestamp string) {
|
|
|
|
|
if err != nil { |
|
|
|
|
fmt.Print(err) |
|
|
|
|
} |
|
|
|
|
fmt.Printf("%v\n", nh.Stdout) |
|
|
|
|
fmt.Printf("%v\n", nh.Stdin) |
|
|
|
|
fmt.Printf("%v\n", nh.Stderr) |
|
|
|
|
exec.Command("exit").Run() |
|
|
|
|
wg.Done() |
|
|
|
|
} |
|
|
|
|