Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    tritonas00
    @tritonas00
    after this operation the file remains readonly, strangely only on Windows, On Linux permissions kept intact
    we create an in game repository manager and we want to be able to delete mods also
    tritonas00
    @tritonas00
    as long as we don't update the cache (above operation) we can download/remove mods fine
    but, lets say we download a mod, update cache so the mod can be available in game, and re open the repository panel, we can't remove it if we want because of read only permissions
    That happens only on Windows, strangely
    I'm an amateur coder, and my English not so good, so i can demonstrate the issue with a video if that helps
    tritonas00
    @tritonas00
    as soon as this https://github.com/RigsOfRods/rigs-of-rods/blob/master/source/main/resources/CacheSystem.cpp#L972 involve, the zip file remains locked as read only, until we close the game
    tried ResourceGroupManager::getSingleton().addResourceLocation(path, "Zip", RGN_TEMP, false, false) but got segfault
    tritonas00
    @tritonas00
    I'm testing on Windows 10, in vbox
    tritonas00
    @tritonas00
    here is a video with the issue
    tritonas00
    @tritonas00
    isn't destroyResourceGroup enough to release the file?
    It works fine on Linux at least
    SNiLD
    @SNiLD
    linux doesn't lock files like windows does
    tritonas00
    @tritonas00
    hmm
    SNiLD
    @SNiLD
    in linux you can delete file even if some other process is using it, but that's not possible in windows (i'm not 100% certain if this changed in windows 11, but at least since windows 95 up to 10)
    tritonas00
    @tritonas00
    Ok that makes sense
    SNiLD
    @SNiLD
    (here raymond talks about related issue: https://devblogs.microsoft.com/oldnewthing/20220125-00/?p=106194 )
    tritonas00
    @tritonas00
    only deletion is affected though? because i can re-download, null it or anything
    SNiLD
    @SNiLD
    afair you can't rename the file either
    tritonas00
    @tritonas00
    i see
    tritonas00
    @tritonas00
    Ok thank you all very much for the info, really helpful, i will take the issue to our leader dev
    Pavel Rojtberg
    @paroj
    I think ArchiveManager::unload will solve the issue by closing the zip file.
    tritonas00
    @tritonas00
    Indeed! Thank you!
    Pavel Rojtberg
    @paroj
    added it to removeResourceLocation, to make usage more straightforward: OGRECave/ogre#2372
    tritonas00
    @tritonas00
    Nice!
    i use Ogre::FileSystemLayer::removeFile btw, should i go with Ogre::ResourceGroupManager::getSingleton().deleteResource ? are they both unicode safe?
    Pavel Rojtberg
    @paroj
    only the first one deletes files
    tritonas00
    @tritonas00
    Sorry for bothering again, but unload seems to create another issue
    Got segfault when trying to read a previously unloaded zip, which makes sense. But tried Ogre::ArchiveManager::load, after the file is downloaded still no luck
    Here is a vid with the issue
    Pavel Rojtberg
    @paroj
    please provide a stacktrace
    tritonas00
    @tritonas00
    Thread 1 "RoR" received signal SIGSEGV, Segmentation fault.
    0x00007ffff78ef727 in Ogre::ResourceGroupManager::openResourceImpl (this=0x555555c792c0, resourceName="a1da0UID-nhelens.terrn2", groupName="General", searchGroupsIfNotFound=searchGroupsIfNotFound@entry=false, resourceBeingLoaded=resourceBeingLoaded@entry=0x0, throwOnFailure=true) at /home/babis/Downloads/ror-dependencies/Source/ogre/OgreMain/src/OgreResourceGroupManager.cpp:695
    695                DataStreamPtr stream = pArch->open(resourceName);
    (gdb) bt
    #0  0x00007ffff78ef727 in Ogre::ResourceGroupManager::openResourceImpl (this=0x555555c792c0, resourceName="a1da0UID-nhelens.terrn2", 
        groupName="General", searchGroupsIfNotFound=searchGroupsIfNotFound@entry=false, resourceBeingLoaded=resourceBeingLoaded@entry=0x0, 
        throwOnFailure=true) at /home/babis/Downloads/ror-dependencies/Source/ogre/OgreMain/src/OgreResourceGroupManager.cpp:695
    #1  0x000055555598caea in Ogre::ResourceGroupManager::openResource (throwOnFailure=true, resourceBeingLoaded=0x0, groupName=..., 
        resourceName="a1da0UID-nhelens.terrn2", this=<optimized out>)
        at /home/babis/Downloads/ror-dependencies/Dependencies_Linux/include/OGRE/OgreResourceGroupManager.h:668
    #2  RoR::TerrainManager::LoadAndPrepareTerrain (entry=entry@entry=0x55555806f2e0)
        at /home/babis/Downloads/ror-dependencies/rigs-of-rods/source/main/terrain/TerrainManager.cpp:137
    #3  0x000055555562120a in RoR::GameContext::LoadTerrain (this=<optimized out>, filename_part="a1da0UID-nhelens.terrn2")
        at /home/babis/Downloads/ror-dependencies/rigs-of-rods/source/main/GameContext.cpp:114
    #4  0x00005555555ed2a2 in main (argc=<optimized out>, argv=<optimized out>)
        at /home/babis/Downloads/ror-dependencies/rigs-of-rods/source/main/main.cpp:516
    tritonas00
    @tritonas00
    strangely if i perform a full cache update, it works fine
    but it is a bit slow for too many mods
    tritonas00
    @tritonas00
    shouldn't Ogre::ArchiveManager::load do the job?
    tritonas00
    @tritonas00
    hmm actually it segfaults when loading any other mod also, not only the unloaded one
    Pavel Rojtberg
    @paroj
    did you call ResourceGroupManager::removeResourceLocation? on that archive? Otherwise the ResourceGroupManager is left with a dangling pointer after ArchiveManager::unload
    tritonas00
    @tritonas00
    it seems our resource groups were not properly cleared before pruning and updating the cache
    thanks for the help again!
    Neonit
    @Neonit
    In the context of an Ogre-Next 2.3.0 static build, when using the shipped CMake modules for finding Ogre and dependencies, am I supposed to set all the dependencies' XXX_HOME environment variables manually? I'm currently browsing through the CMake code and up to now don't see another way how Ogre could find it.
    3 replies
    Even though I specified the deps path on compilation of Ogre so I initially thought it would cleverly save that for finding the deps later.
    Neonit
    @Neonit
    Another thing: I'm experiencing Ybalrid/BtOgre2#17, while I shouldn't, because it has been fixed long ago. However, $OGRE_HOME/include/OGRE/Hlms/Common is not in my include paths, although I've added OGRE_INCLUDE_DIRS, OGRE_HlmsPbs_INCLUDE_DIRS and OGRE_HlmsUnlit_INCLUDE_DIRS.
    Steven Gann
    @StevenGann
    A couple devs on my team are insisting on using vcpkg for all dependencies, but I noticed the Ogre vcpkg package is 2 years out of date. Will this be updated in the future or should I switch to adding the library manually?
    Steven Gann
    @StevenGann
    Alright, so I'm new to vcpkg myself and just discovered it isn't like NuGet or npm where you upload a package someplace. Never mind, then! Regardless, thanks for the hard work that's gone into Ogre. I'm really enjoying working with it.
    SNiLD
    @SNiLD
    yeah, we build Ogre with vcpkg as well, you can just replace the REF from portfile yourself to get the exact version of ogre you want