
Pages:<< prev 1 next >>



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.



Geomancer

GroupAdministrators
Posts1,992
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.



Conjurer

GroupMembers
Posts395
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).
Someday, I'm still thinking of fully converting one of these codebases so it uses SQL for everything (no file access at all).



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:
Line 1267:
Line 1285:
Line 1369:
has_account:
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.
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.



Sorcerer

GroupMembers
Posts600
JoinedDec 3, 2008
speaking of accounts, Remcon how goes ur version?



Geomancer

GroupAdministrators
Posts1,992
JoinedJul 26, 2005
slower then id like lol. ill post what it shows so far in a bit
Pages:<< prev 1 next >>