Cinquero wrote:- Code: Select all
+ fn = strcat("data/scores.db/", other.netname, ".dat");
+ ServerConsoleEcho(strcat(" fn = ",fn),TRUE);
+ fh = fopen ( fn, FILE_READ );
+ ServerConsoleEcho(strcat(" fh = ",ftos(fh)),TRUE);
1) All new files will be created in .nexuiz/data/data/ (for security reasons, otherwise qc code would be able to overwrite default.cfg or do other nasty things).
2) You don't need to prepend data/, all file operations are relative to Nexuiz/data/.
3) Using other.netname in the filename is a bad idea, it might contain characters that are not allowed on the server's filesystem.
4) ServerConsoleEcho(strcat(" fn = ",fn),TRUE); <-- that command will most definitely mess up all your tempstrings. Either strzone() (see
http://www.quakesrc.org/tutorials/old/142 for an explanation) your filename or don't use ServerConsoleEcho().
You should use ServerConsoleEcho(s, TRUE) only for "untrusted" strings that might contain characters like \n, \r or ". For anything else it's better to use ServerConsoleEcho(s, FALSE) (it's much faster and won't mess up tempstrings) . If it's just for debugging, use dprint() and set "developer 1" on your testserver.