Logon advertisement

Idea and code exchange. Porting and new development talk here!

Moderator: Mod Squad

Post Reply
The Storm
Posts: 163
Joined: Fri Jun 09, 2006 2:35 am
Location: Dover, DE

Logon advertisement

Post by The Storm »

Does anyone want to share any snippets of code on how they advertise their modules when the user first logs in?
The Storm
DarkStar Development
telnet://thecrazyhousebbs.com
http://www.thecrazyhousebbs.com

Questman
Posts: 629
Joined: Sat Apr 01, 2006 9:48 pm
Location: Raleigh, NC
Contact:

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


The Storm
Posts: 163
Joined: Fri Jun 09, 2006 2:35 am
Location: Dover, DE

Post 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??
The Storm
DarkStar Development
telnet://thecrazyhousebbs.com
http://www.thecrazyhousebbs.com

Questman
Posts: 629
Joined: Sat Apr 01, 2006 9:48 pm
Location: Raleigh, NC
Contact:

Post 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"

The Storm
Posts: 163
Joined: Fri Jun 09, 2006 2:35 am
Location: Dover, DE

Post 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.
The Storm
DarkStar Development
telnet://thecrazyhousebbs.com
http://www.thecrazyhousebbs.com

User avatar
dspain
Posts: 2102
Joined: Sun May 07, 2006 10:38 pm
Location: richmond,virginia
Contact:

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

User avatar
dspain
Posts: 2102
Joined: Sun May 07, 2006 10:38 pm
Location: richmond,virginia
Contact:

Post 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

Post Reply