aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Latta <zach@zachlatta.com>2016-03-06 12:56:51 -0500
committerZach Latta <zach@zachlatta.com>2016-03-06 12:56:51 -0500
commit0a27437cf52084b5ff91c260c1598ba52f8aed96 (patch)
tree7e6c19ea3884065e555698dfe596546983ae9b42
parentb5384e589826ba8114f1954ba690ffc2d094ee60 (diff)
downloadsshtron-0a27437cf52084b5ff91c260c1598ba52f8aed96.tar.gz
Print current user stats on user join
-rw-r--r--main.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.go b/main.go
index 26e1063..15b8341 100644
--- a/main.go
+++ b/main.go
@@ -44,11 +44,16 @@ func handler(conn net.Conn, gm *GameManager, config *ssh.ServerConfig) {
return
}
+ // TODO: Remove this -- only temporary while we launch on HN
+ //
+ // To see how many concurrent users are online
+ fmt.Printf("Player joined. Current stats: %d users, %d games\n",
+ gm.SessionCount(), gm.GameCount())
+
// Reject all out of band requests accept for the unix defaults, pty-req and
// shell.
go func(in <-chan *ssh.Request) {
for req := range in {
- fmt.Println("New request:", req.Type)
switch req.Type {
case "pty-req":
req.Reply(true, nil)
@@ -61,8 +66,6 @@ func handler(conn net.Conn, gm *GameManager, config *ssh.ServerConfig) {
}
}(requests)
- fmt.Println("Received new connection")
-
gm.HandleChannel <- channel
}
}
Un proyecto texto-plano.xyz