5 Commits

Author SHA1 Message Date
abea8f0856 Fix PNG images being limited to 255px
All checks were successful
.NET Build and Publish to Gitea / build (push) Successful in 1m3s
2025-08-31 14:13:16 -04:00
ProfessorFartsalot
1624a84cf1 merge upstream
All checks were successful
.NET Build and Publish to Gitea / build (push) Successful in 1m3s
2025-08-31 06:47:27 +00:00
Eauldane
a408e22a68 Tentative Moodles v3 support. They might change something between now and release. 2025-08-31 06:33:56 +01:00
Eauldane
1b71cda403 Version bump 2025-08-31 05:35:52 +01:00
Eauldane
eb8dbbd7f9 Petnames IPC update 2025-08-31 05:35:30 +01:00
4 changed files with 22 additions and 14 deletions

View File

@@ -27,9 +27,9 @@ public sealed class IpcCallerMoodles : IIpcCaller
_moodlesApiVersion = pi.GetIpcSubscriber<int>("Moodles.Version"); _moodlesApiVersion = pi.GetIpcSubscriber<int>("Moodles.Version");
_moodlesOnChange = pi.GetIpcSubscriber<IPlayerCharacter, object>("Moodles.StatusManagerModified"); _moodlesOnChange = pi.GetIpcSubscriber<IPlayerCharacter, object>("Moodles.StatusManagerModified");
_moodlesGetStatus = pi.GetIpcSubscriber<nint, string>("Moodles.GetStatusManagerByPtr"); _moodlesGetStatus = pi.GetIpcSubscriber<nint, string>("Moodles.GetStatusManagerByPtrV2");
_moodlesSetStatus = pi.GetIpcSubscriber<nint, string, object>("Moodles.SetStatusManagerByPtr"); _moodlesSetStatus = pi.GetIpcSubscriber<nint, string, object>("Moodles.SetStatusManagerByPtrV2");
_moodlesRevertStatus = pi.GetIpcSubscriber<nint, object>("Moodles.ClearStatusManagerByPtr"); _moodlesRevertStatus = pi.GetIpcSubscriber<nint, object>("Moodles.ClearStatusManagerByPtrV2");
_moodlesOnChange.Subscribe(OnMoodlesChange); _moodlesOnChange.Subscribe(OnMoodlesChange);
@@ -47,7 +47,7 @@ public sealed class IpcCallerMoodles : IIpcCaller
{ {
try try
{ {
APIAvailable = _moodlesApiVersion.InvokeFunc() == 1; APIAvailable = _moodlesApiVersion.InvokeFunc() == 3;
} }
catch catch
{ {

View File

@@ -30,12 +30,12 @@ public sealed class IpcCallerPetNames : IIpcCaller
_dalamudUtil = dalamudUtil; _dalamudUtil = dalamudUtil;
_mareMediator = mareMediator; _mareMediator = mareMediator;
_petnamesReady = pi.GetIpcSubscriber<object>("PetRenamer.Ready"); _petnamesReady = pi.GetIpcSubscriber<object>("PetRenamer.OnReady");
_petnamesDisposing = pi.GetIpcSubscriber<object>("PetRenamer.Disposing"); _petnamesDisposing = pi.GetIpcSubscriber<object>("PetRenamer.OnDisposing");
_apiVersion = pi.GetIpcSubscriber<(uint, uint)>("PetRenamer.ApiVersion"); _apiVersion = pi.GetIpcSubscriber<(uint, uint)>("PetRenamer.ApiVersion");
_enabled = pi.GetIpcSubscriber<bool>("PetRenamer.Enabled"); _enabled = pi.GetIpcSubscriber<bool>("PetRenamer.IsEnabled");
_playerDataChanged = pi.GetIpcSubscriber<string, object>("PetRenamer.PlayerDataChanged"); _playerDataChanged = pi.GetIpcSubscriber<string, object>("PetRenamer.OnPlayerDataChanged");
_getPlayerData = pi.GetIpcSubscriber<string>("PetRenamer.GetPlayerData"); _getPlayerData = pi.GetIpcSubscriber<string>("PetRenamer.GetPlayerData");
_setPlayerData = pi.GetIpcSubscriber<string, object>("PetRenamer.SetPlayerData"); _setPlayerData = pi.GetIpcSubscriber<string, object>("PetRenamer.SetPlayerData");
_clearPlayerData = pi.GetIpcSubscriber<ushort, object>("PetRenamer.ClearPlayerData"); _clearPlayerData = pi.GetIpcSubscriber<ushort, object>("PetRenamer.ClearPlayerData");
@@ -56,7 +56,7 @@ public sealed class IpcCallerPetNames : IIpcCaller
APIAvailable = _enabled?.InvokeFunc() ?? false; APIAvailable = _enabled?.InvokeFunc() ?? false;
if (APIAvailable) if (APIAvailable)
{ {
APIAvailable = _apiVersion?.InvokeFunc() is { Item1: 3, Item2: >= 1 }; APIAvailable = _apiVersion?.InvokeFunc() is { Item1: 4, Item2: >= 0 };
} }
} }
catch catch

View File

@@ -2,7 +2,7 @@
<Project Sdk="Dalamud.NET.Sdk/13.0.0"> <Project Sdk="Dalamud.NET.Sdk/13.0.0">
<PropertyGroup> <PropertyGroup>
<AssemblyName>Snowcloak</AssemblyName> <AssemblyName>Snowcloak</AssemblyName>
<Version>0.2.0.2</Version> <Version>0.2.0.3</Version>
<PackageProjectUrl>https://github.com/Eauldane/SnowcloakClient/</PackageProjectUrl> <PackageProjectUrl>https://github.com/Eauldane/SnowcloakClient/</PackageProjectUrl>
</PropertyGroup> </PropertyGroup>

View File

@@ -20,7 +20,7 @@ public class PngHdr
stream.ReadExactly(buffer[..8]); stream.ReadExactly(buffer[..8]);
uint ihdrLength = BitConverter.ToUInt32(buffer); uint ihdrLength = ReadBigEndianUInt32(buffer[..4]);
// The next four bytes will be the length of the IHDR section (it should be 13 bytes but we only need 8) // The next four bytes will be the length of the IHDR section (it should be 13 bytes but we only need 8)
if (ihdrLength < 8) if (ihdrLength < 8)
@@ -32,8 +32,8 @@ public class PngHdr
stream.ReadExactly(buffer[..8]); stream.ReadExactly(buffer[..8]);
uint width = BitConverter.ToUInt32(buffer); uint width = ReadBigEndianUInt32(buffer[..4]);
uint height = BitConverter.ToUInt32(buffer[4..]); uint height = ReadBigEndianUInt32(buffer[4..8]);
// Validate the width/height are non-negative and... that's all we care about! // Validate the width/height are non-negative and... that's all we care about!
if (width > int.MaxValue || height > int.MaxValue) if (width > int.MaxValue || height > int.MaxValue)
@@ -46,4 +46,12 @@ public class PngHdr
return InvalidSize; return InvalidSize;
} }
} }
} // Minimal helper for big-endian conversion
private static uint ReadBigEndianUInt32(ReadOnlySpan<byte> bytes)
{
return ((uint)bytes[0] << 24) |
((uint)bytes[1] << 16) |
((uint)bytes[2] << 8) |
bytes[3];
}
}