Compare commits

...

12 Commits

Author SHA1 Message Date
defnotken
223ade39cb another push
All checks were successful
Tag and Release Lightless / tag-and-release (push) Successful in 2m13s
2026-01-05 20:48:24 -06:00
defnotken
5aca9e70b2 Merge branch '2.0.3' into dev 2026-01-05 20:47:38 -06:00
defnotken
ce28799db3 More checks for animations and bones. 2026-01-05 20:46:14 -06:00
defnotken
92772cf334 dev push
All checks were successful
Tag and Release Lightless / tag-and-release (push) Successful in 2m12s
2026-01-05 20:21:26 -06:00
defnotken
0395e81a9f Merge branch '2.0.3' into dev 2026-01-05 20:17:12 -06:00
defnotken
7734a7bf7e dev build
All checks were successful
Tag and Release Lightless / tag-and-release (push) Successful in 2m8s
2026-01-05 17:42:21 -06:00
defnotken
db2d19bb1e Merge branch '2.0.3' into dev 2026-01-05 17:41:48 -06:00
defnotken
ab305a249c more checks
All checks were successful
Tag and Release Lightless / tag-and-release (push) Successful in 2m7s
2026-01-05 15:48:54 -06:00
defnotken
9d104a9dd8 Merge branch '2.0.3' into dev 2026-01-05 15:42:15 -06:00
defnotken
bcd3bd5ca2 add more checks
All checks were successful
Tag and Release Lightless / tag-and-release (push) Successful in 2m8s
2026-01-05 15:08:26 -06:00
defnotken
c1829a9837 Merge branch '2.0.3' into dev
All checks were successful
Tag and Release Lightless / tag-and-release (push) Successful in 2m14s
2026-01-05 14:48:47 -06:00
defnotken
cca23f6e05 Building Dev
All checks were successful
Tag and Release Lightless / tag-and-release (push) Successful in 2m27s
2026-01-05 10:50:25 -06:00
2 changed files with 47 additions and 6 deletions

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Authors></Authors> <Authors></Authors>
<Company></Company> <Company></Company>
<Version>2.0.3</Version> <Version>2.0.2.75</Version>
<Description></Description> <Description></Description>
<Copyright></Copyright> <Copyright></Copyright>
<PackageProjectUrl>https://github.com/Light-Public-Syncshells/LightlessClient</PackageProjectUrl> <PackageProjectUrl>https://github.com/Light-Public-Syncshells/LightlessClient</PackageProjectUrl>

View File

@@ -202,7 +202,7 @@ public sealed partial class XivDataAnalyzer
var tempSets = new Dictionary<string, HashSet<ushort>>(StringComparer.OrdinalIgnoreCase); var tempSets = new Dictionary<string, HashSet<ushort>>(StringComparer.OrdinalIgnoreCase);
var tempFileName = $"lightless_pap_{Guid.NewGuid():N}_{hash.Substring(0, Math.Min(8, hash.Length))}.hkx"; var tempFileName = $"lightless_pap_{Guid.NewGuid():N}_{hash[..Math.Min(8, hash.Length)]}.hkx";
var tempHavokDataPath = Path.Combine(Path.GetTempPath(), tempFileName); var tempHavokDataPath = Path.Combine(Path.GetTempPath(), tempFileName);
IntPtr tempHavokDataPathAnsi = IntPtr.Zero; IntPtr tempHavokDataPathAnsi = IntPtr.Zero;
@@ -215,7 +215,16 @@ public sealed partial class XivDataAnalyzer
return null; return null;
} }
// Write the file with explicit error handling
try
{
File.WriteAllBytes(tempHavokDataPath, havokData); File.WriteAllBytes(tempHavokDataPath, havokData);
}
catch (Exception writeEx)
{
_logger.LogError(writeEx, "Failed to write temporary Havok file to {path}", tempHavokDataPath);
return null;
}
if (!File.Exists(tempHavokDataPath)) if (!File.Exists(tempHavokDataPath))
{ {
@@ -228,7 +237,26 @@ public sealed partial class XivDataAnalyzer
{ {
_logger.LogWarning("Written temp file size mismatch: expected {expected}, got {actual}", _logger.LogWarning("Written temp file size mismatch: expected {expected}, got {actual}",
havokData.Length, writtenFileInfo.Length); havokData.Length, writtenFileInfo.Length);
File.Delete(tempHavokDataPath); try { File.Delete(tempHavokDataPath); } catch { }
return null;
}
Thread.Sleep(10); // stabilize file system
try
{
using var testStream = File.OpenRead(tempHavokDataPath);
if (testStream.Length != havokData.Length)
{
_logger.LogWarning("File verification failed: length mismatch after write");
try { File.Delete(tempHavokDataPath); } catch { }
return null;
}
}
catch (Exception readEx)
{
_logger.LogError(readEx, "Cannot read back temporary file at {path}", tempHavokDataPath);
try { File.Delete(tempHavokDataPath); } catch { }
return null; return null;
} }
@@ -245,18 +273,31 @@ public sealed partial class XivDataAnalyzer
hkResource* resource = null; hkResource* resource = null;
try try
{ {
if (tempHavokDataPathAnsi == IntPtr.Zero)
{
_logger.LogError("Failed to allocate ANSI string for path");
return null;
}
resource = hkSerializeUtil.LoadFromFile((byte*)tempHavokDataPathAnsi, null, loadoptions); resource = hkSerializeUtil.LoadFromFile((byte*)tempHavokDataPathAnsi, null, loadoptions);
} }
catch (SEHException ex) catch (SEHException ex)
{ {
_logger.LogError(ex, "SEH exception loading Havok file from {path} (hash={hash}). Native error code: 0x{code:X}", _logger.LogError(ex, "SEH exception loading Havok file from {path} (hash={hash}). Native error code: 0x{code:X}. This may indicate a corrupted PAP file or incompatible Havok format.",
tempHavokDataPath, hash, ex.ErrorCode); tempHavokDataPath, hash, ex.ErrorCode);
return null; return null;
} }
catch (Exception ex)
{
_logger.LogError(ex, "Unexpected exception loading Havok file from {path} (hash={hash})",
tempHavokDataPath, hash);
return null;
}
if (resource == null) if (resource == null)
{ {
_logger.LogDebug("Havok resource was null after loading from {path} (hash={hash})", tempHavokDataPath, hash); _logger.LogDebug("Havok resource was null after loading from {path} (hash={hash}). File may be corrupted or in an unsupported format.",
tempHavokDataPath, hash);
return null; return null;
} }