Next: 16.5 Hunting down code
Up: Development and Porting Hints
Previous: 16.3 Using the E_WEB
The basics for porting are explained in the
Newbie MOO Wiz FAQ and most information is taken
from there.
There are a few formal and informal rules you should respect:
- In principle everything published or available over the Internet
is copyrighted (e.g. web pages, MOO code, Java applets). If an object's
description doesn't explicitly grant permission to port, ASK !
- If the code you wish to port has been programmed by a member
of the MOO from which you want to port send him Moo-mail. To list the
owner, type for example
@d <object>
. It the owner is not
a real player (e.g. hacker or core-wizard) ask a wizard for permission
(type @help wizard-list
to list wizards).
- If the code seems to have been ported over from another MOO,
ask the person who ported it or
look at the code to determine where it comes from or if it is ok
to port.
- Make sure that your client doesn't wrap lines (
@wrap off
)
- Try to figure out exactly what to port and how much work it might
involve, then dump the objects you need.
- First glance at the parents of the object you want to port:
Type:
@parents <object>
. If the parents don't exist on your
MOO you have to port them too. Reconsider porting or start porting
the parents first.
- Check if the parents needed are the same. Often parents that
have the same name are slightly different. In this case, either fix
the parent (or ask a wizards help if you are not allowed to). A quick
way to compare the parents is to compare the number of slots and verbs.
(See section 16.2.2). Also note that some extra
slots inherited from very high level objects (e.g. #1 alias
$root_class
may not be needed on your moo).
- Finally, try to find out if the object you want to port needs
other objects (not parents) to work with. E.g. a ``video camera'' might
need a ``recorder'' and a ``tape'' in order to be really useful.
If you can't figure it out by reading the help or the description,
dump the object as below. In any case, plan to port those objects too
and even some parents of those.
- Apply the instructions below iteratively for each object you
want to port. Starting porting the parents first (if needed) and then
port the more important objects first.
- Next, create an object with the right parent on your own MOO
using the
@create
command.
E.g. if you want to port a fancy room with parent $room (#3) type:
@create $room named ``Mike's Fancy Noisy Room''
or something
like that. Write down the number, you will need it in the next step.
- Next, dump the object on the MOO from which you port:
- Type:
@dump #obj with create id=#new-obj
-
#obj
is the object you want to dump and #new-obj
is the empty
new object number you just created before.
- Now save the code (if you can) on your local machine.
- Edit the code (dump) you recorded (good luck with a bad MOO client!):
- Remove the create from the first line of the dump since you
already created the object
- Now scan the code for references to other objects (see above).
Replace all the hard-coded numbers
#...
by correct ones on your MOO.
The same applies for MOO using ``local cores'', e.g. the ``&
''
objects on TECFAMOO.
- Scan the dump for junk that is unwanted, e.g. inserted page or
shout messages, truncated lines etc etc. and fix those.
- Important: Fix things that won't work on your MOO. Consult your
local documentation!
E.g. on TECFAMOO we use (a non-LambdaCore compatible) multi-ownership scheme.
Please have a look at chapter 12 for details on what
is really different at TECFAMOO.
- If you feel that most of the code is more or less acceptable
go to the next step.
- Uploading code to your MOO:
- First of all you need to decide whether uploading the whole
code or doing it piece by piece. I prefer doing it as a whole first and
then fix things that didn't go well.
- Consult the documentation of your MOO client on how to upload.
Uploading basically means dumping text into the moo.
With the rmoo/emacs clients, you just copy the code you want to upload and then
you type ctrl-c ctrl-y or under X-Windows you can also select the code
and then use ``Send X-Selection'' from the menu. Some clients also
may have an ``upload file'' button or command (E.g. on Tinyfugue read
/help upload
. In the worst case you may try to
connect to the MOO via a simple telnet and somewhat paste your code into
it.
- Now careful ! DON'T UPLOAD TWICE verb definitions, or you will
have 2 definitions of the same verb! (guess that applies to most MOOs).
To avoid defining verbs twice while uploading the same code several times
comment out all those lines after your first uploading: e.g.
change
@verb #xxxx:"a_verb'' this none this
to
"@verb #xxxx:"a_verb'' this none this
, i.e. add a " in front
of the line.
A word of warning: Some objects (e.g. small social features or
some kind of pets) can
be ported quite easily, others do need good understanding of MOO
programming. Still others need at least some wizard permission,
though many objects that run under wizard permissions actually
would run without if programmed in the right way.
Next: 16.5 Hunting down code
Up: Development and Porting Hints
Previous: 16.3 Using the E_WEB
Daniel K. Schneider
Thu Apr 17 12:43:52 MET DST 1997