Code Monkey home page Code Monkey logo

akkaships-exercise's Introduction

Akkaships

Battleship game implemented in Akka. Training project for Codemotion 2015

Slides from the workshop are available at Slideshare

Requirements

Apache Cassandra

To start cassandra:

> $CASSANDRA_HOME/bin/cassandra -f 

To start CQL Shell:

> $CASSANDRA_HOME/bin/cqlsh

Requirement metadata:

CREATE KEYSPACE IF NOT EXISTS akkaships WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1}
CREATE TABLE IF NOT EXISTS akkaships.users (user text, PRIMARY KEY((user)))
CREATE TABLE IF NOT EXISTS akkaships.statistics (user text, ts timeuuid, hit boolean, sunk boolean, PRIMARY KEY((ts),user,hit,sunk))

Execute Game mode localhost

First it is necessary to compile:

mvn clean install

Now it's time to execute the server

mvn exec:java -pl Server -Dexec.mainClass="es.codemotion.akkaships.server.ServerApp"

Once server is started it is possible to start the Player

mvn exec:java -pl Client -Dexec.mainClass="es.codemotion.akkaships.client.PlayerApp"

Configuration for a distributed environment

Player Configuration is in the file $AKKASHIPS_HOME/Client/src/main/resources/player-reference.conf and there it's necessary to change ...

player.akka.remote.netty.tcp.hostname = "[Your IP]"
player.akka.cluster.seed-nodes = ["akka.tcp://ShipsServerCluster@[ServerIP]:61000"]

Server Configuration is in the file $AKKASHIPS_HOME/Server/src/main/resources/server-reference.conf and there it's necessary to change ...

akkaships-server.akka.remote.netty.tcp.hostname = "[ServerIP]"
akkaships-server.akka.cluster.seed-nodes = ["akka.tcp://ShipsServerCluster@[ServerIP]:61000"]

Now it's time to recompile and follow the steps of the previous steps

akkaships-exercise's People

Contributors

mafernandez-stratio avatar

Stargazers

Juan Miguel Boyero Corral avatar  avatar David Vallejo avatar Javier Casal Ruiz avatar

Watchers

James Cloos avatar Miguel Ángel Moreno avatar  avatar Juan Jose Lopez Martin avatar

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.