1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Minimal MUD&#45;kernel (was Re: Finer points of Telnet programming ...) -->
<!--X-From-R13: @vxynf Syzdivfg <q97ryzNqgrx.punyzref.fr> -->
<!--X-Date: Mon, 24 Aug 1998 02:50:47 &#45;0700 -->
<!--X-Message-Id: Pine.SOL.3.96.980824102345.17701A&#45;100000#licia,dtek.chalmers.se -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199808240327.VAA05642#darklock,com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Minimal MUD-kernel (was Re: Finer points of Telnet p</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:d97elm#dtek,chalmers.se">
</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="msg00832.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00834.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00830.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00835.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00833">Author</A>
&nbsp;|&nbsp;<A HREF="#00833">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00833">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Minimal MUD-kernel (was Re: Finer points of Telnet programming ...)</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] Minimal MUD-kernel (was Re: Finer points of Telnet programming ...)</LI>
<LI><em>From</em>: Niklas Elmqvist &lt;<A HREF="mailto:d97elm#dtek,chalmers.se">d97elm#dtek,chalmers.se</A>&gt;</LI>
<LI><em>Date</em>: Mon, 24 Aug 1998 11:49:37 +0200 (MET DST)</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 Sun, 23 Aug 1998, Caliban Tiresias Darklock wrote:
&gt; &gt;So I decided that I would design
&gt; &gt;as simple a MUD platform as I can
&gt; 
&gt; I've thought about doing something like this... I have this hairbrained
&gt; idea of a modular MUD, where the internal networking code is in one module
&gt; and everything else hooks into it from external plugins. So the question of
&gt; room or coordinate based, combat or non-combat, programming interface,
&gt; etc... all of that's basically irrelevant. How to make it portable and
&gt; such, I have no real answer for... but ideally, I'd like to have a little
&gt; plug-in module that doesn't do anything but accept and manage connections,
&gt; then plug everything else in from there.

That makes two of us! My pet project involves a kernel-like core
executable (called the MoleCore) which contains just pure engine code
which dynamically links to shared libs (I call them plugins) that
provide the real functionality of the MUD. Since I'm developing in C++,
I've devised a cute little scheme for creative use of inheritance and
polymorphism across dynamically linked libs and a running executable.
Tentatively named "hidden inheritance", this technique allows me to define
skeleton base classes in the MoleCore (such as an Event class which does
nothing, merely defines the interface) and then subclass and redefine
these base classes in the plugins completely independant of the MoleCore.
This way, I can create subclasses such as MagicEvent, CombatEvent and so
on and introduce them into the EventManager of the MoleCore without having
to recompile it at all -- and this at run-time!

I've outlined this method before on the list, and I've written a short
text describing the process which can be found at 
&lt;URL: <A  HREF="http://artoo.hemmet.s-hem.chalmers.se/~crozius/resources/dynload.html">http://artoo.hemmet.s-hem.chalmers.se/~crozius/resources/dynload.html</A>&gt;
Recently, I've managed to implement hidden inheritance on Win32 (earlier,
I thought the Windows dynamic linking mechanism would prevent this) and I
am in the process of writing a feature article as well as a new webpage on
this. As for making it portable, my article discusses how to use the
Adapter or Bridge design pattern to encapsulate platform-specific dynamic
linking calls into a coherent whole. 

