home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
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()