Tictactoe web game - Demo for Akka and Xitrum
See slides: Develop realtime web with Scala and Xitrum
Requirement: Java 7+
To generate Eclipse project:
target/xitrum will be created:
target/xitrum/ config/ akka.conf xitrum.conf lib/ <jar files> script start start.bat
You can run a cluster of Tictactoe servers. See "Single node" and "Clustering" in Lobby.scala and Player.scala. Use akka.conf to config the cluster.
How this program works
- Player actors connect to a lobby actor.
- When there are enough 2 players, the lobby actor let the player actors know about each other.
- The players then send messages directly to one another.
browser1 --- [SockJs] --- player actor1 | lobby actor | browser2 --- [SockJs] --- player actor2
browser1 --- [SockJs] --- player actor1 | | | browser2 --- [SockJs] --- player actor2
- Instead of letting player actors send messages directly to each other, use an intermediate game actor for each game.
- Let users other than the players watch games.
- Use Akka FSM instead of