Page 1 of 1

Logon advertisement

Posted: Wed Aug 16, 2006 9:49 pm
by The Storm
Does anyone want to share any snippets of code on how they advertise their modules when the user first logs in?

Posted: Thu Aug 17, 2006 1:51 am
by Questman
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);
}


Posted: Thu Aug 17, 2006 3:43 am
by The Storm

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); 
}
Like this in the module??

Posted: Thu Aug 17, 2006 3:51 am
by Questman
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"

Posted: Thu Aug 17, 2006 4:06 am
by The Storm
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"
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.

Posted: Thu Aug 17, 2006 4:34 am
by dspain
The Storm wrote:
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"
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.
in your logon supplement routine put the message to display.

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);
}

Posted: Thu Aug 17, 2006 4:40 am
by dspain
The Storm wrote:

Code: Select all

GBOOL foologon&#40;VOID&#41;; 


static INT foostt;                 /* Foo Module State */ 
struct module elwfoo=&#123;         /* module interface block               */ 
     name module;                      /*    name used to refer to this module */ 
     type foologon&#40;&#41;;                /*    user logon supplemental routine   */ 
     type fooinput&#40;&#41;;                /*    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 &#40;lost carrier&#41; routine     */ 
     NULL;                    /*    midnight cleanup routine          */ 
     NULL;                    /*    delete-account routine            */ 
     type fooclose&#40;&#41;;                 /*    finish-up &#40;sys shutdown&#41; routine  */ 
&#125;; 

GBOOL foologon&#40;VOID&#41; &#123; 
   setmbk&#40;foomb&#41;; 
   prfmsg&#40;FOOLOGIN&#41;; 
   outprf&#40;usrnum&#41;; 
   return&#40;0&#41;; 
&#125;
Like this in the module??
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.

its a GBOOL routine