Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot, Yandex, Yahoo!, Sogou, Bing

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Hotboot with Accounts
Forum Rules | Mark all | Recent Posts

Hotboot with Accounts
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Oct 23, 2013, 5:27 am
Go to the top of the page
Go to the bottom of the page

Amras
Fledgling
GroupMembers
Posts18
JoinedAug 11, 2008

So I have a similar account system to the snippet that is available for SMAUG, SWR and SWFotE provided by KazRo. My problem is, whenever I do a hotboot, which I prefer to do over a reboot, all of the account data is unloaded from each character. I was hoping someone was able to look at the FUSS hotboot code provided by Dark Warriors, and the account snippet and inform me of how I would make accounts stay loaded during a hotboot. I've looked into it several times and each time I just get confused as to how I would save and load the account information during the hotboot. If you need any additional information, please ask.
       
Post is unread #2 Oct 23, 2013, 6:21 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

save the name of the account in the pfile or in the descriptor file hotboot saves and in hotboot_recovery reassign the account info.
       
Post is unread #3 Oct 23, 2013, 9:38 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

Are there snippets for the account system online here, either for smaugfuss or lop?

Someday, I'm still thinking of fully converting one of these codebases so it uses SQL for everything (no file access at all).
       
Post is unread #4 Oct 23, 2013, 4:34 pm
Go to the top of the page
Go to the bottom of the page

Amras
Fledgling
GroupMembers
Posts18
JoinedAug 11, 2008

Thanks Remcon. I wasn't too sure how to approach it, but I managed to get it working. And for anyone who is using the snippet, I cannot guarantee it will work with your code but it will at least give you an idea as to what to do to get it to work.

In my hotboot.c file,

Line 1180:

         fprintf( fp, "%d %d %d %d %d %s %s %s %s %s\n", d->can_compress, d->descriptor, och->in_room->vnum, d->port,
                  d->idle, och->name, d->host, ( mip_enabled( och ) ) ? och->pcdata->mip_ver : "-1",
                  ( mip_enabled( och ) ) ? och->pcdata->sec_code : "-1",
                  ( has_account( och ) ) ? och->desc->account->name : "-1" );


Line 1267:
void hotboot_recover( void )
{
   DESCRIPTOR_DATA *d = NULL;
   FILE *fp;
   char name[100];
   char mip_ver[10];
   char sec_code[10];
   char host[MAX_STRING_LENGTH];
   char account[MAX_STRING_LENGTH];


Line 1285:

      fscanf( fp, "%d %d %d %d %d %s %s %s %s %s\n", &dcompress, &desc, &room, &dport, &idle, name, host, mip_ver, sec_code,
              account );


Line 1369:

         if( str_cmp( account, "-1" ) )
         {
            d->account = fread_account( account );
         }
         else
         {
            d->account = NULL;
         }


has_account:

bool has_account( CHAR_DATA * ch )
{
   if( IS_NPC( ch ) )
      return FALSE;

   if( ch->desc->account )
      return TRUE;

   return FALSE;
}



I also have the MIP snippet installed so that is what the sec_code and mip_enabled stuff is. Disregard if you do not have it and just add those lines of codes in the appropriate places in hotboot.c. This worked for me, not guaranteed to work for anyone else. But I started a thread asking a question, finished it with an answer.
       
Post is unread #5 Nov 10, 2013, 3:22 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

speaking of accounts, Remcon how goes ur version?
       
Post is unread #6 Nov 10, 2013, 7:37 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

slower then id like lol. ill post what it shows so far in a bit
       
Pages:<< prev 1 next >>