One of the major problems, however, with having a kernel&lt;-&gt;plugin
architecture like this is how to make the plugins work together. We don't
want to increase the coupling in the system by letting each plugin know of
the others. In MoleCore, I've opted to introduce a decoupled data path for
plugin messages (or Requests, as I'd like to call them) which I've named
the Request Chain. When bootstrapping a plugin (ie attach it dynamically
to the core), the plugin may attach itself to the Request Chain and listen
for Requests (sort of like putting its ear to a railroad track). Plugins
may then issue Requests to the chain without having to know whether there
is any other plugin out there -- in your example of a network manager,
this plugin could for example accept new connections and send a
NewConnectionRequest (or similar) as well as read data from sockets and
issue DataReceivedRequests which contains file descriptors and a data
buffer. Then it would be up to some other mechanism to capture and handle
the Request, the network manager plugin would go back to happily wait for
new data.

&gt; I keep imagining having a single OCX control that I grab in Visual C++
&gt; and drop on my project, and boom, there's a basic bare-bones telnet
&gt; server that handles IAC DO/DON'T/WILL/WON'T sequences appropriately. (I
&gt; can probably buy one of these, since I think I've seen something similar
&gt; advertised, but I want to build one.) 

In my case, it would be a plugin-class which is part of a standard
DLL-file explicitly loaded at run-time. This plugin (TelnetPlugin maybe?)
would capture data requests from the network manager plugin and act as a
filter, handling all IAC sequences,  before passing on the data to the
Request Chain. And yes, adding this would be as simple as dropping the
filename of the DLL in a config file (or maybe logging  is as system
administrator in the MUD and loading the DLL and inserting the
TelnetPlugin manually, such as when testing and debugging the plugin). The
actual linking is performed at run-time, of course, opening some nice
possibilities.

More info on MoleCore (such as why it is called 'MoleCore', as well as
some random design documents) can be found at 
&lt;URL: <A  HREF="http://artoo.hemmet.s-hem.chalmers.se/molemud/">http://artoo.hemmet.s-hem.chalmers.se/molemud/</A> &gt;

-- Niklas Elmqvist (d97elm#dtek,chalmers.se) ----------------------
  "A Thaum is the basic unit of magical strength. It has been 
   universally established as the amount of magic needed to create 
   one small white pigeon or three normal sized billiard balls."
		-- Terry Pratchett, The Color of Magic




</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="00830" HREF="msg00830.html">[MUD-Dev] Re: Finer points of Telnet programming ...</A></STRONG>
<UL><LI><EM>From:</EM> Caliban Tiresias Darklock &lt;caliban#darklock,com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00832.html">[MUD-Dev] Re: Finer points of Telnet programming ...</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00834.html">[MUD-Dev] Re: Finer points of Telnet programming ...</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00830.html">[MUD-Dev] Re: Finer points of Telnet programming ...</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00835.html">[MUD-Dev] Re: Modular MUD [Was:Finer points of Telnet programming ...]</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00833"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00833"><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: Finer points of Telnet programming ...</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00822" HREF="msg00822.html">[MUD-Dev] Re: Finer points of Telnet programming ...</A></strong>, 
Marc Hernandez <a href="mailto:marc#jb,com">marc#jb,com</a>, Sun 23 Aug 1998, 08:06 GMT
</LI>
<LI><strong><A NAME="00828" HREF="msg00828.html">[MUD-Dev] Re: Finer points of Telnet programming ...</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Sun 23 Aug 1998, 21:26 GMT
<UL>
<LI><strong><A NAME="00829" HREF="msg00829.html">[MUD-Dev] Re: Finer points of Telnet programming ...</A></strong>, 
Jynx (Wyrm / Tygr / Myth) Ryn <a href="mailto:jynx_ryn#mindless,com">jynx_ryn#mindless,com</a>, Sun 23 Aug 1998, 22:16 GMT
<UL>
<LI><strong><A NAME="00830" HREF="msg00830.html">[MUD-Dev] Re: Finer points of Telnet programming ...</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Mon 24 Aug 1998, 03:28 GMT
<UL>
<LI><strong><A NAME="00833" HREF="msg00833.html">[MUD-Dev] Minimal MUD-kernel (was Re: Finer points of Telnet programming ...)</A></strong>, 
Niklas Elmqvist <a href="mailto:d97elm#dtek,chalmers.se">d97elm#dtek,chalmers.se</a>, Mon 24 Aug 1998, 09:50 GMT
</LI>
<LI><strong><A NAME="00835" HREF="msg00835.html">[MUD-Dev] Re: Modular MUD [Was:Finer points of Telnet programming ...]</A></strong>, 
Jynx (Wyrm / Tygr / Myth) Ryn <a href="mailto:jynx_ryn#mindless,com">jynx_ryn#mindless,com</a>, Mon 24 Aug 1998, 23:55 GMT
<UL>
<LI><strong><A NAME="00839" HREF="msg00839.html">[MUD-Dev] Re: Modular MUD [Was:Finer points of Telnet programming ...]</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Tue 25 Aug 1998, 12:47 GMT
<UL>
<LI><strong><A NAME="00840" HREF="msg00840.html">[MUD-Dev] Re: Modular MUD [Was:Finer points of Telnet programming ...]</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Tue 25 Aug 1998, 15:11 GMT
<UL>
<LI><strong><A NAME="00842" HREF="msg00842.html">[MUD-Dev] Re: Modular MUD [Was:Finer points of Telnet programming ...]</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Wed 26 Aug 1998, 01:05 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</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>