1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: clients anyone?... -->
<!--X-From-R13: "Oqnz X. Fubeagba" <nqnzNcubravk.Bevaprgba.SRG> -->
<!--X-Date: Wed, 12 Aug 1998 11:37:16 &#45;0700 -->
<!--X-Message-Id: 19980812143559.B20788#flagstaff,Princeton.EDU -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 19980811150534.F26005#flagstaff,Princeton.EDU -->
<!--X-Reference: Pine.SGI.3.95.980811234105.26545E&#45;100000#genome,cbs.dtu.dk -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: clients anyone?...</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:adam#phoenix,Princeton.EDU">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00691.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00693.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00690.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00697.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00692">Author</A>
&nbsp;|&nbsp;<A HREF="#00692">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00692">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: clients anyone?...</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Re: clients anyone?...</LI>
<LI><em>From</em>: "Adam J. Thornton" &lt;<A HREF="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</A>&gt;</LI>
<LI><em>Date</em>: Wed, 12 Aug 1998 14:35:59 -0400</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Tue, Aug 11, 1998 at 11:50:09PM +0200, Hans-Henrik Staerfeldt wrote:
&gt; If you want complex scripting, it would be a good idea to extend the
&gt; protocol to handle pre-processed data. In reality, your in-game model
&gt; of the world is translated into nasty ambigous text for reading of humans,
&gt; or even worse - graphics. Unless you want to do some very nasty AI attempt
&gt; at understaning the messages (graphics!) intended for the player you 
&gt; should extend your good flexible protocol with an AI stream mode that 
&gt; allows for nicely formatted events to be parsed to the remote NPC.
&gt; Player&gt; Buffy pick up the hammer.
&gt; AI&gt; Pickup((Player 52364),(Object 23647)).

Ah, but what happens here (and with any action that changes the game state
in a way visible outside a player object) is that the new room state is
propagated to all the players in the room/all the players in the line of
sight (depending on how fancy I get).  So, Buffy picks up the hammer
(whether by typing GET HAMMER, or clicking on the hammer picture while
standing within a certain radius of its location, assuming buffy has
sufficient carrying capacity left, etc., etc.).

All the players within view (including the AI "player") get something along
the lines of UPDATE:PARENT(HAMMER)=BUFFY.

So the AI gets the changes to the world state more or less automatically.
On the other hand, let's assume the AI is named Buffy, and what we want is
"Buffy, pick up the hammer"; then we can use a system kind of like Inform's
creature library to decide if a) Buffy takes orders in the first place, and
if so, then we can parse the text input; "PICK UP" is a verb equivalent to
"TAKE" and "GET" and so on, and then we see whether "HAMMER" is anything in
scope.  And if so, then Buffy a) moves to it, and b) tries to pick it up.
But I think we want to put the parser in the Buffy client, not in the
server.

An unrelated problem, but a very annoying one.  I'm new to Linux threads
programming.  I'm using RH5.1.  When I call pthread_create() I get the new
thread, but also a SIGUSR1.  If I don't SIG_IGN it, the program exits (this
is default behavior for SIGUSR1).  But if I *do* ignore it, then the
process never returns from the thread creation.  Did I miss something
really obvious here?

What's going on?  My guess is that the newly created thread is calling back
the main thread with a SIGUSR1 to tell it to go on with its life.  But
whatever the signal handler is that was supposed to be installed so it
could do that wasn't.

Interestingly, the tcpserv02g in Stevens _Unix Network Programming_ ch. 23
does the exact same thing (in the threads subdir of the tgz from the book).
So it's not just me.  I'm trying to do something very similar, by the way:
I block on accept() (well, really an error-checking wrapper to accept(),
but same difference), and then I create a new thread to deal with the fd I
get from it after someone connects, and, if the program actually resumed
after spitting out the thread, it would head back to the top of the loop
the accept() is in and block there again, but it never gets to the
statement beyond the pthread_create.

Any Linux thread gurus out there who can tell me what's going on here?
Also, are there any free thread-aware debuggers under Linux?  Gdb doesn't
seem to be thread-aware.

Adam
-- 
adam#princeton,edu 
"There's a border to somewhere waiting, and a tank full of time." - J. Steinman


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00663" HREF="msg00663.html">[MUD-Dev] Re: clients anyone?...</A></STRONG>
<UL><LI><EM>From:</EM> "Adam J. Thornton" &lt;adam#phoenix,Princeton.EDU&gt;</LI></UL></LI>
<LI><STRONG><A NAME="00690" HREF="msg00690.html">[MUD-Dev] Re: clients anyone?...</A></STRONG>
<UL><LI><EM>From:</EM> Hans-Henrik Staerfeldt &lt;hhs#cbs,dtu.dk&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00691.html">[MUD-Dev] Re: Methods to Reduce Ecological Wipeout</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00693.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00690.html">[MUD-Dev] Re: clients anyone?...</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00697.html">[MUD-Dev] Re: LinuxThreads and SIGUSR1 (Ref: [MUD-Dev])</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00692"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00692"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>[MUD-Dev] Re: clients anyone?...</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00663" HREF="msg00663.html">[MUD-Dev] Re: clients anyone?...</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Tue 11 Aug 1998, 20:03 GMT
<UL>
<LI><strong><A NAME="00665" HREF="msg00665.html">[MUD-Dev] Re: clients anyone?...</A></strong>, 
Andrew Wilson <a href="mailto:andrew#aaaaaaaa,demon.co.uk">andrew#aaaaaaaa,demon.co.uk</a>, Tue 11 Aug 1998, 21:56 GMT
</LI>
<LI><strong><A NAME="00689" HREF="msg00689.html">[MUD-Dev] Re: clients anyone?...</A></strong>, 
Andrew Wilson <a href="mailto:andrew#aaaaaaaa,demon.co.uk">andrew#aaaaaaaa,demon.co.uk</a>, Wed 12 Aug 1998, 17:41 GMT
</LI>
<LI><strong><A NAME="00690" HREF="msg00690.html">[MUD-Dev] Re: clients anyone?...</A></strong>, 
Hans-Henrik Staerfeldt <a href="mailto:hhs#cbs,dtu.dk">hhs#cbs,dtu.dk</a>, Wed 12 Aug 1998, 18:08 GMT
<UL>
<LI><strong><A NAME="00692" HREF="msg00692.html">[MUD-Dev] Re: clients anyone?...</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Wed 12 Aug 1998, 18:37 GMT
<UL>
<LI><EM>Message not available</EM><UL>
<LI><strong><A NAME="00697" HREF="msg00697.html">[MUD-Dev] Re: LinuxThreads and SIGUSR1 (Ref: [MUD-Dev])</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Wed 12 Aug 1998, 23:09 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00790" HREF="msg00790.html">[MUD-Dev] Re: clients anyone?...</A></strong>, 
Adam Wiggins <a href="mailto:adam#angel,com">adam#angel,com</a>, Thu 20 Aug 1998, 18:25 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="01064" HREF="msg01064.html">[MUD-Dev] Re: clients anyone?...</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Fri 18 Sep 1998, 20:51 GMT
<UL>
<LI><strong><A NAME="01081" HREF="msg01081.html">[MUD-Dev] Re: clients anyone?...</A></strong>, 
Andrew Wilson <a href="mailto:andrew#aaaaaaaa,demon.co.uk">andrew#aaaaaaaa,demon.co.uk</a>, Sun 20 Sep 1998, 00:58 GMT
</LI>
</UL>
</LI>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>