I'm building a little MMORPG and im trying to use asyncore rather then threading.
1) How would i send data to certain clients, because in threading a saved each clients socket and current in a dictionary a with its unique id as a key. So how could i subjective send data to all the clients.
Thankyo开发者_StackOverflow中文版u, please say if i didnt give enough information
I find it great that you want to move to asynchronous programming instead of threading, since it is so much reliable and easier to debug.
However, asyncore
is a bad library to do so. I don't advise you use it at all, since it requires a significant rewrite to do simple things like read standard io.
I suggest you move to twisted - it is a great asynchronous framework, well tested and developed, with good api documentation and good community support.
Regardless of your decision on which library to use, I find this series of blog posts by Dave Peticolas to be a great source of beginner information on asynchronous programming. Please read it.
There are some games under development using twisted. One example is Minions of Mirth - I never played it but it seems cool.
There's also divmod's imaginary - it's a simulationist's take on the realm of role playing, interactive fiction, and multiplayer dungeons. It incorporates gameplay features from each area while attempting to provide a richer environment than is generally available from existing systems.
Hope I helped.
精彩评论