Ok, this is really bugging me, i can use the exe that comes with one of many smaug source's, even ones that say they are from VC++, and my players can quit and come back and have their equipment, but as soon as i do a recompile, not changing anything in the source files, players loose their equipment when they log off, this goes for titles, prompts, and about anything else that gets set, including the room they where in when they quit. This even happens if i save and then quit. Any help would be awsome, thanks in advance!
Player files not saving after an error free re-compile
Posted by Grymlar on Wed 10 Dec 2003 11:56 PM — 13 posts, 31,717 views.
Sounds like your paths aren't set correctly, or something like that. If the binary exe works fine but the paths don't, sounds like you're either not starting from the proper directory, or not read/writing from the right spot.
Do player files read, just not write again? When they lose their equipment, does it go back to what it was when they came, or is it all gone?
Do player files read, just not write again? When they lose their equipment, does it go back to what it was when they came, or is it all gone?
This happened to me on a Smaug windows. I never did fix it, and it happened everytime a player quit. I don't know what caused it. Perhaps it was a permission error.
well the thing is, the exe that comes with the distribution files saves things just fine, but when i make a new exe, and i'm not changing anything to the source code, it stops saving player files correctly, and i get this error message when players are connecting.
[*****] FILE: ../player/r/Rastlain LINE: 49
[*****] BUG: Fread_obj: incomplete object.
But if i use the exe that comes with the distribution these objects save fine, and my player's load fine.
[*****] FILE: ../player/r/Rastlain LINE: 49
[*****] BUG: Fread_obj: incomplete object.
But if i use the exe that comes with the distribution these objects save fine, and my player's load fine.
Well, looks like the file saving format changed between the precompiled .exe and the .exe you compiled. If your compiled version can't read object files, something is going very wrong somewhere, and chances are it's not the distribution's fault.
Have you looked at the line it's reporting?
Have you looked at the line it's reporting?
Ok, i am guessing the line it is reporting is in my character file. line 49 is a blank line in between 'end' for the object and the #END for the character file. But, it reads the exact same file and saves to it ok when i use the 'stock' exe that comes with the distribution, and i've tried 5 different popular downloads, same version, 1.4a, but from different sources. And i'm pretty new to C++ so i dont know exactly where to even start looking in the server code. Another thing is the 'stock' exe is 2.1mb, the one that is compiled is only 1.6mb, so is there a bunch of stuff being left out? I'm loading up the makefile, and doing a clean make, then compiling the exe.
oh, and it seems to read the object files just fine, they stay in the area files, and are still setup correctly, its just player files arent being saved, custom titles, bamfin and bamfout, carried and equiped items, the room they where in when they quit, basicly everything, and i got waitforauth set to 0 and they still dont auto advance to lvl 2 upon creation, hope this info helps, i'm at a total loss, like i said i'm pretty new to C++.
What system are you running on? What are you compiling with?
I meant that if the compiled version can't read objects in player files, then something is wrong; not just object files.
Have you read up on documents that explain how to compile and all that?
I meant that if the compiled version can't read objects in player files, then something is wrong; not just object files.
Have you read up on documents that explain how to compile and all that?
I'm using win2000 proffesional and my compiler is VC++ 6.0, and i'm not getting any errors on the compile, i am getting one error, but it dosnt seem to be something that would affect this, it looks like this
D:\smaug\dist\src\stat_obj.c(147) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
all on one line of course, and stat_obj.c line 147 in my source file is
#undef TODUB(x)
its the second to last line in stat_obj.c but as i said its not just objects the player files arent saving, its basicly the whole player file, although the error upon logging on the server window is displaying shows that its pointing to the right directory, otherwise it would say player dosnt exist, right?
D:\smaug\dist\src\stat_obj.c(147) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
all on one line of course, and stat_obj.c line 147 in my source file is
#undef TODUB(x)
its the second to last line in stat_obj.c but as i said its not just objects the player files arent saving, its basicly the whole player file, although the error upon logging on the server window is displaying shows that its pointing to the right directory, otherwise it would say player dosnt exist, right?
no errors, i am getting one warning, sorry.
ok, i think i might have found it, i have smaug running "stock" (no re-compile just the exe that came with it) on drive D, and on drive C i got the one i recompiled running. I opened up a character file from each of them in word, so i could get a line count. The one that works, saves items and reloads player files has 50 lines, with line 49, the problimatic line on the other one being a blank line. On the one that dosnt load correctly, or save player files seemingly at all, line 49 is
end
this is becuase there is a line right before that that is
Values 5 5 0 0 0 0
and the values line isnt in the player file from the server that seems to be running correctly, and i am guessing it dont need to know the values of an object since it can look them up using the vnums, correct? So this means i need to locate where in save.c it is writing this line and take it out?
end
this is becuase there is a line right before that that is
Values 5 5 0 0 0 0
and the values line isnt in the player file from the server that seems to be running correctly, and i am guessing it dont need to know the values of an object since it can look them up using the vnums, correct? So this means i need to locate where in save.c it is writing this line and take it out?
Sounds like you are combining problems, sorry exes, here, but one possibility is that you don't have all the correct directories set up. Search this forum, there are quite a few posts about problems saving characters.
Hmm, ok, guess i downloaded and tried every zip file i could find except the ones from here, i installed the server, got myself up and going, gave myself some items, and then installed the source code, re-compiled it, ran that exe, and everything still works :) Thanks! the friends i'm building this mud with will be happy, they like me are long time mudders, i just happen to have a small bit of knowladge of coding, so i'm in charge of the server, i've installed snippets and such before, must have been using this set of code, thanks for the help, much appriciated!