From sik.the.hedgehog at gmail.com Thu Jan 1 23:11:15 2015 From: sik.the.hedgehog at gmail.com (Sik the hedgehog) Date: Fri, 2 Jan 2015 01:11:15 -0300 Subject: [physfs] How to check if some files got overriden? Message-ID: I'm using PhysicsFS mounting to implement mods in my game (where a mod is just an archive that overrides those in the game). I need a way to check if some of those get altered when I add a mod though (to disable saving, otherwise the savegame could become invalid). More specifically, I need to see if the archive: - Contains system/scenes - Contains system/tweaks.ini - Contains levels/*.sol How can I check this? I would do the check every time I mount a mod (not after mounting all of them), if this helps. From indy at driftsolutions.com Fri Jan 2 01:39:43 2015 From: indy at driftsolutions.com (Indy Sams) Date: Fri, 2 Jan 2015 01:39:43 -0500 Subject: [physfs] How to check if some files got overriden? In-Reply-To: References: Message-ID: <1584795287.20150102013943@driftsolutions.com> Hello Sik, You can try PHYSFS_getRealDir, but a better way may be to store a hash of the relevant files or a unique string defined by the mod in your save files so people can still save even with mods and it will only load games that match the current mod. Best regards, Indy Sams mailto:indy at driftsolutions.com Thursday, January 1, 2015, 11:11:15 PM, you wrote: Sth> I'm using PhysicsFS mounting to implement mods in my game (where a mod Sth> is just an archive that overrides those in the game). I need a way to Sth> check if some of those get altered when I add a mod though (to disable Sth> saving, otherwise the savegame could become invalid). More Sth> specifically, I need to see if the archive: Sth> - Contains system/scenes Sth> - Contains system/tweaks.ini Sth> - Contains levels/*.sol Sth> How can I check this? I would do the check every time I mount a mod Sth> (not after mounting all of them), if this helps. Sth> _______________________________________________ Sth> physfs mailing list Sth> physfs at icculus.org Sth> http://icculus.org/mailman/listinfo/physfs From sik.the.hedgehog at gmail.com Fri Jan 2 02:44:06 2015 From: sik.the.hedgehog at gmail.com (Sik the hedgehog) Date: Fri, 2 Jan 2015 04:44:06 -0300 Subject: [physfs] How to check if some files got overriden? In-Reply-To: <1584795287.20150102013943@driftsolutions.com> References: <1584795287.20150102013943@driftsolutions.com> Message-ID: 2015-01-02 3:39 GMT-03:00, Indy Sams : > You can try PHYSFS_getRealDir, but a better way may be to store a hash > of the relevant files or a unique string defined by the mod in your save > files so people can still save even with mods and it will only load > games that match the current mod. If you specify a new save filename in your own system/tweaks.ini then the game will use that instead. The check is for mods that can potentially corrupt the savegame but don't provide their own filename (i.e. it's a safety check). I thought about the hash thing, although that'd work mostly for system/scenes and system/tweaks.ini (i.e. the two files), I'd still need to see what's the deal with levels/*.sol (since it can be either overwriting the current levels *or* adding new ones). But um, I guess that adding new levels won't help if system/scenes isn't overwritten as well (that file contains the level list), so I could just look at the current scene list and see if those levels got overwritten.