I am trying to implement sockets using the client library of socket.io and the server implementation for Python, gevent-socketio. I got the server to run and the sockets to work. However, I am trying to implement some simple in-browser game (that I didn't write!) and the game happens completely within one instance of the game class. It works something like this:
game = Game([player1,player2])
game.turn(player1, action_one)
game.turn(player2, action_two)
...
print game.winner()
Since I want to use sockets for the turns, I need some way to share the game object on the server side between the different sockets (players). How could I do this? I really would not like to store each state of the game on the disk or in some database. Is there any other option?
It seems like Pyro is exactly what I need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With