From fadb734aa0cdfce93a9ebc4aa8bfb632cdea89ed Mon Sep 17 00:00:00 2001 From: dgy Date: Tue, 2 Feb 2021 12:03:03 -0300 Subject: Traduccion de archivos del juego --- README.md | 69 -------------------------------------------------- README.txt | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ game.go | 21 ++++++++------- main.go | 21 +++++++-------- static/index.html | 35 +++++-------------------- 5 files changed, 104 insertions(+), 118 deletions(-) delete mode 100644 README.md create mode 100644 README.txt diff --git a/README.md b/README.md deleted file mode 100644 index 39b0fff..0000000 --- a/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# ![SSHTron](https://cdn.rawgit.com/zachlatta/sshtron/master/logo.svg) - -SSHTron is a multiplayer lightcycle game that runs through SSH. Just run the command below and you'll be playing in seconds: - - $ ssh sshtron.zachlatta.com - -_Controls: WASD or vim keybindings to move (**do not use your arrow keys**). Escape or Ctrl+C to exit._ - -![Demo](static/img/gameplay.gif) - -**Code quality disclaimer:** _SSHTron was built in ~20 hours at [BrickHack 2](https://brickhack.io/). Here be dragons._ - -## Want to choose color yourself? - -There are total 7 colors to choose from: Red, Green, Yellow, Blue, Magenta, Cyan and White - - $ ssh red@sshtron.zachlatta.com - -If the color you picked is already taken in all open games, you'll randomly be assigned a color. - -## Running Your Own Copy - -Clone the project and `cd` into its directory. These instructions assume that you have your `GOPATH` setup correctly. - -```sh -# Create an RSA public/private keypair in the current directory for the server -# to use. Don't give it a passphrase. -$ ssh-keygen -t rsa -f id_rsa - -# Download dependencies and compile the project -$ go get && go build - -# Run it! You can set PORT to customize the HTTP port it serves on and SSH_PORT -# to customize the SSH port it serves on. -$ ./sshtron -``` - -## Running under a Docker container - -Clone the project and `cd` into its directory. - -```sh -# Build the SSHTron Docker image -$ docker build -t sshtron . - -# Spin up the container with always-restart policy -$ docker run -t -d -p 2022:2022 --restart always --name sshtron sshtron -``` - -For Raspberry Pi, use the following to build the Docker image: - -```sh -$ docker build -t sshtron --build-arg BASE_IMAGE=resin/raspberry-pi-golang:latest . -``` - -## CVE-2016-0777 - -[CVE-2016-0777](https://www.qualys.com/2016/01/14/cve-2016-0777-cve-2016-0778/openssh-cve-2016-0777-cve-2016-0778.txt) -revealed two SSH client vulnerabilities that can be exploited by a malicious SSH server. While SSHTron does not exploit -these vulnerabilities, you should still patch your client before you play. SSHTron is open source, but the server -could always be running a modified version of SSHTron that does exploit the vulnerabilities described -in [CVE-2016-0777](https://www.qualys.com/2016/01/14/cve-2016-0777-cve-2016-0778/openssh-cve-2016-0777-cve-2016-0778.txt). - -If you haven't yet patched your SSH client, you can follow -[these instructions](https://www.jacobtomlinson.co.uk/quick%20tip/2016/01/15/fixing-ssh-vulnerability-CVE-2016-0777/) to do so now. - -## License - -SSHTron is licensed under the MIT License. See the full license text in [`LICENSE`](LICENSE). diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..c903767 --- /dev/null +++ b/README.txt @@ -0,0 +1,76 @@ +SSHTron is a multiplayer lightcycle game that runs through SSH. Just run the command below and you'll be playing in seconds: + + $ ssh sshtron.zachlatta.com + +Controls: WASD or vim keybindings to move (**do not use your arrow keys**). Escape or Ctrl+C to exit. + + +Code quality disclaimer: SSHTron was built in ~20 hours at BrickHack 2: https://brickhack.io/. Here be dragons. + + + +Want to choose color yourself? +------------------------------ + +There are total 7 colors to choose from: Red, Green, Yellow, Blue, Magenta, Cyan and White + + $ ssh red@sshtron.zachlatta.com + +If the color you picked is already taken in all open games, you'll randomly be assigned a color. + + + +Running Your Own Copy +--------------------- + +Clone the project and `cd` into its directory. These instructions assume that you have your `GOPATH` setup correctly. + +# Create an RSA public/private keypair in the current directory for the server +# to use. Don't give it a passphrase. +$ ssh-keygen -t rsa -f id_rsa + +# Download dependencies and compile the project +$ go get && go build + +# Run it! You can set PORT to customize the HTTP port it serves on and SSH_PORT +# to customize the SSH port it serves on. +$ ./sshtron + + + +Running under a Docker container +-------------------------------- + +Clone the project and `cd` into its directory. + +# Build the SSHTron Docker image +$ docker build -t sshtron . + +# Spin up the container with always-restart policy +$ docker run -t -d -p 2022:2022 --restart always --name sshtron sshtron + + +For Raspberry Pi, use the following to build the Docker image: + +$ docker build -t sshtron --build-arg BASE_IMAGE=resin/raspberry-pi-golang:latest . + + + +CVE-2016-0777 +------------- + +CVE-2016-0777: https://www.qualys.com/2016/01/14/cve-2016-0777-cve-2016-0778/openssh-cve-2016-0777-cve-2016-0778.txt +revealed two SSH client vulnerabilities that can be exploited by a malicious SSH server. While SSHTron does not exploit +these vulnerabilities, you should still patch your client before you play. SSHTron is open source, but the server +could always be running a modified version of SSHTron that does exploit the vulnerabilities described +in CVE-2016-0777 https://www.qualys.com/2016/01/14/cve-2016-0777-cve-2016-0778/openssh-cve-2016-0777-cve-2016-0778.txt + +If you haven't yet patched your SSH client, you can follow these instructions +https://www.jacobtomlinson.co.uk/quick%20tip/2016/01/15/fixing-ssh-vulnerability-CVE-2016-0777/ to do so now. + + + +License +------- + +SSHTron is licensed under the MIT License. See the full license text in LICENSE diff --git a/game.go b/game.go index 7577475..869e836 100644 --- a/game.go +++ b/game.go @@ -10,7 +10,6 @@ import ( "strings" "time" - "github.com/dustinkirkland/golang-petname" "github.com/fatih/color" "golang.org/x/crypto/ssh" ) @@ -45,7 +44,7 @@ func (h *Hub) Run(g *Game) { h.Sessions[s] = struct{}{} case s := <-h.Unregister: if _, ok := h.Sessions[s]; ok { - fmt.Fprint(s, "\r\n\r\n~ End of Line ~ \r\n\r\nRemember to use WASD to move!\r\n\r\n") + fmt.Fprint(s, "\r\n\r\n~ Fin de línea ~ \r\n\r\nRecuerda que con WASD te mueves!\r\n\r\n") // Unhide the cursor fmt.Fprint(s, "\033[?25h") @@ -124,13 +123,13 @@ var playerBorderColors = map[color.Attribute]color.Attribute{ } var playerColorNames = map[color.Attribute]string{ - playerRed: "Red", - playerGreen: "Green", - playerYellow: "Yellow", - playerBlue: "Blue", + playerRed: "Rojo", + playerGreen: "Verde", + playerYellow: "Amarillo", + playerBlue: "Azul", playerMagenta: "Magenta", playerCyan: "Cyan", - playerWhite: "White", + playerWhite: "Blanco", } type PlayerTrailSegment struct { @@ -474,7 +473,7 @@ func (g *Game) initalizeLevel(width, height int) { } func (g *Game) setTileType(pos Position, tileType TileType) error { - outOfBoundsErr := "The given %s value (%s) is out of bounds" + outOfBoundsErr := "El valor %s de (%s) está fuera de límite" if pos.RoundX() > len(g.level) || pos.RoundX() < 0 { return fmt.Errorf(outOfBoundsErr, "X", pos.X) } else if pos.RoundY() > len(g.level[pos.RoundX()]) || pos.RoundY() < 0 { @@ -540,7 +539,7 @@ func (g *Game) worldString(s *Session) string { // Draw the player's score scoreStr := fmt.Sprintf( - " Score: %d : Your High Score: %d : Game High Score: %d ", + " Puntaje: %d : Tu mejor puntaje: %d : Mejor puntaje del juego: %d ", s.Player.Score(), s.HighScore, g.HighScore, @@ -590,7 +589,7 @@ func (g *Game) worldString(s *Session) string { strWorld[startX][len(strWorld[0])-1] = " " } else { warning := - " Warning: Other Players Must be in This Game for You to Score! " + " Advertencia: Debe haber otros jugadores en el juego para poder sumar puntos " for i, r := range warning { strWorld[3+i][len(strWorld[0])-1] = borderColorizer(string(r)) } @@ -744,7 +743,7 @@ func (g *Game) Update(delta float64) { // Kick the player if they've timed out if time.Now().Sub(session.LastAction) > playerTimeout { - fmt.Fprint(session, "\r\n\r\nYou were terminated due to inactivity\r\n") + fmt.Fprint(session, "\r\n\r\nSesión finalizada por inactividad\r\n") g.RemoveSession(session) return } 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) diff --git a/static/index.html b/static/index.html index e17ffde..7f0f1ee 100644 --- a/static/index.html +++ b/static/index.html @@ -1,7 +1,7 @@ - SSHTron - Tron in Your Terminal + SSHTron - Tron en tu Terminal + content="SSHTron es un juego de Tron multijugador a través de SSH en tu terminal."> @@ -25,36 +25,15 @@

SSH Tron

- Multiplayer Tron in your terminal. Just run the command below and you'll - be playing in seconds. + Tron multijugador en tu terminal. Usa el comando descripto más abajo y podrás jugar.

$ ssh sshtron.zachlatta.com

-

(WASD or vim keybindings for movement, do not use arrow keys)

+

(WASD or teclas de vim para moverse, no uses las flechas!)

- By @MaxWofford and - @zachlatta. Check out - Hack Club, our new nonprofit. + Por @MaxWofford y + @zachlatta. Visita + Hack Club, nuestra nueva organización sin fines de lucro.

- - - -
- - - - -- cgit v1.2.3