0

I've recently created a short and simple Multi-User Dungeon. The things I've made are the engine of the game and the actual MUD itself, so when i click on the file it you can play the MUD. The problem I have is, I don't know how to connect it so that more than one player can play. Do you connect it to a server or something? I don't know what to do as I am new to Python and MUDs. 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?

chaos
  • 122,029
  • 33
  • 303
  • 309
jason
  • 19
  • 2
    Isn't this the same as these two earlier closed threads? http://stackoverflow.com/questions/2621465/muti-user-dungeon-help-closed http://stackoverflow.com/questions/2623657/mud-server-in-python-closed – wasatz Apr 16 '10 at 09:26
  • I wish you good luck, it shouldn't be all that dificult especially since you can just google and find some examples. If you have a more specific question we'll be glad to help. – extraneon Apr 16 '10 at 09:29
  • wasatz i understand what you saying they are quite similar but i didnt write them lol – jason Apr 16 '10 at 09:32
  • When is your homework due in? Just asking so I can find out when you're going to stop polluting Stack Overflow with all these questions. – Vicky Apr 16 '10 at 09:34
  • @jason Ah, sorry then, just felt so close :) – wasatz Apr 16 '10 at 09:34
  • vicky "polluting" if people require some help on certain subjects then i wouldnt call it polluting and how am i polluting ive just asked one question damn god knows what you would do with pollution in the world – jason Apr 16 '10 at 09:38
  • 1
    @jason If you are not the same person, your English style (if we can call it that) is quite remarkably similar to his. –  Apr 16 '10 at 09:54
  • neil ive read "mudman" questions i dont think nothings similar apart from his or her questions is similar to mine why is everyone comparing me some other person what have i done wrong just asked a question dont you get two people asking the same question on the website so do you make to be twins or something this is really insulting im looking for help here and im gettign vitctimised of being compared to be someone else i thought this is a place were people can get help but who knew clumbo was carrying out his investigation here decide on whos who and whos not – jason Apr 16 '10 at 10:03

2 Answers2

1

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
  • 67,947
  • 40
  • 154
  • 200
0

The usual thing is that your MUD server code handles the socket connections and connects them to internal player objects through a command parser. You might want to look at SocketMUD; it's a bare-bones socket handling architecture intended for MUD use, and may be just what you need.

chaos
  • 122,029
  • 33
  • 303
  • 309