diff --git a/.gitignore b/.gitignore index d65136a..3f72fb5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,194 +1,195 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -x64/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -#NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding addin-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -_NCrunch_* -.*crunch*.local.xml - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml - -# NuGet Packages Directory -packages/ -## TODO: If the tool you use requires repositories.config uncomment the next line -#!packages/repositories.config - -# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets -# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) -!packages/build/ - -# Windows Azure Build Output -csx/ -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ - -# Strong name keys -*.snk - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +x64/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +#NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml + +# NuGet Packages Directory +packages/ +## TODO: If the tool you use requires repositories.config uncomment the next line +#!packages/repositories.config + +# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets +# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) +!packages/build/ + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ + +# Strong name keys +*.snk + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + .DS_Store .AppleDouble .LSOverride # Icon must ends with two \r. -Icon +Icon + # Thumbnails ._* @@ -196,22 +197,25 @@ Icon # Files that might appear on external disk .Spotlight-V100 .Trashes - -# Windows -# ========================= - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp + +# Windows +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +lib +.idea diff --git a/SteamCloudFileManager/IRemoteStorage.cs b/SteamCloudFileManager/IRemoteStorage.cs index a9993ff..759ea9d 100644 --- a/SteamCloudFileManager/IRemoteStorage.cs +++ b/SteamCloudFileManager/IRemoteStorage.cs @@ -7,8 +7,9 @@ interface IRemoteStorage { IRemoteFile GetFile(string name); List GetFiles(); - bool GetQuota(out int totalBytes, out int availableBytes); + bool GetQuota(out ulong totalBytes, out ulong availableBytes); bool IsCloudEnabledForAccount { get; } bool IsCloudEnabledForApp { get; set; } + void UploadFile(string filePath); } } diff --git a/SteamCloudFileManager/MainForm.Designer.cs b/SteamCloudFileManager/MainForm.Designer.cs index 104414c..e978106 100644 --- a/SteamCloudFileManager/MainForm.Designer.cs +++ b/SteamCloudFileManager/MainForm.Designer.cs @@ -41,6 +41,7 @@ private void InitializeComponent() this.refreshButton = new System.Windows.Forms.Button(); this.quotaLabel = new System.Windows.Forms.Label(); this.deleteButton = new System.Windows.Forms.Button(); + this.uploadButton = new System.Windows.Forms.Button(); this.downloadButton = new System.Windows.Forms.Button(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.SuspendLayout(); @@ -114,13 +115,24 @@ private void InitializeComponent() this.connectButton.UseVisualStyleBackColor = true; this.connectButton.Click += new System.EventHandler(this.connectButton_Click); // + // uploadButton + // + this.uploadButton.Enabled = false; + this.uploadButton.Location = new System.Drawing.Point(245, 12); + this.uploadButton.Name = "uploadButton"; + this.uploadButton.Size = new System.Drawing.Size(75, 23); + this.uploadButton.TabIndex = 4; + this.uploadButton.Text = "Upload"; + this.uploadButton.UseVisualStyleBackColor = true; + this.uploadButton.Click += new System.EventHandler(this.uploadButton_Click); + // // refreshButton // this.refreshButton.Enabled = false; - this.refreshButton.Location = new System.Drawing.Point(245, 12); + this.refreshButton.Location = new System.Drawing.Point(326, 12); this.refreshButton.Name = "refreshButton"; this.refreshButton.Size = new System.Drawing.Size(75, 23); - this.refreshButton.TabIndex = 4; + this.refreshButton.TabIndex = 5; this.refreshButton.Text = "Refresh"; this.refreshButton.UseVisualStyleBackColor = true; this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); @@ -129,10 +141,10 @@ private void InitializeComponent() // this.quotaLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.quotaLabel.Location = new System.Drawing.Point(326, 9); + this.quotaLabel.Location = new System.Drawing.Point(407, 9); this.quotaLabel.Name = "quotaLabel"; - this.quotaLabel.Size = new System.Drawing.Size(280, 23); - this.quotaLabel.TabIndex = 5; + this.quotaLabel.Size = new System.Drawing.Size(199, 23); + this.quotaLabel.TabIndex = 6; this.quotaLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // deleteButton @@ -142,7 +154,7 @@ private void InitializeComponent() this.deleteButton.Location = new System.Drawing.Point(93, 232); this.deleteButton.Name = "deleteButton"; this.deleteButton.Size = new System.Drawing.Size(75, 23); - this.deleteButton.TabIndex = 6; + this.deleteButton.TabIndex = 7; this.deleteButton.Text = "Delete"; this.deleteButton.UseVisualStyleBackColor = true; this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click); @@ -154,7 +166,7 @@ private void InitializeComponent() this.downloadButton.Location = new System.Drawing.Point(12, 232); this.downloadButton.Name = "downloadButton"; this.downloadButton.Size = new System.Drawing.Size(75, 23); - this.downloadButton.TabIndex = 7; + this.downloadButton.TabIndex = 8; this.downloadButton.Text = "Download"; this.downloadButton.UseVisualStyleBackColor = true; this.downloadButton.Click += new System.EventHandler(this.downloadButton_Click); @@ -173,6 +185,7 @@ private void InitializeComponent() this.Controls.Add(this.deleteButton); this.Controls.Add(this.remoteListView); this.Controls.Add(this.quotaLabel); + this.Controls.Add(this.uploadButton); this.Controls.Add(this.refreshButton); this.Controls.Add(this.connectButton); this.Controls.Add(this.appIdTextBox); @@ -195,6 +208,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox appIdTextBox; private System.Windows.Forms.Button connectButton; + private System.Windows.Forms.Button uploadButton; private System.Windows.Forms.Button refreshButton; private System.Windows.Forms.ColumnHeader columnHeader5; private System.Windows.Forms.Label quotaLabel; diff --git a/SteamCloudFileManager/MainForm.cs b/SteamCloudFileManager/MainForm.cs index 1aff118..52b672e 100644 --- a/SteamCloudFileManager/MainForm.cs +++ b/SteamCloudFileManager/MainForm.cs @@ -36,6 +36,7 @@ private void connectButton_Click(object sender, EventArgs e) } storage = RemoteStorage.CreateInstance(uint.Parse(appIdTextBox.Text)); //storage = new RemoteStorageLocal("remote", uint.Parse(appIdTextBox.Text)); + uploadButton.Enabled = true; refreshButton.Enabled = true; refreshButton_Click(this, EventArgs.Empty); } @@ -73,7 +74,7 @@ private void refreshButton_Click(object sender, EventArgs e) void updateQuota() { if (storage == null) throw new InvalidOperationException("Not connected"); - int totalBytes, availBytes; + ulong totalBytes, availBytes; storage.GetQuota(out totalBytes, out availBytes); quotaLabel.Text = string.Format("{0}/{1} bytes used", totalBytes - availBytes, totalBytes); } @@ -150,6 +151,30 @@ private void deleteButton_Click(object sender, EventArgs e) if (allSuccess) MessageBox.Show(this, "Files deleted.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } + + private void uploadButton_Click(object sender, EventArgs e) + { + OpenFileDialog openFileDialog = new OpenFileDialog(); + + // Set filter options and filter index + openFileDialog.Filter = "All Files (*.*)|*.*"; + openFileDialog.FilterIndex = 1; + + // Process input if the user clicked OK + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + // Get the path of specified file + string filePath = openFileDialog.FileName; + + // Store the file path to a variable + // You can now use the filePath variable for further processing + storage.UploadFile(filePath); + // Example: You could read the file here + // string fileContent = System.IO.File.ReadAllText(filePath); + // MessageBox.Show(fileContent, "File Content", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + private void remoteListView_SelectedIndexChanged(object sender, EventArgs e) { downloadButton.Enabled = deleteButton.Enabled = (storage != null && remoteListView.SelectedIndices.Count > 0); diff --git a/SteamCloudFileManager/Properties/AssemblyInfo.cs b/SteamCloudFileManager/Properties/AssemblyInfo.cs index 6227bfa..13d5f6d 100644 --- a/SteamCloudFileManager/Properties/AssemblyInfo.cs +++ b/SteamCloudFileManager/Properties/AssemblyInfo.cs @@ -2,18 +2,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Steam Cloud File Manager Lite")] -[assembly: AssemblyDescription("View, download, or delete Steam Cloud files.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("GMWare")] -[assembly: AssemblyProduct("Steam Cloud File Manager")] -[assembly: AssemblyCopyright("Copyright © cyanic 2014-2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. @@ -22,15 +10,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("b7f494b6-498c-4d31-8195-48e70136c791")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SteamCloudFileManager/RemoteStorage.cs b/SteamCloudFileManager/RemoteStorage.cs index 60cf3d9..52efa2b 100644 --- a/SteamCloudFileManager/RemoteStorage.cs +++ b/SteamCloudFileManager/RemoteStorage.cs @@ -37,6 +37,12 @@ public bool IsCloudEnabledForApp } } + public void UploadFile(string filePath) + { + var data = File.ReadAllBytes(filePath); + SteamRemoteStorage.FileWrite(Path.GetFileName(filePath), data, data.Length); + } + internal RemoteStorage(uint appID) { Environment.SetEnvironmentVariable("SteamAppID", appID.ToString()); @@ -80,7 +86,7 @@ public IRemoteFile GetFile(string name) return new RemoteFile(this, name.ToLowerInvariant()); } - public bool GetQuota(out int totalBytes, out int availableBytes) + public bool GetQuota(out ulong totalBytes, out ulong availableBytes) { checkDisposed(); return SteamRemoteStorage.GetQuota(out totalBytes, out availableBytes); diff --git a/SteamCloudFileManager/RemoteStorageLocal.cs b/SteamCloudFileManager/RemoteStorageLocal.cs index 9322081..56792fa 100644 --- a/SteamCloudFileManager/RemoteStorageLocal.cs +++ b/SteamCloudFileManager/RemoteStorageLocal.cs @@ -39,11 +39,11 @@ public List GetFiles() return files; } - public bool GetQuota(out int totalBytes, out int availableBytes) + public bool GetQuota(out ulong totalBytes, out ulong availableBytes) { DriveInfo di = new DriveInfo(Path.GetPathRoot(Path.GetFullPath(basePath))); - totalBytes = di.TotalSize > int.MaxValue ? int.MaxValue : (int)di.TotalSize; - availableBytes = di.AvailableFreeSpace > int.MaxValue ? int.MaxValue : (int)di.AvailableFreeSpace; + totalBytes = di.TotalSize < 0 ? 0 : (ulong)di.TotalSize; + availableBytes = di.AvailableFreeSpace < 0 ? 0 : (ulong)di.AvailableFreeSpace; return true; } @@ -63,5 +63,11 @@ public bool IsCloudEnabledForApp throw new NotSupportedException(); } } + + public void UploadFile(string filePath) + { + var name = Path.GetFileName(filePath); + File.Copy(filePath, Path.Join(basePath, name)); + } } } diff --git a/SteamCloudFileManager/SteamCloudFileManager.csproj b/SteamCloudFileManager/SteamCloudFileManager.csproj index 129038f..e9eec21 100644 --- a/SteamCloudFileManager/SteamCloudFileManager.csproj +++ b/SteamCloudFileManager/SteamCloudFileManager.csproj @@ -1,118 +1,31 @@ - - - + + - Debug - AnyCPU - {58AAE4A4-3134-427E-A621-71DA133954E8} WinExe - Properties - SteamCloudFileManager - SteamCloudFileManager - v4.0 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - MinimumRecommendedRules.ruleset + net8.0-windows + enable + true + enable + 1.0.0-md001 + Steam Cloud File Manager Lite + View, download, or delete Steam Cloud files. + GMWare + Steam Cloud File Manager + Copyright © cyanic 2014-2015 cloud.ico - ..\..\..\..\..\..\Desktop\Steamworks.NET-Standalone_5.0.0\Windows-x86\Steamworks.NET.dll + ..\lib\Windows-x64\Steamworks.NET.dll - - - - - - - - - - - - - - Form - - - MainForm.cs - - - - - - - - - MainForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - SettingsSingleFileGenerator - Settings.Designer.cs + + steam_api64.dll + PreserveNewest - - True - Settings.settings - True - - - - - - + \ No newline at end of file diff --git a/readme.md b/readme.md index eb731b1..8e14fdc 100644 --- a/readme.md +++ b/readme.md @@ -6,4 +6,4 @@ To begin, enter the App ID of the game you're interested in manipulating the fil Note files that reside directly on the filesystem (e.g. game saves) do not appear in the list. To modify those files and sync them back to Steam Cloud, launch the game, modify (or delete) the files you want, and close the game. Your modified files will be synced back, and those deleted will also be deleted on Steam Cloud. -You may find [Steam DB](https://steamdb.info/) to be useful in finding App IDs. The User Cloud tab on Steam DB's app pages is also helpful for finding where synced save files are. \ No newline at end of file +You may find [Steam DB](https://steamdb.info/) to be useful in finding App IDs. The User Cloud tab on Steam DB's app pages is also helpful for finding where synced save files are.