1999Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Custom Server Roll Call? -->
<!--X-From-R13: Szvy Svserz <rzvyNcebcurpl.yh> -->
<!--X-Date: Sun, 16 May 1999 21:41:16 &#45;0700 -->
<!--X-Message-Id: 4.1.19990517011803.02299e50#exchange,windh.net -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199905150551.XAA03887@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Custom Server Roll Call?</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:emil#prophecy,lu">
</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="msg00277.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00279.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00249.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00300.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00278">Author</A>
&nbsp;|&nbsp;<A HREF="#00278">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00278">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Custom Server Roll Call?</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>: Re: [MUD-Dev] Custom Server Roll Call?</LI>
<LI><em>From</em>: Emil Eifrem &lt;<A HREF="mailto:emil#prophecy,lu">emil#prophecy,lu</A>&gt;</LI>
<LI><em>Date</em>: Mon, 17 May 1999 02:14:05 +0200</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#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>
At 07:51 AM 5/15/99 , Chris Gray wrote:
&gt;[Emil Eifrem:]
&gt;&gt; None of the above is viable. My solution was to introduce a second way of
&gt;&gt; IMC, tentatively called "exported functions." (Horrible name for something
&gt;&gt; in a Java server, I know.) The idea is to make it possible for a module to
&gt;&gt; execute special, 'exported' methods in other modules. Probably the best way
&gt;&gt; to explain this is to show an example:
&gt;&gt;
&gt;&gt; ---
&gt;&gt; DBModuleInterface = getModuleInterface("database");
&gt;&gt; int amountOfSwords = DBModuleInterface.issueQuery(query);
&gt;&gt; player.println("There are " + amountOfSwords + " swords in the db.");
&gt;
&gt;I think this is quite close to the issues that came up with devmud. I
&gt;haven't been on Jon's MUD for months, so I don't know if stuff is happening
&gt;there or not.
&gt;
&gt;We had talked about ways of linking up an exporter of functions to importers
&gt;of functions, based on descriptions of their arguments and their names. Thus,
&gt;the type-safe aspect wasn't done by the implementation language, but rather
&gt;by the matching code. My Java isn't good enough to know whether you can do
&gt;this in Java or not.

So basically enforcing this would mean I'd have to use of some kind of
preprocessor that confirms that all invoked exported functions have a
corresponding definition somewhere in some other module? Unfortunately,
that's the kind of extension I would much rather avoid. I think I have
achieved the same effect with my "exported functions?"

&gt;
&gt;You could handle it by just using your first, event-based interface. The
&gt;command code builds the DB request and emits it. The DB code receives the
&gt;request and processes it. It then emits a DB-response message, containing
&gt;an identifier that was also in the request message. Receipt of that
&gt;response wakes up the command module, which was in a form of sleep,
&gt;waiting for a message like that. I won't comment on the efficiency of
&gt;a scheme like this, but it ought to work. Unfortunately, this completely
&gt;bypasses your desire for language-enforced type safeness, since you are
&gt;doing everything with strings, which are not checked by Java, but only
&gt;by the module(s) that receive them. It sounded like you were already
&gt;using lots of threads, so having the command module asleep, waiting
&gt;for a response, shouldn't matter - it should still be able to run
&gt;other threads to handle further input.

-nod- I have the bad feeling that in the end, I will be using strings for
my events anyway. :(

I guess this would work. My initial response was "what if/when DB module in
this example does not emit a response event, the whole command handler
would freeze!" But that's really no different than from using normal method
calls; the way I have it now, any method can block and freeze the mud if it
wanted to.

I'm going to have a look at this alternative. One concern (as you pointed
out) is performance, this will need to happen literally thousands of times
per second, probably more by a magnitude. And suspending-resuming threads
in Java is not only discouraged, it's a resource-eater as well.

&gt;
&gt;&gt; This may not sound like a big problem. But it is, believe you me. Let's say
&gt;&gt; that I want to have a Player class that several modules are dealing with.
&gt;&gt; For example, I used to have a "Creation" module, that was responsible for
&gt;&gt; creating new players and characters (player = a rl-world person, character
&gt;&gt; = a fictional person run by a player). I thought this was a neat idea, but
&gt;&gt; in order to have the Creation module pass the newly created players and
&gt;&gt; characters to other modules (say, the 'World' module and the 'Playermode'
&gt;&gt; module) I would have to move the Player and Character classes into the
&gt;&gt; kernel. Remember, classes created in the Creation module are only visible
&gt;&gt; to the Creation module.
&gt;
&gt;Indirection. You'll have to go back to the older form of using objects,
&gt;rather than the C++ form. *Only* the module that defines a class can do
&gt;any operations on it. 

