DestroyCampaignDatabase not destrying the database
Japualtah
Member Posts: 165
Hi folks, DestroyCampaignDatabase works perfectly on Windows but does nothing on Linux, any clue?
If you think using NWNX would be better to avoid Bioware database all together, I somewhat agree but NWNX doesn't work on Windows which makes development awkward.
Unless you guys use a workaround, which I'd be delighted to hear about.
If you think using NWNX would be better to avoid Bioware database all together, I somewhat agree but NWNX doesn't work on Windows which makes development awkward.
Unless you guys use a workaround, which I'd be delighted to hear about.
0
Comments
Result in linux directory:
thierry@MyrdaServer:~/nwn/datadir/database$ ls -l
total 2744
-rw-rw-rw- 1 thierry thierry 3072 jun 4 10:08 abcd.cdx
-rw-rw-rw- 1 thierry thierry 640 jun 4 10:08 abcd.dbf
-rw-rw-rw- 1 thierry thierry 512 jun 4 10:08 abcd.fpt
Trying some chmodding:
thierry@MyrdaServer:~/nwn/datadir/database$ chmod 777 *
thierry@MyrdaServer:~/nwn/datadir/database$ ls -l
total 2748
-rwxrwxrwx 1 thierry thierry 3072 jun 4 10:08 abcd.cdx
-rwxrwxrwx 1 thierry thierry 640 jun 4 10:08 abcd.dbf
-rwxrwxrwx 1 thierry thierry 512 jun 4 10:08 abcd.fpt
Second script: DestroyCampaignDatabase("abcd");
Result in linux directory:
thierry@MyrdaServer:~/nwn/datadir/database$ ls -l
total 2744
-rwxrwxrwx 1 thierry thierry 3072 jun 4 10:08 abcd.cdx
-rwxrwxrwx 1 thierry thierry 640 jun 4 10:08 abcd.dbf
-rwxrwxrwx 1 thierry thierry 512 jun 4 10:08 abcd.fpt
I can't get it to work mate, have you successfully used DestroyCampaignDatabase on Linux?
If I'm doing something wrong, I really wonder what it is.
Cheers.
Edited for clarity.
It's ok, NWN has been improved greatly and we're set for a long journey again, all is fine
In the meanwhile, if anyone needs a temporary fix, here's a simple bash that I added to my databases backup crontab:
cd '~/.local/share/Neverwinter Nights/database'
rename "s/\.dbf$/.DBF/" *.dbf
rename "s/\.fpt$/.FPT/" *.fpt
rename "s/\.cdx$/.CDX/" *.cdx
The bug comes from the server code creating databases with lowercase file extensions but the same code trying to delete the same files with uppercase extensions.
This has gone under the radar for so long because everybody's using NWNX I guess.
Having a daily cron changing the file extensions so that DestroyCampaignDatabase can successfully delete the files once a day is enough to prevent the bloat.
Once the cron has changed the file extensions, the databases can indeed be destroyed but the server code can't read their content anymore, so it's back to square one.
And the recent update didn't fix the bug, so I'm back to creating new database files according the calendar and never destroying nor packing anything, this inelegant solution just prevents the bloat with starting fresh files every ingame year.
I appreciate you taking the time to reply to this topic though, it's good to meet people who care.