A multi player, server based snake game for computer bots as players
Clients connect via a websocket through which events and commands are sent bidirectionally. Several client implementations exist:
To clean and build:
> ./gradlew clean build
To run server locally:
> ./gradlew bootRun
To run server locally with increased memory:
> export JAVA_OPTS="-Xmx4096m" && ./gradlew bootRun
To run packaged server with overridden setting for game link:
> ./gradlew clean bootRepackage
> java -Xmx4096m -Dsnakebot.view.url=http://<your-ip>:8090/#/viewgame/ -jar app/build/libs/snakebot-app-0.1.18.jar
To generate Spring Boot self contained artifact:
> ./gradlew clean bootRepackage
If you change the client code/api and want to test locally, you need to publish your new snapshot locally before the code in the snake clients project can see your changes:
> ./gradlew publishToMavenLocal
Start ElasticSearch:
> docker run -d -p 9200:9200 -p 9300:9300 -v ~/tmp/es-config:/usr/share/elasticsearch/config -v ~/tmp/es-data:/usr/share/elasticsearch/data --name=es elasticsearch:2.4 -Des.network.host=0.0.0.0
Start Kibana:
> docker run --name kibana --link es:elasticsearch -p 5601:5601 kibana
Update local host file:
> sudo echo "127.0.0.1 elasticsearch" >> /etc/hosts
Start the application from your IDE with production profile:
-Dspring.profiles.active=production
Create the Elasticsearch indexes by following these instructions