FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.73k stars 402 forks source link

Annoying "Access to the path is denied" red warnings when browsing files #14225

Closed Regalis11 closed 4 weeks ago

Regalis11 commented 3 months ago

Discussed in https://github.com/FakeFishGames/Barotrauma/discussions/14223

Originally posted by **SomeRandomNoobKekeke** June 27, 2024 ### Disclaimers - [X] I have searched the issue tracker to check if the issue has already been reported. - [ ] My issue happened while using mods. ### What happened? Game throws a lot of those warnings when browsing files, each time you step inside a folder with readonly files, e.g. when searching thumbnail for a mod or "load texture" in sub or character editor https://github.com/FakeFishGames/Barotrauma/discussions/13935#discussioncomment-9351763 ### Reproduction steps Go to sub editor Shift + rmb add image cilck on different folders / root disks Some might even actually crash the game ### Bug prevalence Happens every time I play ### Single player or multiplayer? Single player ### - _No response_ ### Version v1.5.9.1 (Summer Update Hotfix 2) ### - _No response_ ### Which operating system did you encounter this bug on? Windows ### Relevant error messages and crash reports Red warnings: ``` Cannot get directories at "C:/Users/user/Application Data": unauthorized access. The folder(s) might be read-only! {Access to the path 'C:\Users\user\Application Data' is denied.} at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound) at System.IO.Enumeration.FileSystemEnumerator`1.Init() at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized) at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options) at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options) at System.IO.Directory.GetDirectories(String path, String searchPattern, EnumerationOptions enumerationOptions) at System.IO.Directory.GetDirectories(String path, String searchPattern, SearchOption searchOption) at Barotrauma.IO.Directory.GetDirectories(String path, String searchPattern, SearchOption searchOption) in \Barotrauma\BarotraumaShared\SharedSource\Utils\SafeIO.cs:line 293 ``` Sometimes game even crashes if i click disk g for example ``` Exception: The directory name 'G:/' does not exist. (Parameter 'path') (System.ArgumentException) Target site: Void CheckPathValidity(System.String) Stack trace: at System.IO.FileSystemWatcher.CheckPathValidity(String path) at System.IO.FileSystemWatcher..ctor(String path) at Barotrauma.FileSelection.set_CurrentDirectory(String value) in \Barotrauma\BarotraumaClient\ClientSource\GUI\FileSelection.cs:line 88 at Barotrauma.FileSelection.<>c.b__28_0(GUIComponent child, Object userdata) in \Barotrauma\BarotraumaClient\ClientSource\GUI\FileSelection.cs:line 200 at Barotrauma.GUIListBox.Select(Int32 childIndex, Force force, AutoScroll autoScroll, TakeKeyBoardFocus takeKeyBoardFocus, PlaySelectSound playSelectSound) in \Barotrauma\BarotraumaClient\ClientSource\GUI\GUIListBox.cs:line 1068 at Barotrauma.GUIListBox.UpdateChildrenRect() in \Barotrauma\BarotraumaClient\ClientSource\GUI\GUIListBox.cs:line 788 at Barotrauma.GUIListBox.Update(Single deltaTime) in \Barotrauma\BarotraumaClient\ClientSource\GUI\GUIListBox.cs:line 908 at Barotrauma.GUI.Update(Single deltaTime) in \Barotrauma\BarotraumaClient\ClientSource\GUI\GUI.cs:line 1262 at Barotrauma.GameMain.Update(GameTime gameTime) in \Barotrauma\BarotraumaClient\ClientSource\GameMain.cs:line 967 at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime) in \Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 656 at Microsoft.Xna.Framework.Game.Tick() in \Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 500 at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() in \Libraries\MonoGame.Framework\Src\MonoGame.Framework\SDL\SDLGamePlatform.cs:line 93 at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in \Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 397 at Microsoft.Xna.Framework.Game.Run() in \Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 367 at Barotrauma.Program.Main(String[] args) in \Barotrauma\BarotraumaClient\ClientSource\Program.cs:line 61 ```
Regalis11 commented 3 months ago

Addressed in https://github.com/FakeFishGames/Barotrauma-development/pull/5533

Rokvach commented 4 weeks ago

Got this when I tried ot access a folder which requires admin priviliges to access, didn't create a crash report, compared to the current Unstable build you are able to enter that folder but it just throws errors.

image

Regalis11 commented 4 weeks ago

Merged, closing