views:

84

answers:

1

hi,

ive recently create a short and simple multi user dungeon, the things ive made is the engine of the game and the actually mud itself so when i click on the file it you can play the mud. the problem ive got is i dont know how to connect it so that more than one player can play. do you connect it to a server or something. i dont know what to do as i am new the python Mud so can some help me out by giving some examples to help me out with code and how to connect and get this game up and running.

thanks

+1  A: 

Your MUD should be the server.

First, you want to make sure that your engine can handle multiple people changing the dungeon state at the same time.

Next, take a look at how to create a server. You probably want to look at the SocketServer class, for MUDs you probably want one of the TCP subclasses.

Each user will open a connection to your server. Normally, each connection will be handled by either a process or a thread (check out the ThreadingMixin). Inside that thread will be the user interface code for a connection (read a line from the user, pass that onto the engine, print out results to the user).

Your engine will probably run in a separate thread / process and maintain the dungeon state (list of rooms, users, items).

Good luck!

Daren Thomas