简体   繁体   English

用Python编写基于浏览器的MMO服务器

[英]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. 我想为基于浏览器的MMO游戏编写服务器,该服务器使用WebSocket进行通信,使用SQL Server进行数据库,并且服务器选择的语言是Python。 What I would like to know is which libraries can provide Websocket and MMO support, and should I use Stackless or PyPy? 我想知道哪些库可以提供Websocket和MMO支持,我应该使用Stackless还是PyPy?

ws4py is a websocket library for python 2.6 and 2.7, and this is the customized django-websocket applied for rfc6455. ws4py是一个用于python 2.6和2.7的websocket库, 是应用于rfc6455的自定义django-websocket。 Websocket became RFC6455 in the end of last year, so you should use libraries applied for it. Websocket于去年年底成为RFC6455,因此您应该使用为其应用的库。 These both libraries are supporting it. 这两个库都支持它。

ps Tornado is also supporting RFC6455 from version2.2 . ps Tornado还从版本 2.2支持RFC6455。

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. 它支持最新版本的Web套接字,如果您担心性能,则可以与PyPy配合使用。 I already have a prototype MMO working with this set up and it works great. 我已经有一个MMO原型可以使用此设置,并且效果很好。 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. 因此,您可以从Web套接字开始,但是如果将游戏客户端移植到移动设备上,则可以轻松地将TCP处理程序添加到游戏中。

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. 也许SQL Server可以满足您的需求,但是如果您可以在数据库之间不存在关系的情况下使用SQL Server,则我更倾向于使用类似Membase(最近更名为Couchbase)之类的东西。 Only because it scales well and seems to be very efficient on cloud hardware. 只是因为它可以很好地扩展,并且在云硬件上似乎非常有效。

Good luck with your endeavour. 祝您一切顺利。

Take a look at Tornado . 看看龙卷风 It should contain all the stuff you need. 它应该包含您需要的所有东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 基于浏览器的MMO最佳实践 - Browser-based MMO best-practice 基于浏览器的Twitter Oauth的Python库 - Python Library for Browser-Based Twitter Oauth 是否有基于浏览器的 Websocket 侦听器实现? - Is there a browser-based Websocket listener implementation? 我在 CodeSculptor3 上制作的这个 3d 相机的旋转有什么问题,这是一个基于浏览器的 Python 解释器,带有 GUI? - What is wrong with the rotation of this 3d camera I made on CodeSculptor3, a browser-based Python interpreter with a GUI? Pythom-Selenium 基于浏览器的登录弹出窗口 - Pythom-Selenium browser-based login popup 使用POST的基于Amazon AWS S3浏览器的上传 - - Amazon AWS S3 browser-based upload using POST - 基于浏览器的应用程序或独立的GUI应用程序? - Browser-based application or stand-alone GUI app? 在 Python 中写一个基于套接字的服务器,推荐的策略? - Writing a socket-based server in Python, recommended strategies? 是否有基于浏览器的 Python IDE,例如 RStudio 服务器? - Is there a browser based IDE for Python like RStudio server for R? 用python编写简单的SMTP服务器 - Writing simple SMTP server in python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM