|
|
|
@ -40,6 +40,28 @@ func runGame(username, timestamp string) {
|
|
|
|
|
wg.Done() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func runSotwGame(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) |
|
|
|
|
|
|
|
|
|
nh := exec.Command("ttyrec", "-f", ttyrecPath, "--", "./ShadowOfTheWyrm") |
|
|
|
|
//nh := exec.Command("./ShadowOfTheWyrm")
|
|
|
|
|
nh.Dir = (config.NethackLauncher.SotwRoot) |
|
|
|
|
nh.Stdout = os.Stdout |
|
|
|
|
nh.Stdin = os.Stdin |
|
|
|
|
nh.Stderr = os.Stderr |
|
|
|
|
err := nh.Run() |
|
|
|
|
if err != nil { |
|
|
|
|
fmt.Print(err) |
|
|
|
|
} |
|
|
|
|
exec.Command("exit").Run() |
|
|
|
|
wg.Done() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func runtimeRecover(username string) { |
|
|
|
|
fmt.Printf(" %s\n", config.NethackLauncher.ServerDisplay) |
|
|
|
|
println("") |
|
|
|
|