From 7a09d84cd2ef93c3d3f6275d76a2a35c010e06cc Mon Sep 17 00:00:00 2001 From: Lordfox Date: Sat, 4 Oct 2025 19:02:42 +0200 Subject: [PATCH] small care for bad filenames --- .../Modules/ConcurrentFlotsamAssetCache.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/OpenSimConcurrentFlotsamAssetCache/addon-modules/OpenSimConcurrentFlotsamAssetCache/Modules/ConcurrentFlotsamAssetCache.cs b/modules/OpenSimConcurrentFlotsamAssetCache/addon-modules/OpenSimConcurrentFlotsamAssetCache/Modules/ConcurrentFlotsamAssetCache.cs index ed0fcb8..074c84d 100644 --- a/modules/OpenSimConcurrentFlotsamAssetCache/addon-modules/OpenSimConcurrentFlotsamAssetCache/Modules/ConcurrentFlotsamAssetCache.cs +++ b/modules/OpenSimConcurrentFlotsamAssetCache/addon-modules/OpenSimConcurrentFlotsamAssetCache/Modules/ConcurrentFlotsamAssetCache.cs @@ -1888,13 +1888,14 @@ namespace OpenSim.Region.CoreModules.Asset foreach (string s in Directory.GetFiles(m_CacheDirectory, "*.fac")) { - int start = s.IndexOf('_'); - int end = s.IndexOf('.'); - if (start > 0 && end > 0) + string fn = Path.GetFileName(s); + int start = fn.IndexOf('_'); + int end = fn.IndexOf('.'); + if (start > 0 && end > start) { - string RegionID = s.Substring(start + 1, end - start - 1); - DateTime RegionDeepScanTMStamp = File.GetLastWriteTime(s); - con.Output("[CONCURRENT FLOTSAM ASSET CACHE] Region: {0}, {1}", RegionID, RegionDeepScanTMStamp.ToString("MM/dd/yyyy hh:mm:ss")); + string RegionID = fn.Substring(start + 1, end - start - 1); + DateTime ts = File.GetLastWriteTime(s); + con.Output("[CONCURRENT FLOTSAM ASSET CACHE] Region: {0}, {1}", RegionID, ts.ToString("MM/dd/yyyy hh:mm:ss")); } } }