Using Asyncore/chat for game server question.

Jos hyakugei at gmail.com
Thu Sep 29 21:19:03 CEST 2005


Hello all.

I have a working server, using the asyncore/chat module, which enables
logging in, rooms and private messaging.

I've used this framework to make some simple games that only required
message broadcasting via the server.

I'd now like to move the game logic into the server.

My recent reading includes the article "Multithreaded Game Scripting
with Stackless Python"

http://harkal.sylphis3d.com/2005/08/10/multithreaded-game-scripting-with-stackless-python/

I'm not so interested in moving to Stackless, although i've also been
looking at Nanothreads offered in the "Lightweight Game Toolkit" as a
way to implement the above ideas in plain python.

http://lgt.berlios.de/#nanothreads

However, that's a bit off from my Question. So here is is:

How do i enable the/a game object, running on the server, to send
messages "on its own". I understand that the asyncore module is based
on the "Reactor" design, which is, duh, reactive rather then active...
So how do i make my server "active" ;).

A simple example would be a server based on asyncore, with multiple
connections, which broadcasts a "pulse" to the connected clients every
second.

Thanks for any help, pointers, words of advice, etc etc!

Jos




More information about the Python-list mailing list