Just to inject another bonus of databases (not to knock flat files at all), but things like what's being proposed here (and I used to have something similar to check pfiles for a certain player_id) are very expensive as far as system resources are concerned... in order for the OS to load the directory listing and then cycle through file by file and read the contents of each one until it finds the race (or whatever) line, it uses a good amount of both CPU and hard drive operations, especially if you have a large player base, and of course how often it's called... one definite advantage of a database system is being able to query for something like:
UPDATE char_data SET race='human' WHERE race='dwarf' If you're deleting the dwarf race and want to default them back to human, or of course, to take any race arguments you could simply use: UPDATE char_data SET race='%s' WHERE race='%s' And pass the race to default to and the race that's being deleted... On a side note, I really didn't realize how many useful things one could implement into a mud once they switched away from flat files over to a database backend, and thinking about it now, there really aren't any good tutorials or snippets for this, perhaps I should release my own implementation as a snippet *pondering*... Richard Lindsey -----Original Message----- From: Chad Simmons [mailto:[EMAIL PROTECTED] Sent: Friday, January 28, 2005 3:31 PM To: Tristan M Cc: [email protected] Subject: Re: dirent.h in windows You need to pass the appropriate linker arguments to tell the compiler to link with whichever library contains those functions. Alternatively you could store your player data in a database and you'd have a platform independant way to access and update your information. Both mysql and postgreSQL are available for windows. --- Tristan M <[EMAIL PROTECTED]> wrote: > im using msvc++ and what i want to do is be able to scan through every > player file and check if they are a certain race, and if so, change it(for > deleting races in my online race editor). im good as far as dirent.h is > concerned. after some googling i came across a dirent.h/dirent.lib for a > windows machine, so i've popped them in theyre appropriate places: > C:\Program Files\Microsoft Visual Studio\VC98\Include > C:\Program Files\Microsoft Visual Studio\VC98\Lib > so now i can do: > #include <dirent.h> > without the compiler hissing at me, but now when i want to use the > closedir/readdir/opendir functions in the code the compiler tells me this: > olc_race.obj : error LNK2001: unresolved external symbol _closedir > olc_race.obj : error LNK2001: unresolved external symbol _readdir > olc_race.obj : error LNK2001: unresolved external symbol _opendir > > ive never added include or lib files to msvc++ before so am i forgetting a > step or anything here? i know that closedir, readdir, and opendir are all in > the dirent.h and that it was meant for windows > > > -- > ROM mailing list > [email protected] > http://www.rom.org/cgi-bin/mailman/listinfo/rom > ===== -----BEGIN GEEK CODE BLOCK----- Version 3.1 GCS/L/C/O d-(+) s++: a-- C+++$>++++ UBLS++++$ P+++(--)$ L+++>++++ E--- W+>++$ N !o K? w(--) !O M- !V PS+ PE(++) Y+ PGP->+ t+ 5 X+() R(+) tv+@ b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++ ------END GEEK CODE BLOCK------ __________________________________ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 -- ROM mailing list [email protected] http://www.rom.org/cgi-bin/mailman/listinfo/rom

