[DGD] Re: supporting both dgd and dgd net with a single driver.c

Gregory D Lewis glewis at maths.adelaide.edu.au
Sun Nov 2 13:19:54 CET 1997


Wim van der Vegt wrote:
> 
> OOps, the thing below SEEMED to work. So my question remains, how do i
> support both dgd and dgdnet with a single driver object. Problem is that the
> open_port is unkown to dgd and a call needs to be done to it for dgdnet to
> accept players.
> 

"catch" the call.  I.e. make the line in driver.c

   catch(open_port("telnet", 6047));

If you're not using networking, it won't work.  If you are, it will.  Either 
way the desired effect occurs.  

You want to be trickier, then actually assign the catch to a variable.  You
can then examine the error (if it does error) and find out if it was an error
based on not being able to open the port for some reason or if it was an error
because it doesn't know about open_port.

Possibly a more elegant solution can be thought of but this one will probably
do the trick.
-- 
Greg Lewis                              Applied Maths Department
Email : glewis at maths.adelaide.edu.au    University of Adelaide
--
As long as war is regarded as wicked, it will always have its
fascination.  When it is looked upon as vulgar, it will cease to be
popular.
		-- Oscar Wilde



List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list