home · contact · privacy
Rename tick to turn in client.
[plomrogue2-experiments] / new2 / websocket_server.py
1 #!/usr/bin/env python3
2 from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
3
4 game = {'turn': 0}
5
6 class GameServer(WebSocket):
7
8     def handleMessage(self):
9         self.sendMessage('TURN: %s' % game['turn'])
10         game['turn'] += 1
11
12 server = SimpleWebSocketServer('', 8000, GameServer)
13 server.serveforever()