Skip to content

Commit

Permalink
Add fix for invalid Cactbot URLs causing a crash on load
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-software-dev committed Jul 13, 2023
1 parent 016caee commit e6ba283
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
19 changes: 16 additions & 3 deletions LMeter/src/Cactbot/TotallyNotCefCactbotHttpSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,22 @@ bool enableAudio
_browserInstallFolder = browserInstallFolder;
_bypassWebSocket = bypassWebSocket;

_cactbotUrl = _bypassWebSocket && Uri.TryCreate(cactbotUrl, UriKind.RelativeOrAbsolute, out var tempCactbotUri)
? $"{tempCactbotUri.GetLeftPart(UriPartial.Path)}{MagicValues.DefaultCactbotUrlQuery}"
: cactbotUrl;
if (_bypassWebSocket)
{
try
{
Uri.TryCreate(cactbotUrl, UriKind.RelativeOrAbsolute, out var tempCactbotUri);
_cactbotUrl = $"{tempCactbotUri?.GetLeftPart(UriPartial.Path)}{MagicValues.DefaultCactbotUrlQuery}";
}
catch
{
_cactbotUrl = cactbotUrl;
}
}
else
{
_cactbotUrl = cactbotUrl;
}

_cancelTokenSource = new ();
_enableAudio = enableAudio;
Expand Down
2 changes: 1 addition & 1 deletion Version/Version.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<PluginVersion>0.2.0.13</PluginVersion>
<PluginVersion>0.2.0.14</PluginVersion>
</PropertyGroup>
</Project>
4 changes: 4 additions & 0 deletions deps/txt/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 0.2.0.14
- Fix Cactbot URL potentially causing crashes on plugin load if the url was not
valid.

# Version 0.2.0.13
- Add support for disabling WebSockets on the background web browser, instead
sending data to the process obtained using Dalamud IPC (Requires IINACT)
Expand Down
12 changes: 6 additions & 6 deletions repo.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"Name": "LMeter",
"Description": "Plugin to display ACT combat log data. Now with Cactbot integration!",
"InternalName": "LMeter",
"AssemblyVersion": "0.2.0.13",
"TestingAssemblyVersion": "0.2.0.13",
"AssemblyVersion": "0.2.0.14",
"TestingAssemblyVersion": "0.2.0.14",
"RepoUrl": "https://github.com/joshua-software-dev/LMeter",
"ApplicableVersion": "any",
"DalamudApiLevel": 8,
Expand All @@ -35,10 +35,10 @@
"DownloadCount": 0,
"LastUpdate": 0,
"LoadPriority": 69420,
"DownloadLinkInstall": "https://github.com/joshua-software-dev/LMeter/releases/download/v0.2.0.13/latest.zip",
"DownloadLinkTesting": "https://github.com/joshua-software-dev/LMeter/releases/download/v0.2.0.13/latest.zip",
"DownloadLinkUpdate": "https://github.com/joshua-software-dev/LMeter/releases/download/v0.2.0.13/latest.zip",
"DownloadLinkInstall": "https://github.com/joshua-software-dev/LMeter/releases/download/v0.2.0.14/latest.zip",
"DownloadLinkTesting": "https://github.com/joshua-software-dev/LMeter/releases/download/v0.2.0.14/latest.zip",
"DownloadLinkUpdate": "https://github.com/joshua-software-dev/LMeter/releases/download/v0.2.0.14/latest.zip",
"IconUrl": "https://raw.githubusercontent.com/joshua-software-dev/LMeter/master/deps/img/icon.png",
"Changelog": "# Version 0.2.0.13\n- Add support for disabling WebSockets on the background web browser, instead\n sending data to the process obtained using Dalamud IPC (Requires IINACT)\n- Fix Cactbot URL not being editable if the URL exceeded 64 characters"
"Changelog": "# Version 0.2.0.14\n- Fix Cactbot URL potentially causing crashes on plugin load if the url was not\n valid."
}
]

0 comments on commit e6ba283

Please sign in to comment.