Considering using python for something, and need a bit of info :)

Nolan Darilek nolan_d at bigfoot.com
Mon Jan 3 12:46:45 EST 2000


>>>>> "PartyG2816" == PartyG2816  <PartyG2816 at aol.com> writes:

    PartyG2816> Allo list, I'm involved in writing a MUD server from
    PartyG2816> scratch with a small group of other people.  For you
    PartyG2816> who do no know, a MUD is a multi-user text game.  I've
. . . 
    PartyG2816> Could the Python interpreter be embedded and used in a
    PartyG2816> way that would allow me to use it like this within my
    PartyG2816> application?

I suppose it could be embedded, yes. A more practical approach would
  probably be to write your server in either Python or JPython
  completely. I was using such an approach until I discovered Muq
  (http://muq.org/~cynbe/muq/), and now I'm trying to switch to that
  as my platform, and write a Python-to-Muq assembly compiler. Granted,
  you don't have the freedom which a full Python-based product would
  allow, but if I ever finish this, the language will be extremely
  similar to Python, minus some of the built-in modules like sys which
  aren't useful in a MUD environment.

    PartyG2816> Another concern of mine is: how secure can it be? IE
    PartyG2816> can i restrict certain aspects of it based upon a
    PartyG2816> condition? Say I have a a normal builder, ie someone
    PartyG2816> who simply makes areas and may perform a few scripts
    PartyG2816> for them, I wouldn't want to let him do certain
    PartyG2816> things... Whereas me as head programmer, I would have
    PartyG2816> access to many more options within my scripts :) Or
    PartyG2816> take a normal "player".  I'm going to be allowing
    PartyG2816> small scripts and macros and such for my players to
    PartyG2816> automate a few 'boring' things, I would want to give
    PartyG2816> them access to a limited set of use, and not let them
    PartyG2816> say re-arrange everything in the room. *chuckles* Ah
    PartyG2816> well, maybe you peoples understand what I'm asking and
    PartyG2816> can help, I'd appreciate any response :) If you have

This seems more like an application issue rather than a Python one. If
you make the items property in a room hidden, you can probably detur
many casual crackers from touching it. However, it would still be
possible to modify the hidden/private variable, see section 9.6? in
the tutorial. It may be possible to code Property objects which store
MUD information, and have some sort of security mechanism on them to
determine who can modify them, and preventing folks from simply typing
commands directly into a Python prompt. Then there's the issue of
preventing people from doing:

import sys
sys.exit()

and bringing down your game. :)

I originally started by writing my own server in Python, but I then
realized that I didn't know enough about security to patch every
single (or even most) point of attack. I think that Muq will really
shine here. I'm not saying that successful servers can't be written;
see below for a list of examples.

    PartyG2816> p.s. - If it turns out that yall think Python could be
    PartyG2816> suitable for osmething like this, could you include a
    PartyG2816> few linkst o places that discuss and give some working
    PartyG2816> examples of embedding python in another application
    PartyG2816> and running scripts through it using whatever API is
    PartyG2816> inherent in Python for that use? :)

Sure. There's POO, a Python implementation of MOO at
http://www.strout.net/python/intro.html. POO is actually listed there,
but there are some other cool programs you may find useful.

Then there's Momoko (http://uts.cc.utexas.edu/~blanu/mud/) which uses
JPython instead of plain Python, thus allowing you to script in both
Java and Python.

There is a Python patch for TinyMUSH 3.0B5 which lets you write code
on MUSH objects in Python. See
http://www.helsinki.fi/~mstenber/tm30b5pv001.diff for this.

Moebius (http://www.bofh.net.au/mud/) is another project which I
stumbled on recently. It stores object code and such in an SQL
database, and seems interesting. It also supports server distribution,
allowing multiple servers to access the same MySQL database.

Varium (http://www.varium.com) is a project to develop a distributed
MUD server in Python. I haven't looked much at this one.

If you're more interested in embedding/extending, and not in
Python-based MUD servers, check out SWIG (http://www.swig.org). It
reads SWIG interface files or even C/C++ headers, and generates
wrappers in Perl, Python, TCL, Java, and a few other languages. I've
had lots of success using this with other projects.

And I should probably shamelessly plug my own project along with all
the others. :) Ethereal (http://etherealmud.sourceforge.net) is an
attempt to develop a MUD platform with a long list of what I feel are
fairly interesting ideas. The MUD concept of this project is fairly
solid and currently (albeit slowly :) being written down in a design
document, while the server-side aspects are still being
decided. Lately I've been considering using Muq because many of its
concepts seem to mesh with mine, but I've gone from writing my own
server to planning to use Momoko to wanting to use Muq, so who knows
what I'll be doing next month. :)




More information about the Python-list mailing list