View Issue Details

IDProjectCategoryView StatusLast Update
0003739The Dark ModCodingpublic29.04.2016 18:50
ReporterSteveL Assigned Totaaaki  
PrioritynormalSeveritynormalReproducibilityalways
Status resolvedResolutionfixed 
Product VersionTDM 2.02 
Target VersionTDM 2.04Fixed in VersionTDM 2.04 
Summary0003739: dmap fails to delete pointfile
Descriptiondmap is not deleting old pointfiles.

This has come up twice in the last couple of weeks in questions from new mappers.
Steps To ReproduceOpen up a leak, dmap, fix the leak, dmap. The .lin file will still be there.

Additional InformationIncorrect path to the .lin file is being generated in idFileSystemLocal::RemoveFile(), FileSystem.cpp line 808.

With fms/test installed in TDM:
Instead of darkmod/maps/test.lin, generated paths are darkmod/test/maps/test.lin and darkmod/fms/test/maps/test.lin
Instead of darkmod/fms/test/maps/t.lin, generated paths are darkmod/test/fms/test/maps/t.lin and darkmod/fms/test/fms/test/maps/t.lin

This also affects an attempt to remove a .reg file, whatever that is.

Likely related to 0003115 which fixed the path where the file got written.

TagsNo tags attached.

Relationships

related to 0003115 resolvedtaaaki .lin (pointfile) cannot be written if maps/ does not exist 

Activities

SteveL

SteveL

31.05.2014 04:09

reporter   ~0006644

Last edited: 31.05.2014 04:31

idFileSystemLocal::RemoveFile is used in 9 places in the engine, including the two places mentioned above where I've confirmed it broken:

darkmod_src\framework\async\AsyncClient.cpp(1772): fileSystem->RemoveFile( name );
darkmod_src\framework\async\AsyncClient.cpp(1872): fileSystem->RemoveFile( dlList[ 0 ].filename ); // the cache is cleared when calling OpenFileWrite and RemoveFile
darkmod_src\framework\Session_menu.cpp(383): fileSystem->RemoveFile( va("savegames/%s.save", loadGameList[choice].c_str()) );
darkmod_src\framework\Session_menu.cpp(384): fileSystem->RemoveFile( va("savegames/%s.tga", loadGameList[choice].c_str()) );
darkmod_src\framework\Session_menu.cpp(385): fileSystem->RemoveFile( va("savegames/%s.txt", loadGameList[choice].c_str()) );
darkmod_src\sound\snd_world.cpp(700): fileSystem->RemoveFile( aviDemoPath + "channel_right.raw" );
darkmod_src\sound\snd_world.cpp(701): fileSystem->RemoveFile( aviDemoPath + "channel_left.raw" );
darkmod_src\tools\compilers\dmap\dmap.cpp(316): fileSystem->RemoveFile( path );
darkmod_src\tools\compilers\dmap\dmap.cpp(326): fileSystem->RemoveFile( path );

taaaki

taaaki

01.06.2014 21:39

administrator   ~0006648

Can you provide the values for fs_devpath, fs_currentfm, and fs_modSavePath. In the console, type fs_<tab> to get the current values.

In my testing, these appear to work correctly. You just have to be careful with what you set devpath and currentfm to.

For this example: darkmod/maps/test.lin :
Make sure that you uninstall the current mission.

For darkmod/fms/test/maps/t.lin :
+set fs_devpath <path to darkmod>\fms\test +set fs_currentfm test
SteveL

SteveL

01.06.2014 22:07

reporter   ~0006649

fs_modSavePath = "E:\dm-dev\darkmod/fms"
    fs_searchAddons = "0"
    fs_caseSensitiveOS = "0"
    fs_currentfm = "test"
    fs_mod = "darkmod"
    fs_devpath = "E:\dm-dev\darkmod"
    fs_savepath = "E:\dm-dev\darkmod"
    fs_basepath = "E:\dm-dev\darkmod"
    fs_debug = "0

NB This is my debug build. I've never knowingly set any of the above except for fs_currentfm occasionally. Are we supposed to tweak those params manually, or does the game do it when you install a mission?
taaaki

taaaki

02.06.2014 04:09

administrator   ~0006650

Hmm, there does appear to be a slight issue with RemoveFile, since this should have worked without any changes: darkmod/fms/test/maps/t.lin to those cvars

Players shouldn't have to explicitly set any of those as they get configured on game startup and when a mission is "installed" (sets fs_currentfm). Modifying fs_devpath is typically used when you want to have a WIP directory outside your TDM directory tree (to ensure that it doesn't get nailed by accident).

Will have another look at the RemoveFile implementation and see if I can make it more robust.
SteveL

SteveL

02.06.2014 16:21

reporter   ~0006651

Cheers. Just to confirm, I've never set fs_devpath and I installed "test" using the menus, not by some quirky developer method, so it *should* find the file.
grayman

grayman

03.01.2016 18:11

