当前位置: 动力学知识库 > 问答 > 编程问答 >

Writing browser-based MMO server in Python

问题描述:

I want to write a server for a browser-based MMO game, which uses WebSocket for communication, SQL Server for database, and the language of choice for server is Python. What I would like to know is which libraries can provide Websocket and MMO support, and should I use Stackless or PyPy?

网友答案:

ws4py is a websocket library for python 2.6 and 2.7, and this is the customized django-websocket applied for rfc6455. Websocket became RFC6455 in the end of last year, so you should use libraries applied for it. These both libraries are supporting it.

ps Tornado is also supporting RFC6455 from version2.2.

网友答案:

Take a look at Tornado. It should contain all the stuff you need.

网友答案:

Tornado is definitely a good choice for what you are doing. It supports web sockets with the latest version and it works fine with PyPy if you are concerned about performance. I already have a prototype MMO working with this set up and it works great. Also you can add new connection types later. So you could start with web sockets, but if you ported the game client to a mobile device you can add a TCP handler into the game with minimal effort.

On the database side, I would consider looking around at other options. Maybe SQL Server is perfect for your needs, but I am more inclined to use something like Membase (renamed Couchbase recently) if you can do without the database being relational. Only because it scales well and seems to be very efficient on cloud hardware.

Good luck with your endeavour.

分享给朋友:
您可能感兴趣的文章:
随机阅读: