diff options
author | Zach Latta <zach@zachlatta.com> | 2016-03-06 12:56:51 -0500 |
---|---|---|
committer | Zach Latta <zach@zachlatta.com> | 2016-03-06 12:56:51 -0500 |
commit | 0a27437cf52084b5ff91c260c1598ba52f8aed96 (patch) | |
tree | 7e6c19ea3884065e555698dfe596546983ae9b42 | |
parent | b5384e589826ba8114f1954ba690ffc2d094ee60 (diff) | |
download | sshtron-0a27437cf52084b5ff91c260c1598ba52f8aed96.tar.gz |
Print current user stats on user join
-rw-r--r-- | main.go | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 } } |