Skip to content

DestroyCampaignDatabase not destrying the database

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.

Comments

  • SherincallSherincall Member Posts: 387
    Windows strings are not case sensitive, but linux ones are. Probably best to always name your databases in lowercase.
  • pscythepscythe Member Posts: 116
    Would permissions have anything to do with it?
  • SherincallSherincall Member Posts: 387
    Possibly, but I doubt it. I've seen a lot of case sensitivity issues between linux and windows databases. Such as that windows uses uppercase extension, and linux uses lowercase, etc.
  • JapualtahJapualtah Member Posts: 165
    edited June 2018
    First script: SetCampaignInt("abcd", "dcba", 4);

    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.
    Post edited by Japualtah on
  • JapualtahJapualtah Member Posts: 165
    Posted this as a bug report but either my question makes no sense or nobody cares :)
  • JapualtahJapualtah Member Posts: 165
    Well, I guess at this point it's safe to assume the NWN:EE project is abandonned and we're again on our own. My 22 days old bug report is still open as new and will remain so forever :)

    It's ok, NWN has been improved greatly and we're set for a long journey again, all is fine :wink:
  • JapualtahJapualtah Member Posts: 165
    Well, I was wrong, the bug is now acknowledged and will hopefully be fixed in next patch.

    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.
  • JapualtahJapualtah Member Posts: 165
    Warning: this doesn't work.
    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.
  • pscythepscythe Member Posts: 116
    Have you tried storing your databases on a NTFS partition then mount it with NTFS-lower, which will always convert filenames to lowercase automatically?
  • JapualtahJapualtah Member Posts: 165
    This is way too low level stuff for me, reason why I'm using Bioware's database system and not NWNX, I don't understand the beginning of the first installation command :)
  • pscythepscythe Member Posts: 116
    edited July 2018
    If you can hack a cron script surely you can handle create a lower-NTFS partition or NWNX :smile:

  • JapualtahJapualtah Member Posts: 165
    Well, I guess I could, hehe, probably can't be arsed, I'm alone to work on our 15 years old PW which used to host close to 100ppl at it's glory time and working countless hours atm to bring it up to par with modern standards, so every second counts :)

    I appreciate you taking the time to reply to this topic though, it's good to meet people who care.
Sign In or Register to comment.