| Message |
Look at the MUD output log (ie. for bug messages). It won't find those functions if there was an error loading the Lua startup script. For example, if I deliberately introduce an error into it, and connect, I see stuff like this:
Sun Jul 29 07:35:12 2007 :: Admin (10.0.0.4) has connected.
Sun Jul 29 07:35:12 2007 :: [*****] BUG: Error loading Lua startup file ../lua/startup.lua:
../lua/startup.lua:2: '=' expected near 'afd'
Sun Jul 29 07:35:12 2007 :: [*****] BUG: Warning: Lua script function 'reconnected' does not exist
The startup.lua file implements those commands by "requiring" (loading in) extra files, like this:
-- install other stuff here (like task system)
task = require ("tasks").task -- module - provides 'task' command handler
whereis = require ("whereis").whereis -- module - provides 'whereis' command handler
If that isn't it, take a look at the start of find_lua_function:
static lua_State * find_lua_function (CHAR_DATA * ch, const char * fname)
{
lua_State *L = ch->L;
if (!L || !fname)
return NULL; /* can't do it */
The first thing it checks is that you have a Lua state set up (ie. not a NULL pointer). If the state wasn't initialized on a reconnect that would be it. It was working yesterday.
Have you done a hotboot? We found you needed to set up the Lua state after doing that. You need a call to open the Lua state when the hotboot finishes. This is the code I had there:
char_to_room( d->character, d->character->in_room );
act( AT_MAGIC, "A puff of ethereal smoke dissipates around you!", d->character, NULL, NULL, TO_CHAR );
act( AT_MAGIC, "$n appears in a puff of ethereal smoke!", d->character, NULL, NULL, TO_ROOM );
d->connected = CON_PLAYING;
open_lua (d->character); /* fire up Lua state */
call_lua (d->character, "reconnected", d->character->name);
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|