[DGD] Problem with call_other()

Noah Gibbs angelbob at monkeyspeak.com
Thu Feb 13 19:28:18 CET 2003


  One thing that could cause this is if LOGIN_HANDLER wasn't explicitly
compiled -- you'll get a find_object() happening, but there'll be no such
object to find.
  Try adding the line:

if(!find_object(LOGIN_HANDLER)) compile_object(LOGIN_HANDLER);

  And make sure it gets executed before your call below.

  Hope this helps.

On Thu, 13 Feb 2003, Maarten Goudsmit wrote:

> I have just started coding my own MUDlib for DGD and
> I'm having a rather strange problem with call_other().
> 
> Here's where the problem occurs in telnetd.c:
> 
> ...
> #include <login_handler.h>
> ...
> 
> string query_banner(object connection)
> {
> return
> LOGIN_HANDLER->get_message("/doc/login/WELCOME");
> }
> 
> The LOGIN_HANDLER is defined in login_handler.h as
> follows:
> 
> #define LOGIN_HANDLER "/obj/handlers/login_handler"
> 
> In the obj/handlers/login_handler.c file,
> get_message() is specified as follows:
> 
> nosave mapping messages;
> 
> string get_message(string mess_name) {
>     if(!messages)
>         messages = ([ ]);
> 
>     // Prevent it working on anything except in /doc
> to avoid any security risks.
>     if(mess_name[0..4] != "/doc/")
>         return "";
> 
>     if(!messages[mess_name])
>         messages[mess_name] = read_file(mess_name);
> 
>     return messages[mess_name];
> }
> 
> Now when I start the driver, no problems occur. The
> error strikes when I telnet in. The driver gives the
> following error message:
> 
> Feb 13 19:03:03 ** Bad argument 1 for kfun call_other
>   27 open              /kernel/obj/telnet (#25)
>  113 open              /kernel/lib/connection
> (/kernel/obj/telnet#25)
>  164 query_telnet_banner /kernel/sys/userd
>   23 query_banner      /usr/System/sys/telnetd
> 
> So obviously, the error is in 'return
> LOGIN_HANDLER->get_message("/doc/login/WELCOME");'.
> But as far as I know this is correct LPC, or am I
> mistaken. I am fairly newbie in LPC, so please go
> gentle with me in explaining my stupidity...

-- 
angelbob at monkeyspeak.com
See my page of DGD documentation at
"http://phantasmal.sourceforge.net/DGD/"
If you post to the DGD list, you may see yourself there!


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



More information about the DGD mailing list