-
Notifications
You must be signed in to change notification settings - Fork 0
/
mudpy-server.py
45 lines (32 loc) · 988 Bytes
/
mudpy-server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from tornado.ioloop import IOLoop
from tornado.web import Application, RequestHandler, StaticFileHandler
from tornado.websocket import WebSocketHandler
class CharacterHandler(RequestHandler):
def get(self, *args, **kwargs):
# @TODO get character
pass
def post(self, *args, **kwargs):
# @TODO update character
pass
def put(self, *args, **kwargs):
# @TODO create character
pass
def delete(self, *args, **kwargs):
# @TODO delete character
pass
class RaceHandler(RequestHandler):
pass
class GameHandler(WebSocketHandler):
def on_open(self):
pass
def on_message(self, message):
self.write_message(message)
def main():
app = Application([
(r'/character/', CharacterHandler),
(r'/game/', GameHandler)
], static_path="/Users/chris/src/mudpy/static/", debug=True)
app.listen(8000)
IOLoop.instance().start()
if __name__ == '__main__':
main()