[DGD] Problem with call_other()

Maarten Goudsmit m_goudsmit at yahoo.com
Thu Feb 13 19:05:50 CET 2003


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...

Thanks for reading,

Maarten

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list