viewer   ~0007950

There's been no activity on this in 1.5 years.

Any chance it's going to be fixed in the next 2 months?
taaaki

taaaki

03.01.2016 20:52

administrator   ~0007959

Will make an effort to get this sorted out. Poke in a 2-3 weeks if there's still no update.
grayman

grayman

03.01.2016 21:14

viewer   ~0007960

Will do. Thx.
taaaki

taaaki

11.04.2016 20:39

administrator   ~0008090

I've made some headway with this issue. Will hopefully have the fix committed soon.
taaaki

taaaki

12.04.2016 20:13

administrator   ~0008095

Potential fix committed in darkmod_src revision 6579. Due to changes in the dmap function, the relative path sent into the RemoveFile function was no longer appropriate. The RemoveFile function was extended to support this use-case.

The other uses of the function should be unaffected (and don't think they were affected by this bug anyway due to the actual cause being the changes to the dmap paths). I tested the savegame delete and it still seems to work.
taaaki

taaaki

12.04.2016 20:15

administrator   ~0008096

Fix committed as described in previous note. I haven't committed binaries the darkmod repo as of yet since I'd like to have someone else confirm that the fix works as expected.
SteveL

SteveL

14.04.2016 17:55

reporter   ~0008099

Confirmed the fix works for removing a .lin file, both one installed in the /fms folder and one in the main darkmod/maps folder

The second of the two generated paths for an installed mission is incorrect: E:\dm-dev\darkmod\fms\fms\test\maps\testRemoveLin.lin

But that's probably not a problem... it looks like mop-up code there for a reason that I haven't spotted. The first path takes care of it in both cases, and the second path kind of makes sense when you have no mission installed at all. It ends up pointing to the main /fms/mapname folder.
taaaki

taaaki

26.04.2016 21:28

administrator   ~0008120

Minor improvement committed in darkmod_src revision 6585. I've added a check after the first removal attempt to see if it was successful or not. If not, it tries the mop-up code.

For dmap, most use cases should be catered for by the first removal attempt due to changes in the dmap function. The second removal attempt (mop-up code) handles other uses of the RemoveFile function, such as deletion of savegame files.

I do not think that the erroneous file paths should be problem as these paths do not exist and the remove call will silently fail in these cases.
SteveL

SteveL

29.04.2016 18:50

reporter   ~0008123

> I do not think that the erroneous file paths should be problem

Agreed. Belt-and-braces approach.

Issue History

Date Modified Username Field Change
31.05.2014 04:06 SteveL New Issue
31.05.2014 04:06 SteveL Status new => assigned
31.05.2014 04:06 SteveL Assigned To => SteveL
31.05.2014 04:09 SteveL Note Added: 0006644
31.05.2014 04:11 SteveL Additional Information Updated
31.05.2014 04:12 SteveL Relationship added related to 0003115
31.05.2014 04:13 SteveL Assigned To SteveL =>
31.05.2014 04:14 SteveL Status assigned => new
31.05.2014 04:15 SteveL Additional Information Updated
31.05.2014 04:31 SteveL Note Edited: 0006644
31.05.2014 04:46 SteveL Additional Information Updated
31.05.2014 09:17 taaaki Assigned To => taaaki
31.05.2014 09:17 taaaki Status new => assigned
01.06.2014 21:39 taaaki Note Added: 0006648
01.06.2014 22:07 SteveL Note Added: 0006649
02.06.2014 04:09 taaaki Note Added: 0006650
02.06.2014 16:21 SteveL Note Added: 0006651
08.12.2014 19:04 grayman Target Version TDM 2.03 => TDM 2.04
03.01.2016 18:11 grayman Note Added: 0007950
03.01.2016 20:52 taaaki Note Added: 0007959
03.01.2016 21:14 grayman Note Added: 0007960
11.04.2016 20:39 taaaki Note Added: 0008090
12.04.2016 20:13 taaaki Note Added: 0008095
12.04.2016 20:15 taaaki Note Added: 0008096
12.04.2016 20:15 taaaki Status assigned => resolved
12.04.2016 20:15 taaaki Fixed in Version => TDM 2.04
12.04.2016 20:15 taaaki Resolution open => fixed
12.04.2016 20:15 taaaki Assigned To taaaki => SteveL
13.04.2016 14:55 SteveL Status resolved => feedback
13.04.2016 14:55 SteveL Resolution fixed => reopened
14.04.2016 17:55 SteveL Note Added: 0008099
14.04.2016 17:55 SteveL Status feedback => assigned
14.04.2016 17:56 SteveL Assigned To SteveL => taaaki
14.04.2016 17:56 SteveL Status assigned => feedback
26.04.2016 21:28 taaaki Note Added: 0008120
26.04.2016 21:28 taaaki Status feedback => resolved
26.04.2016 21:28 taaaki Resolution reopened => fixed
29.04.2016 18:50 SteveL Note Added: 0008123