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?