Giter Club home page Giter Club logo

sshtron's Introduction

SSHTron

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

Code quality disclaimer: SSHTron was built in ~20 hours at BrickHack 2. Here be dragons.

Want to choose color yourself?

There are total 7 colors to choose from: Red, Green, Yellow, Blue, Magenta, Cyan and White

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 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.

If you haven't yet patched your SSH client, you can follow these instructions to do so now.

License

SSHTron is licensed under the MIT License. See the full license text in LICENSE.

sshtron's People

Contributors

alyyousuf7 avatar fhowington avatar jaredfolkins avatar jaymoulin avatar maxwofford avatar mbjorge avatar roadmaster avatar rthbound avatar zachlatta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sshtron's Issues

Need to change base image for RPI

apicht/rpi-golang:latest cannot be used for the RPI base image because it is a pre-1.10 go version and therefore does not have math/bits extension. A base such as resin/raspberry-pi-golang:latest will work.

Nice project!

I wrote pretty much the same project about a year ago - feel free to grab some ideas from it:

https://github.com/jpillora/ssh-tron

You might see some performance benefits from sending screen deltas to each player? This reduces updates from WxH bytes to 2-8 bytes per tick

ssh does not get connected

$ ssh sshtron.zachlatta.com

returns

Unable to negotiate with 149.28.243.27 port 22: no matching host key type found. Their offer: ssh-rsa

Flickering display

There is something weird with my terminal, but this is unplayable for me as between every frame there is a completely empty screen.

I am not sure how you are rendering a new screen, but it seems like you are clearing the screen and the redrawing. If that can be rendered to a buffer which would then be pushed or render directly without clearing, I think that would help some people.

Server player count is slightly off (-1)

./sshtron
Listening on port :2022 for SSH and port :3043 for HTTP...
Player joined. Current stats: 0 users, 0 games  <-- Should be 1 user, 0 games
Player joined. Current stats: 1 users, 1 games  <-- Should be 2 users, 1 game
EOF
EOF

Rainbow Trails

feature idea: your trail is a rainbow of colors of people that you have defeated, so instead of outputting a single color as you move along, it outputs a pattern of your win streak, and then resets when you die

Disable turning on Point

It is possible to turn on point e.g. if you press a-s (while moving upwards).

Please disable turning more then one direction in one step.

Can not connect

When I run
ssh sshtron.zachlatta.com
I get an error
Unable to negotiate with 149.28.243.27 port 22: no matching host key type found. Their offer: ssh-rsa
Can you please explain what is wrong?

Still working?

Hitting the server is just causing my terminal to hang. Seems to enter into an ssh session but then nothing after that.

Tried on

  • OSX 10.10.5 with zsh
  • Ubuntu 14.04 with bash

Other people seem to be having problems too.

Client settings

The manual should note the needed client settings to get the correct experience (for example, a plain ANSI terminal emulation will not suffice).

EU server?

170 ms make it a bit hard to play..
A EU server could be nice.

Wish: Provide `systemd` service file for people to use.

Right now when sshtron is run by systemd, the colors don't work. See:

http://unix.stackexchange.com/questions/352937/ansi-colors-when-using-systemd-service

From what I can tell, sshtron uses a color library, which in turn uses library to check is there's a terminal connected to decide whether to use colors or not, which boils down to this line:

https://github.com/mattn/go-isatty/blob/master/isatty_linux.go#L14

The logic using TTY detection to decide if a server should output color seems flawed if that's what' going on. The server might be not connected to a TTY even if the clients are.

systemd does have some options to connect a service to a TTY documented in man systemd.exec, but usually services aren't connected to TTYs, their clients are.

In any event, providing a working systemd .service file would be of interest to people who want to manage sshtron as a standard system service.

Segfault on build

Get a segfault on get, doesn't seem to leave a log anywhere.
Any ideas?
If you need anything more please let me know, sorry I can't give you more off the bat.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.