LoP1.39 Questions/Issues/Anomalies + Suggestions?
< Newer Topic
:: Older Topic >
#61 May 15, 2011 8:10 pm
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
Currently no, it shouldn't be to hard to make it show them though.
#62 May 15, 2011 8:19 pm
GroupMembers
Posts600
JoinedDec 3, 2008
Thanks I will work on that, I have an idea how to go about it. But the deleting thing I have no clue how to do.
#63 May 15, 2011 8:21 pm
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
the deleting thing?
#64 May 15, 2011 8:26 pm
GroupMembers
Posts600
JoinedDec 3, 2008
I wanna make it where if the owner of a bank account deletes their pfile, the accounts will delete as well.
#65 May 15, 2011 8:35 pm
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
oh I had missed the one you posted before mine about deleting, thought I already added that in guess not though (just got done looking), give me a bit ill see lol.
#66 May 15, 2011 8:41 pm
GroupMembers
Posts600
JoinedDec 3, 2008
K thanks I was just able to port this over, and I am doing some fine touches to get it to where I want it for my mud.
#67 May 15, 2011 8:45 pm
GroupMembers
Posts600
JoinedDec 3, 2008
Sorry to be bugging you like this, just trying to get a feel for this.
Is there anyway I can make it where the account name has to be enter inorder for the bank account to be deleted?
Because currently just typing bank delete will, delete the first account in the list created by you.
Is there anyway I can make it where the account name has to be enter inorder for the bank account to be deleted?
Because currently just typing bank delete will, delete the first account in the list created by you.
#68 May 15, 2011 8:56 pm
Last edited May 15, 2011 9:01 pm by Remcon
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
Look for
Id take the || !str_cmp( account, "delete" ) out and make a spot before that ifcheck to make sure they entered a valid account. If they had used delete as the argument that is.
/* Just put arg as account */ if( !str_cmp( account, "create" ) || !str_cmp( account, "balance" ) || !str_cmp( account, "deposit" ) || !str_cmp( account, "withdraw" ) || !str_cmp( account, "transfer" ) || !str_cmp( account, "delete" ) || !str_cmp( account, "share" ) ) { snprintf( arg, sizeof( arg ), "%s", account ); if( !( nbank = get_first_bank( ch ) ) ) snprintf( account, sizeof( account ), "%s", ch->name ); else snprintf( account, sizeof( account ), "%s", nbank ); } else argument = one_argument( argument, arg );
Id take the || !str_cmp( account, "delete" ) out and make a spot before that ifcheck to make sure they entered a valid account. If they had used delete as the argument that is.
#69 May 15, 2011 10:11 pm
GroupMembers
Posts600
JoinedDec 3, 2008
Also I noticed that if a player deleted their name should be removed off of the share list for bank accounts. This would keep people from making a new character with this name from having access to old accounts.
#70 May 28, 2011 12:28 am
GroupMembers
Posts600
JoinedDec 3, 2008
I noticed while inputting the channels code into my own codebase that anything using phistory doesn't actually save or write. I doubled checked this on a fresh copy of LOP1.40. So I know this time I didn't miss anything
#71 May 28, 2011 7:52 am
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
Well it use to haha. Seen what you ment though
Looks like it doesn't like trying to do it like that in linking and unlinking, know it use to work great like that haha. Just have to do it the longer way for link and unlink in add_phistory.
Looks like it doesn't like trying to do it like that in linking and unlinking, know it use to work great like that haha. Just have to do it the longer way for link and unlink in add_phistory.
#73 May 28, 2011 9:36 am
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
/* Types: 0 = tell, 1 = say, 2 = yell, 3 = whisper, 4 = fchat */ void add_phistory( int type, CHAR_DATA *ch, char *argument ) { PER_HISTORY *phistory, *phistory_next, *phistory_remove = NULL, *history_start = NULL; int y = 0; if( !ch || is_npc( ch ) || !ch->pcdata || !argument || argument[0] == '\0' ) return; if( type < 0 || type > 4 ) return; if( type == 0 ) history_start = ch->pcdata->first_tell; else if( type == 1 ) history_start = ch->pcdata->first_say; else if( type == 2 ) history_start = ch->pcdata->first_yell; else if( type == 3 ) history_start = ch->pcdata->first_whisper; else if( type == 4 ) history_start = ch->pcdata->first_fchat; for( phistory = history_start; phistory; phistory = phistory_next ) { phistory_next = phistory->next; if( !phistory_remove ) phistory_remove = phistory; if( ++y >= 20 ) { if( type == 0 ) UNLINK( phistory_remove, ch->pcdata->first_tell, ch->pcdata->last_tell, next, prev ); else if( type == 1 ) UNLINK( phistory_remove, ch->pcdata->first_say, ch->pcdata->last_say, next, prev ); else if( type == 2 ) UNLINK( phistory_remove, ch->pcdata->first_yell, ch->pcdata->last_yell, next, prev ); else if( type == 3 ) UNLINK( phistory_remove, ch->pcdata->first_whisper, ch->pcdata->last_whisper, next, prev ); else if( type == 4 ) UNLINK( phistory_remove, ch->pcdata->first_fchat, ch->pcdata->last_fchat, next, prev ); free_phistory( phistory_remove ); phistory_remove = NULL; y--; } } phistory = NULL; CREATE( phistory, PER_HISTORY, 1 ); if( !phistory ) { bug( "%s: couldn't create a phistory.\r\n", __FUNCTION__ ); return; } smash_tilde( argument ); phistory->text = STRALLOC( argument ); phistory->chtime = current_time; if( type == 0 ) LINK( phistory, ch->pcdata->first_tell, ch->pcdata->last_tell, next, prev ); else if( type == 1 ) LINK( phistory, ch->pcdata->first_say, ch->pcdata->last_say, next, prev ); else if( type == 2 ) LINK( phistory, ch->pcdata->first_yell, ch->pcdata->last_yell, next, prev ); else if( type == 3 ) LINK( phistory, ch->pcdata->first_whisper, ch->pcdata->last_whisper, next, prev ); else if( type == 4 ) LINK( phistory, ch->pcdata->first_fchat, ch->pcdata->last_fchat, next, prev ); else free_phistory( phistory ); }
Seems to work good like that
#74 May 28, 2011 9:47 am
Last edited May 28, 2011 9:49 am by dbna2
GroupMembers
Posts600
JoinedDec 3, 2008
Thats LOL luckly I double checked this against a fresh copy of your codebase. I spent days wondering why it wasn't working
Also ealier in this thread u posted u had a fix for fread_phistory because of a memory leak? Can you post what the fix was?
Also ealier in this thread u posted u had a fix for fread_phistory because of a memory leak? Can you post what the fix was?
#75 May 28, 2011 9:58 am
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
in fread_phistory find
Change the fread_string to fread_flagstring since it doesn't need to be added into memory.
CREATE( phistory, PER_HISTORY, 1 ); if( !phistory ) { bug( "%s: couldn't create a phistory.\r\n", __FUNCTION__ ); fread_time( fp ); fread_string( fp ); return; }
Change the fread_string to fread_flagstring since it doesn't need to be added into memory.
#76 May 28, 2011 10:07 am
GroupMembers
Posts600
JoinedDec 3, 2008
Thanks Don't need memory leaks roaming around lol.
#77 May 28, 2011 10:17 am
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
No doubt and thanks for all the issues you have pointed out lately
#78 May 28, 2011 10:45 am
GroupMembers
Posts600
JoinedDec 3, 2008
Not a problem, thanks for making such handy features
#79 May 28, 2011 7:04 pm
GroupMembers
Posts600
JoinedDec 3, 2008
Suggestion for the friend System: Have it send a reminder every now and then if there are any names waitting to be approved/deleted.
I already made this, but I thought I would share the idea with you.
I already made this, but I thought I would share the idea with you.
#80 May 29, 2011 2:22 pm
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
K, did add that and decided that instead of putting the pending one on the one that sent the request to put it on the one that needs to accept/deny the request and made the changes needed to make the rest of them work with it. In all not to bad. Thanks for the idea