Browse Source

Add run command

master
Matthew Faltys 5 years ago
parent
commit
3d7df54d20
  1. 9
      nethack-launcher.go

9
nethack-launcher.go

@ -163,7 +163,7 @@ func printUserScreen(redisClient *redis.Client, username string) string {
println("")
println(" l) Logout")
println(" w) Watch games in progress")
println(" p) Play NetHack 3.4.3")
println(" p) Play NetHack 3.6.0")
println(" q) Quit")
println("")
fmt.Printf(">> ")
@ -186,7 +186,12 @@ func printUserScreen(redisClient *redis.Client, username string) string {
// restart display
exec.Command("stty", "-F", "/dev/tty", "echo", "-cbreak").Run()
clearScreen()
os.Exit(0)
nh := exec.Command("nethack", "-u", username)
nh.Stdout = os.Stdout
nh.Stdin = os.Stdin
nh.Stderr = os.Stderr
nh.Run()
printUserScreen(redisClient, username)
case "q":
clearScreen()
os.Exit(0)

Loading…
Cancel
Save