Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
AhrefsBot, Google

Members: 0
Guests: 29
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » 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 7: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 8:21 am   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
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 11: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 6: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 5:22 am   
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008

 
speaking of accounts, Remcon how goes ur version?

Post is unread #6 Nov 10, 2013 9:37 am   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
slower then id like lol. ill post what it shows so far in a bit

Pages:<< prev 1 next >>