Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
414 changes: 209 additions & 205 deletions .gitignore

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion SteamCloudFileManager/IRemoteStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ interface IRemoteStorage
{
IRemoteFile GetFile(string name);
List<IRemoteFile> 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);
}
}
28 changes: 21 additions & 7 deletions SteamCloudFileManager/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 26 additions & 1 deletion SteamCloudFileManager/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down
24 changes: 0 additions & 24 deletions SteamCloudFileManager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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")]
8 changes: 7 additions & 1 deletion SteamCloudFileManager/RemoteStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 9 additions & 3 deletions SteamCloudFileManager/RemoteStorageLocal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public List<IRemoteFile> 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;
}

Expand All @@ -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));
}
}
}
121 changes: 17 additions & 104 deletions SteamCloudFileManager/SteamCloudFileManager.csproj
Original file line number Diff line number Diff line change
@@ -1,118 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{58AAE4A4-3134-427E-A621-71DA133954E8}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SteamCloudFileManager</RootNamespace>
<AssemblyName>SteamCloudFileManager</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<Version>1.0.0-md001</Version>
<AssemblyTitle>Steam Cloud File Manager Lite</AssemblyTitle>
<AssemblyDescription>View, download, or delete Steam Cloud files.</AssemblyDescription>
<Company>GMWare</Company>
<Product>Steam Cloud File Manager</Product>
<Copyright>Copyright © cyanic 2014-2015</Copyright>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>cloud.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Steamworks.NET">
<HintPath>..\..\..\..\..\..\Desktop\Steamworks.NET-Standalone_5.0.0\Windows-x86\Steamworks.NET.dll</HintPath>
<HintPath>..\lib\Windows-x64\Steamworks.NET.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="IRemoteFile.cs" />
<Compile Include="IRemoteStorage.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RemoteFile.cs" />
<Compile Include="RemoteFileLocal.cs" />
<Compile Include="RemoteStorage.cs" />
<Compile Include="RemoteStorageLocal.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
<None Include="..\lib\Windows-x64\steam_api64.dll">
<Link>steam_api64.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="cloud.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->

</Project>
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.