aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/main.go b/main.go
index bd26db0..2591340 100644
--- a/main.go
+++ b/main.go
@@ -2,11 +2,12 @@ package main
import (
"fmt"
- "golang.org/x/crypto/ssh"
"io/ioutil"
"net"
"net/http"
"os"
+
+ "golang.org/x/crypto/ssh"
)
const (
@@ -22,7 +23,7 @@ func handler(conn net.Conn, gm *GameManager, config *ssh.ServerConfig) {
// net.Conn.
sshConn, chans, reqs, err := ssh.NewServerConn(conn, config)
if err != nil {
- fmt.Println("Failed to handshake with new client")
+ fmt.Println("Error conectandose al nuevo cliente")
return
}
// The incoming Request channel must be serviced.
@@ -35,19 +36,19 @@ func handler(conn net.Conn, gm *GameManager, config *ssh.ServerConfig) {
// "session" and ServerShell may be used to present a simple
// terminal interface.
if newChannel.ChannelType() != "session" {
- newChannel.Reject(ssh.UnknownChannelType, "unknown channel type")
+ newChannel.Reject(ssh.UnknownChannelType, "tipo de canal desconocido")
continue
}
channel, requests, err := newChannel.Accept()
if err != nil {
- fmt.Println("could not accept channel.")
+ fmt.Println("no se pudo aceptar el canal")
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",
+ fmt.Printf("Jugador agregado. Estado actual: %d usuarios, %d juegos\n",
gm.SessionCount(), gm.GameCount())
// Reject all out of band requests accept for the unix defaults, pty-req and
@@ -90,12 +91,12 @@ func main() {
privateBytes, err := ioutil.ReadFile("id_rsa")
if err != nil {
- panic("Failed to load private key")
+ panic("No se pudo cargar la llave privada")
}
private, err := ssh.ParsePrivateKey(privateBytes)
if err != nil {
- panic("Failed to parse private key")
+ panic("No se pudo leer la llave privada")
}
config.AddHostKey(private)
@@ -104,7 +105,7 @@ func main() {
gm := NewGameManager()
fmt.Printf(
- "Listening on port %s for SSH and port %s for HTTP...\n",
+ "Escuchando en puerto %s de SSH y puerto %s de HTTP...\n",
sshPort,
httpPort,
)
@@ -117,13 +118,13 @@ func main() {
// accepted.
listener, err := net.Listen("tcp", fmt.Sprintf("0.0.0.0%s", sshPort))
if err != nil {
- panic("failed to listen for connection")
+ panic("No se pudieron escuchar conexiones")
}
for {
nConn, err := listener.Accept()
if err != nil {
- panic("failed to accept incoming connection")
+ panic("No se pudo aceptar conexion entrante")
}
go handler(nConn, gm, config)
Un proyecto texto-plano.xyz