Re: Stumped on loading
Michael Barton <[email protected]>
| Newsgroups | gmane.games.devel.mud.rom |
|---|---|
| Message-ID | <[email protected]> |
That's more or less what I was hoping fread_temp_char wouldn't look like, because I don't see any answers. > fread_temp_char(ch, fp); // the new loading structure, checking for any old players I'm assuming that this line is actually somewhere above the for (;;) loop? What's interesting is that it works with #PLAYER there at all, since I don't really see any place that it would be read in, whether it's being loaded from the database or not (unless you modified fread_char to eat it first). Is it not logging any "bad section" or "no match" bugs? On 4/23/05, Tom Whiting <[email protected]> wrote: > Sorry, should have included that function :) > > void fread_temp_char (CHAR_DATA *ch, FILE *fp) > { > > char sql[MIL]; > int records; > sprintf(sql, "SELECT name FROM user_data WHERE name='%s'",ch->name); > mysql_safe_query(sql); > result = mysql_store_result(database); > records = mysql_num_rows(result); > if (records > 0){ > sql_pcload(ch); > } > else > { > fread_char(ch, fp); > } > load_notes(ch); > load_sql_aliases(ch); > load_sql_skills(ch); > load_sql_affects(ch); > load_sql_groups(ch); > load_sql_ignore(ch); > load_investments(ch); > > } > > Nothing requiring player there. The load_sql_xxx functions don't even look at the pfile, they draw directly from the database. > > As far as what loads? Absolutely nothing. Password, user key, email, id, nothing. The name is established, because that's established early on in the loading cycle, but that's it. I've tested my account with no password, and it loads up, obviously without my stats, etc, but it still loads. > > > On Sat, 23 Apr 2005 18:39:17 -0500, Michael Barton wrote: > >What's the fread_temp_char do? I'm assuming it reads from the > >file. Might it be what is causing problems when the #PLAYER section > >is missing? > > > >How is the player not being loaded? At all? Where does it exit > >from the function at? > > > >On 4/23/05, Tom Whiting <[email protected]>wrote: > > > >>hi, gang > >>usually, I have no problems going through code and debugging crap > >>myself, but, occasionally (a bit more often than I'd like), I > >>need the advice of "experts" ;) This is one of those times, > >>hopefully someone can point me into the right direction, cuz I'm > >>beating my head against the wall here (and it's sore:)) > >> > >>The goal: > >>To effectively load users FROM an SQL database, rather than from > >>files. That part is easy, really. I've been over this one pretty > >>thoroughly, crossed my T's, dotted my I's, that usual stuff. > >>Everything is saving (and loading) from the database quite > >>successfully. > >> > >>So, what's the problem? > >>The pfile is the problem, to be honest. Something, inside of the > >>code is looking for #PLAYER at the top of the pfile. Eventually, > >>I'll be getting rid of those entirely, loading everything > >>(objects, pets, spells, affects, etc) from SQL, and when that's > >>done, there will be no pfile. For now, #PLAYER in the pfile is > >>fine, but when everything gets done, there will be nowhere to put > >>that. > >> > >>Now, I know of this code in save.c which reads that line: > >> > >>if ( !str_cmp( word, "PLAYER" ) ) fread_char ( ch, fp ); > >>else if ( !str_cmp( word, "OBJECT" ) ) fread_obj ( ch, fp ); > >>else if ( !str_cmp( word, "O" ) ) fread_obj ( ch, fp ); > >>else if ( !str_cmp( word, "BOX" ) ) fread_bobj ( ch, fp ); > >>else if ( !str_cmp( word, "PET" ) ) fread_pet ( ch, fp ); > >>else if ( !str_cmp( word, "MOUNT" ) ) fread_mount( ch, fp ); > >>else if ( !str_cmp( word, "END" ) ) break; > >> > >>And I've modified that to read: > >>fread_temp_char(ch, fp); // the new loading structure, checking > >>for any old players word = fread_word( fp ); > >> > >>if ( !str_cmp( word, "OBJECT" ) ) fread_obj ( ch, fp ); else if > >>( !str_cmp( word, "O" ) ) fread_obj ( ch, fp ); else if ( ! > >>str_cmp( word, "BOX" ) ) fread_bobj ( ch, fp ); else if ( ! > >>str_cmp( word, "PET" ) ) fread_pet ( ch, fp ); else if ( ! > >>str_cmp( word, "MOUNT" ) ) fread_mount( ch, fp ); else if ( ! > >>str_cmp( word, "END" ) ) break; > >> > >>So, the word "PLAYER" isn't even called here, or it shouldn't be > >>Yet (and this is after many clean compiles, shutdowns, reboots, > >>etc), the problem remains that IF that #PLAYER line is not at the > >>top of the pfile, then the player's file is not even loaded. When > >>it is, the file is loaded perfectly, when not, the file isn't. > >>Like I said, I'm stumped on this one, is there somewhere else > >>that the #player check is made here? > >> > >>-- > >>ROM mailing list > >>[email protected] > >>Unsubscribe here ->>>http://www.rom.org/cgi- > >>bin/mailman/listinfo/rom > > -- > ROM mailing list > [email protected] > Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom > -- ROM mailing list [email protected] Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom