|
|
@ -23,6 +23,7 @@ func printUserScreen(redisClient *redis.Client, username string) string { |
|
|
|
println(" e) Edit config") |
|
|
|
println(" e) Edit config") |
|
|
|
println(" r) Recover from crash") |
|
|
|
println(" r) Recover from crash") |
|
|
|
fmt.Printf(" p) Play NetHack %s\n", config.NethackLauncher.NethackVersion) |
|
|
|
fmt.Printf(" p) Play NetHack %s\n", config.NethackLauncher.NethackVersion) |
|
|
|
|
|
|
|
fmt.Printf(" o) Play Shadow of the Wyrm %s\n", config.NethackLauncher.SotwVersion) |
|
|
|
println(" q) Quit") |
|
|
|
println(" q) Quit") |
|
|
|
println("") |
|
|
|
println("") |
|
|
|
fmt.Printf(">> ") |
|
|
|
fmt.Printf(">> ") |
|
|
@ -73,6 +74,15 @@ func printUserScreen(redisClient *redis.Client, username string) string { |
|
|
|
wg.Wait() |
|
|
|
wg.Wait() |
|
|
|
close(watcher) |
|
|
|
close(watcher) |
|
|
|
printUserScreen(redisClient, username) |
|
|
|
printUserScreen(redisClient, username) |
|
|
|
|
|
|
|
case "o": |
|
|
|
|
|
|
|
wg.Add(1) |
|
|
|
|
|
|
|
currentTime := time.Now().UTC() |
|
|
|
|
|
|
|
fulltime := currentTime.Format("2006-01-02.03:04:05") |
|
|
|
|
|
|
|
go runSotwGame(username, fulltime) |
|
|
|
|
|
|
|
watcher := startWatcher(username, fulltime, redisClient) |
|
|
|
|
|
|
|
wg.Wait() |
|
|
|
|
|
|
|
close(watcher) |
|
|
|
|
|
|
|
printUserScreen(redisClient, username) |
|
|
|
case "r": |
|
|
|
case "r": |
|
|
|
clearScreen() |
|
|
|
clearScreen() |
|
|
|
recoverSave(redisClient, username) |
|
|
|
recoverSave(redisClient, username) |
|
|
|