|
|
@ -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 |
|
|
|