Skip to content

Commit

Permalink
Fix for the Steam Unsubscribe Issue (tModLoader#2648)
Browse files Browse the repository at this point in the history
* Maybe a possible fix for the Steam Unsubscribe Issue and If not an Error Message Improvement

* Fix an Error with Mod Deletion Post-Preview System
  • Loading branch information
Solxanich authored Jun 30, 2022
1 parent 34d7b0d commit 030f19a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"ModAlreadyUploaded": "Error: Mod already exists on Workshop!",
"ModVersionInfoUnchanged": "Error: Mod Version information must be incremented prior to updating.",
"ConsultSteamLogs": "Consult Steam workshop_log.txt (Default Location: {0}) for more information.",
"SteamRejectUpdate": "Item is/was already installed: {0}. \nIf attempting to re-install, restart your game first because Steam is weird",
"SteamRejectUpdate": "Item is/was already installed: {0}. \nIf attempting to re-install, restart your game first because Steam is weird\nIf restarting your game does not work, apply the following steps:\n1) Open Steam Client\n2)Find the Mod on tModLoader Workshop\n3)Unsubscribe and Resubscribe on the actual Workshop.\nThese steps are required if Steam fails to handle unsubscribing you properly.",
"BrowserRejectWarning": "Can't Download. Click For Info",
"BeginDownload": "Attempting Download Item: {0}",
"EndDownload": "Item Download Completed",
Expand Down
2 changes: 1 addition & 1 deletion patches/tModLoader/Terraria/ModLoader/Core/ModOrganizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ internal static bool TryReadManifest(string parentDir, out FoundWorkshopEntryInf

internal static string GetParentDir(string tmodPath) {
string parentDir = Directory.GetParent(tmodPath).ToString();
if (!tmodPath.Contains(Path.Combine("steamapps", "workshop")))
if (!tmodPath.Contains("workshop", StringComparison.InvariantCultureIgnoreCase))
return parentDir;

var match = PublishFolderMetadata.Match(parentDir + Path.DirectorySeparatorChar);
Expand Down
11 changes: 6 additions & 5 deletions patches/tModLoader/Terraria/Social/Steam/WorkshopHelper.TML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,20 +303,21 @@ private void InnerDownloadQueue(UIWorkshopDownload uiProgress) {
}

internal void Uninstall(string installPath = null) {
if (String.IsNullOrEmpty(installPath))
if (string.IsNullOrEmpty(installPath))
installPath = GetInstallInfo().installPath;

if (!Directory.Exists(installPath))
return;

// Remove the files
Directory.Delete(installPath, true);

// Unsubscribe
if (SteamUser)
SteamUGC.UnsubscribeItem(itemID);

UninstallACF();
// Remove the files
Directory.Delete(installPath, true);

if (!SteamUser)
UninstallACF();
}

private void UninstallACF() {
Expand Down

0 comments on commit 030f19a

Please sign in to comment.