Logon advertisement
Moderator: Mod Squad
Logon advertisement
Does anyone want to share any snippets of code on how they advertise their modules when the user first logs in?
It's the log-on routine.
Code: Select all
GBOOL foologon(VOID);
static INT foostt; /* Foo Module State */
struct module elwfoo={ /* module interface block */
"", /* name used to refer to this module */
foologon, /* user logon supplemental routine */
fooinput, /* input routine if selected */
NULL, /* status-input routine if selected */
NULL, /* "injoth" routine for this module */
NULL, /* user logoff supplemental routine */
NULL, /* hangup (lost carrier) routine */
NULL, /* midnight cleanup routine */
NULL, /* delete-account routine */
fooclose /* finish-up (sys shutdown) routine */
};
GBOOL foologon(VOID) {
setmbk(foomb);
prfmsg(FOOLOGIN);
outprf(usrnum);
return(0);
}
Code: Select all
GBOOL foologon(VOID);
static INT foostt; /* Foo Module State */
struct module elwfoo={ /* module interface block */
name module; /* name used to refer to this module */
type foologon(); /* user logon supplemental routine */
type fooinput(); /* input routine if selected */
type FOOLOGIN; /* status-input routine if selected */
type usernum; /* "injoth" routine for this module */
NULL; /* user logoff supplemental routine */
NULL; /* hangup (lost carrier) routine */
NULL; /* midnight cleanup routine */
NULL; /* delete-account routine */
type fooclose(); /* finish-up (sys shutdown) routine */
};
GBOOL foologon(VOID) {
setmbk(foomb);
prfmsg(FOOLOGIN);
outprf(usrnum);
return(0);
}
Ok, the struct is what threw us off completely in that module. We though you left it like that for us to fill in our types for the structure it's self.Questman wrote:No, the code block I posted above exactly would work.
Of course, it's missing some other necessities, but the definition of the function, the module interface block, and the logon routine are 100% accurate as if they were cut right out of the module "Foo"
in your logon supplement routine put the message to display.The Storm wrote:Ok, the struct is what threw us off completely in that module. We though you left it like that for us to fill in our types for the structure it's self.Questman wrote:No, the code block I posted above exactly would work.
Of course, it's missing some other necessities, but the definition of the function, the module interface block, and the logon routine are 100% accurate as if they were cut right out of the module "Foo"
like mine is:
GBOOL EXPORT lonrou(VOID)
{
setdata();
loaddata();
if(hasmkey(GLOKEY)) { <--key to see message
if(shwlgn) {<---- config level 4 defines yes or no to show it
if( (shwonc) || (!cptr->seenit)) { <--show it once or always?
cptr->seenit=1;
prfmlt(MESSAGEID, params) <----prf what message ID?
outusr(usrnum); <---inject call
}
}
}
return(FALSE);
}
that will display a logon message only if the sysop says so in config level 4
and allows option to only display it once or every logon.
another way to go about this is:
GBOOL lonrou(VOID)
{
setbtv(mybb);
if (!dfaQueryEQ(usaptr->userid,0)) {
setmbk(mymb);
prfmsg(MESSAGEID);
outprf(usrnum);
}
return(FALSE);
}
well the foologon, he was just showing the interface block, you have to set the logon routine in the interface block, in his exampkle foologon.The Storm wrote:Like this in the module??Code: Select all
GBOOL foologon(VOID); static INT foostt; /* Foo Module State */ struct module elwfoo={ /* module interface block */ name module; /* name used to refer to this module */ type foologon(); /* user logon supplemental routine */ type fooinput(); /* input routine if selected */ type FOOLOGIN; /* status-input routine if selected */ type usernum; /* "injoth" routine for this module */ NULL; /* user logoff supplemental routine */ NULL; /* hangup (lost carrier) routine */ NULL; /* midnight cleanup routine */ NULL; /* delete-account routine */ type fooclose(); /* finish-up (sys shutdown) routine */ }; GBOOL foologon(VOID) { setmbk(foomb); prfmsg(FOOLOGIN); outprf(usrnum); return(0); }
its a GBOOL routine