Right now, only the module that defines a class can do any operations on
it. Actually, that's the way it will stay whether I like it or not, it's
just the way this type of class unlaoding works in Java. This may be for
the good in most cases but it would be nice to somehow share common data
types without having to resort to putting them in the kernel.

&gt;Everyone else can just store and pass around
&gt;references to specific objects of those classes. Untyped pointers,
&gt;essentially. You could just use integers for them, but Objects are likely
&gt;easier. Will this make it awkward to do lots of things? You bet! And
&gt;inefficient.

That's what it's like in the current version. I'm not actually passing
along a Connection object with my NETWORK_NEW_CONNECTION event, I'm passing
along an int that represents an index in the Network module's internal
connection list. This works out ok as far as connections and similar go.
But it makes it practically impossible (or at least very awkward) to have
for example a Creation module that is responsible for creating objects of a
complex class (Player) that other modules can use.

[snip problems with devmud]
&gt;It sounds like you want aspects of your scenario (as opposed to your
&gt;low-level server) to be reloadable modules. I don't really see a way to
&gt;do that cleanly.

I would really want to have basically everything contained in reloadable
modules. I'm just so hooked on the "detach;compile;attach new" approach to
a mud that has been repeated here so many times. (I'm also, btw, coming
from a 100% hardcoded background (ROM) with a server that basically
requires rebooting for every little change. Much like that favorite
operating system we all love to hate.) I may ultimately end up with a
server consisting of two modules: network and world, where world is an
entire mud minus networking.

[ - - - - 
Emil Eifrem [emil#prophecy,lu || www.prophecy.lu/~emil]
Implementor of Prophecy [<A  HREF="telnet://mud.prophecy.lu:4000">telnet://mud.prophecy.lu:4000</A>]
Coordinator of the Jamu effort [<A  HREF="http://www.javamud.org">http://www.javamud.org</A>]
                                              - - - - ]



_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>


</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="00249" HREF="msg00249.html">Re: [MUD-Dev] Custom Server Roll Call?</A></STRONG>
<UL><LI><EM>From:</EM> Chris Gray &lt;cg#ami-cg,GraySage.Edmonton.AB.CA&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00277.html">Re: [MUD-Dev] Multi-threaded mud server.</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00279.html">Re: [MUD-Dev] Multi-threaded mud server.</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00249.html">Re: [MUD-Dev] Custom Server Roll Call?</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00300.html">Re: [MUD-Dev] Custom Server Roll Call?</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00278"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00278"><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>RE: [MUD-Dev] Custom Server Roll Call?</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00159" HREF="msg00159.html">RE: [MUD-Dev] Custom Server Roll Call?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 06 May 1999, 04:33 GMT
<UL>
<LI><strong><A NAME="00161" HREF="msg00161.html">RE: [MUD-Dev] Custom Server Roll Call?</A></strong>, 
Marc Hernandez <a href="mailto:marc#ias,jb.com">marc#ias,jb.com</a>, Thu 06 May 1999, 05:50 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00185" HREF="msg00185.html">Re: [MUD-Dev] Custom Server Roll Call?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 09 May 1999, 11:24 GMT
</LI>
<LI><strong><A NAME="00249" HREF="msg00249.html">Re: [MUD-Dev] Custom Server Roll Call?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 15 May 1999, 09:30 GMT
<UL>
<LI><strong><A NAME="00278" HREF="msg00278.html">Re: [MUD-Dev] Custom Server Roll Call?</A></strong>, 
Emil Eifrem <a href="mailto:emil#prophecy,lu">emil#prophecy,lu</a>, Mon 17 May 1999, 04:41 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00300" HREF="msg00300.html">Re: [MUD-Dev] Custom Server Roll Call?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 18 May 1999, 06:46 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00121" HREF="msg00121.html">Re: [MUD-Dev] Censorship, Virtual v Artificial Worlds, Python</A></strong>, 
Dan <a href="mailto:scatter#thevortex,com">scatter#thevortex,com</a>, Mon 03 May 1999, 16:00 GMT
<UL>
<LI><strong><A NAME="00135" HREF="msg00135.html">Re: [MUD-Dev] Censorship, Virtual v Artificial Worlds, Python</A></strong>, 
Matthew Mihaly <a href="mailto:diablo#best,com">diablo#best,com</a>, Tue 04 May 1999, 05:52 GMT
</LI>
<LI><strong><A NAME="00187" HREF="msg00187.html">Re: [MUD-Dev] Censorship, Virtual v Artificial Worlds, Python</A></strong>, 
Marian Griffith <a href="mailto:gryphon#iaehv,nl">gryphon#iaehv,nl</a>, Mon 10 May 1999, 06:46 GMT
</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>