I've started up a dev port for my MUD. It's an entire new dir, of course. So I started to clean out all the pfiles by using rm. Delete all pfiles under a, for example. Did a reboot. Yet... all characters could still be logged on/loaded up. Er, why?
Dev port: pfiles
Posted by Zeno on Sat 15 Jul 2006 07:18 PM — 16 posts, 65,071 views.
Is it possible that the other is getting the pfiles from the other mud? you could test that you know, but I donno prolly not the reason. Thats just odd though.
The startup script has a hard-coded directory location to the area directory, and it change-dirs to there. Also mud.h might have the home path coded in, from which all the other paths (e.g. where players are stored) are derived. I would check both of those and make sure they point to the right place.
Start it up under gdb, put a breakpoint on the line that loads the pfile, and see what the path is. You might also try to find where it derives that path.
Bad day. I ran the pfile cleaner on the dev port and it was somehow running under the normal MUD. I checked all the paths in mud.h, and they're all ../ so I have no idea why it's still running in the real MUD...
Did you check the startup script? I know that mine makes explicit reference to the location, i.e.
/home/darkstone/mud and change-dirs to HOME/area before running ../src/darkstone.
Looks fine.
etc.
cd ../area
../src/biyg $port >&! $logfileetc.
How are you starting up the MUD? I setup a build port and made a command that would boot our bport while logged into the main port so imms could start it up whenever they needed... only thing is, the startup script would automatically run everything from the main port because that's the directory it was seeing (even though the path I specified in the code to the startup script was correct).
Try changing your startup script to reflect the actual path of where you want it to go...
cd ~/<dev folder>/area
../src/biyg $port >&! $logfile
Try changing your startup script to reflect the actual path of where you want it to go...
cd ~/<dev folder>/area
../src/biyg $port >&! $logfile
Not sure, but doesn't SMAUG auto-restore backed up pfiles if they're missing? Check your backup dir.
I'm starting it by running the startup script in the dev directory. It shouldn't be running in the other directory, but did. Need to find out why.
When you start it like Tzaro suggested, does that get the right pfiles? If it does, then it's something wrong with the startup script; if it doesn't, then it's something in the code.
I don't think it had the right pfiles. But it didn't have the right area files either. I had edited a helpfile on the dev port using hedit, and the normal MUD was edited instead of the dev port.
So this is even when you cd to devport/area, and run ../src/executable?
Then you've got some paths lying around in your source somewhere. I guess you'd have to grep for them and find where they're hiding -- they've got to be in there somewhere.
Then you've got some paths lying around in your source somewhere. I guess you'd have to grep for them and find where they're hiding -- they've got to be in there somewhere.
Argh, wait. Just double checked. Running the exec seems to run in the correct dir. Running the startup script seems to run not in the dev dir, instead in the normal MUDs dir.
I think I got it. Part of the backup line was going back to the wrong dir. Silly me.
On a related note, I want to have a flag in the Makefile to tell it's the dev port, used to have ifchecks in the code. Can this be done? I plan to copy files over from the dev port when code is finished, but don't want to copy stuff for the dev port (like the webserver is off for dev).
I think I got it. Part of the backup line was going back to the wrong dir. Silly me.
On a related note, I want to have a flag in the Makefile to tell it's the dev port, used to have ifchecks in the code. Can this be done? I plan to copy files over from the dev port when code is finished, but don't want to copy stuff for the dev port (like the webserver is off for dev).
you could do
append -DDEV to C_FLAGS
in your code
#ifdef DEV
bug( "yay! dev port" );
#else
bug( "boo! not dev port" );
#endif
(stuff in the #ifdef dev wont even be compiled like this)
append -DDEV to C_FLAGS
in your code
#ifdef DEV
bug( "yay! dev port" );
#else
bug( "boo! not dev port" );
#endif
(stuff in the #ifdef dev wont even be compiled like this)
You could get even fancier and have the same makefile for both the dev and normal port, and use some tricks to automatically determine where you are.
So, you could use something quite similar to have the shell script output "-DDEVPORT" or simply "" depending on what the current directory is.
Makefiles are fun... :-)
Quote:
[50] 12:03pm [haleyd@casqa1] ~/tmp/maketest > cat Makefile
FLAGS=`getflags.sh`
all:
@echo $(FLAGS)
[51] DING! [haleyd@casqa1] ~/tmp/maketest > cat getflags.sh
#!/bin/bash
if [[ `pwd` == *maketest* ]]; then
echo "whoopee, maketest"
else
echo "nope, not maketest"
fi
[52] 1:00pm [haleyd@casqa1] ~/tmp/maketest > gmake
whoopee, maketest
[53] 1:00pm [haleyd@casqa1] ~/tmp/maketest > cd ..
[54] 1:00pm [haleyd@casqa1] ~/tmp > cp -R maketest testmake
[55] 1:01pm [haleyd@casqa1] ~/tmp > cd testmake/
[56] 1:01pm [haleyd@casqa1] ~/tmp/testmake > make
nope, not maketest
[57] 1:01pm [haleyd@casqa1] ~/tmp/testmake >
So, you could use something quite similar to have the shell script output "-DDEVPORT" or simply "" depending on what the current directory is.
Makefiles are fun... :-)