Problems building moosql Stunt with match_object patch

0 views
Skip to first unread message

Chris Norman

unread,
Jan 3, 2016, 7:59:15 AM1/3/16
to MOO Talk
Hi all,
I'm trying to build my own copy of Stunt, firstly with the match_object
patch included.

I tried copying the changes by hand from the link Tim sent in his last
message, but that didn't work, so I went to source, and copied the
relevant lines from the match.c file in the Gamma MOO source.

Everything looks OK: There's two additional iincludes at the top
("lists.h", and "tasks.h"). There's also the additions to match_object.

Now when I try and `make` I get the following error:

g++ -g -O -Wall -c -o match.o match.cc
match.cc: In function ‘Objid match_object(Objid, const char*)’:
match.cc:125:100: error: could not convert ‘0’ from ‘int’ to ‘Var’
run_server_task(player, SYSTEM_OBJECT, "match_object",
match_object_args, name, &matched_object);
^
<builtin>: recipe for target 'match.o' failed
make: *** [match.o] Error 1

Any ideas? I've tried tinkering around with the lines above the
run_server_task line, but to no avail.

Not going to lie, my C is rusty at best.

Thanks, and a happy new year to you all.

Take care,

Chris Norman

Tim van Dijen

unread,
Jan 3, 2016, 10:04:07 AM1/3/16
to MOO-...@googlegroups.com
Change SYSTEM_OBJECT to new_obj(SYSTEM_OBJECT) and it'll work like a
charm...

Op 3-1-2016 om 13:59 schreef 'Chris Norman' via MOO Talk:

Chris Norman

unread,
Jan 3, 2016, 5:40:28 PM1/3/16
to MOO-...@googlegroups.com
Works perfectly,
Thank you very much.

By the way, is there a guide to building new commands for MOO? Or is it
just a case of reading the sources?

I don't find the code completely ununderstandable, and I'm thinking I'd
like to try my hand at making some basic builtins.

Cheers,

R Pickett

unread,
Feb 2, 2016, 5:24:35 PM2/2/16
to MOO Talk
On Sun 03.Jan.16 12:59, 'Chris Norman' via MOO Talk wrote:
>Hi all,
>I'm trying to build my own copy of Stunt, firstly with the
>match_object patch included.

This from last month just caught my eye -- what is this match_object
patch? I Googled around for such a thing but didn't come up with
anything. It caught my eye because I'm blowing the dust off my MOO and
wandering around in there, and things (exits, specifically) are not
matching the way I'd expect, and the primary difference (apart from the
passage of time in my feeble brain) is that it's running on Stunt.
Might be totally unrelated.

(I tried to look on stunt.io to see if there are links there to
interesting patches / forks / etc, but it seems to be down....)

--
R Pickett
eme...@hayseed.net
Social Justice Mage
signature.asc

Tim van Dijen

unread,
Feb 3, 2016, 12:39:08 AM2/3/16
to MOO-...@googlegroups.com
From the GammaMOO Changelog:

-- $match_object() is called to lookup dobj and iobj (one at a time). If it
returns an OBJ type, the return value is used. Otherwise, the old
internal
matching is used.
********** Before upgrading an existing LambdaCore-based MOO to use this
** NOTE ** version of the server, you should probably add at least a
dummy
********** $match_object verb (no code needed to get the old behaviour).

So what it basically does is this:
Let's say you have a verb 'connect' with args 'any to any' and you would
type 'connect plug to outlet'.
Normally, this would trigger the server to find a match for both 'plug'
and 'outlet' following a certain matching-sequence.
The patch would divert this triggers to #0:match_object, so you can
define your own matching algorithm.
So basically, it's a way of changing the server's default behaviour when
it comes to matching..

Tim

Op 2-2-2016 om 23:12 schreef R Pickett:
Reply all
Reply to author
Forward
0 new messages