├── .appveyor.yml ├── .gitattributes ├── .gitignore ├── LICENSE.txt ├── README.md ├── SAM.API ├── CallHandle.cs ├── Callback.cs ├── Callbacks │ ├── AppDataChanged.cs │ └── UserStatsReceived.cs ├── Client.cs ├── ClientInitializeException.cs ├── ClientInitializeFailure.cs ├── GlobalSuppressions.cs ├── ICallback.cs ├── INativeWrapper.cs ├── Interfaces │ ├── ISteamApps001.cs │ ├── ISteamApps008.cs │ ├── ISteamClient018.cs │ ├── ISteamUser012.cs │ ├── ISteamUserStats013.cs │ └── ISteamUtils005.cs ├── LICENSE.txt ├── NativeClass.cs ├── NativeStrings.cs ├── NativeWrapper.cs ├── Pink.ico ├── SAM.API.csproj ├── SAM.API.csproj.DotSettings ├── Steam.cs ├── Types │ ├── AccountType.cs │ ├── AppDataChanged.cs │ ├── CallbackMessage.cs │ ├── ItemRequestResult.cs │ ├── UserItemsReceived.cs │ ├── UserStatType.cs │ ├── UserStatsReceived.cs │ └── UserStatsStored.cs └── Wrappers │ ├── SteamApps001.cs │ ├── SteamApps008.cs │ ├── SteamClient018.cs │ ├── SteamUser012.cs │ ├── SteamUserStats013.cs │ └── SteamUtils005.cs ├── SAM.Game ├── Blank.ico ├── DoubleBufferedListView.cs ├── GlobalSuppressions.cs ├── InvariantShorthand.cs ├── KeyValue.cs ├── KeyValueType.cs ├── LICENSE.txt ├── Manager.Designer.cs ├── Manager.cs ├── Manager.resx ├── Program.cs ├── Resources.Designer.cs ├── Resources.resx ├── Resources │ ├── arrow-circle-double.png │ ├── bomb.png │ ├── download-cloud.png │ ├── lock--pencil.png │ ├── lock-unlock.png │ ├── lock.png │ ├── poop-smiley-sad-enlarged.png │ ├── poop-smiley-sad.png │ └── transmitter.png ├── SAM.Game.csproj ├── SAM.Game.csproj.DotSettings ├── Stats │ ├── AchievementDefinition.cs │ ├── AchievementInfo.cs │ ├── FloatStatDefinition.cs │ ├── FloatStatInfo.cs │ ├── IntStatInfo.cs │ ├── IntegerStatDefinition.cs │ ├── StatDefinition.cs │ ├── StatFlags.cs │ ├── StatInfo.cs │ └── StatIsProtectedException.cs ├── StreamHelpers.cs ├── app.config └── app.manifest ├── SAM.Picker ├── GameInfo.cs ├── GamePicker.Designer.cs ├── GamePicker.cs ├── GamePicker.resx ├── GlobalSuppressions.cs ├── InvariantShorthand.cs ├── LICENSE.txt ├── LogoInfo.cs ├── MyListView.cs ├── Program.cs ├── Resources.Designer.cs ├── Resources.resx ├── Resources │ ├── arrow-circle-double.png │ ├── download-cloud.png │ ├── magnifier.png │ └── television-test.png ├── SAM.Picker.csproj ├── SAM.ico └── app.manifest └── SAM.sln /.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 7.0.{build} 2 | 3 | branches: 4 | only: 5 | - master 6 | 7 | skip_tags: true 8 | skip_commits: 9 | files: 10 | - .github/* 11 | - README.md 12 | 13 | max_jobs: 1 14 | 15 | image: Visual Studio 2019 16 | 17 | clone_folder: c:\projects\SAM 18 | 19 | cache: 20 | - packages -> **\packages.config 21 | - '%LocalAppData%\NuGet\Cache' 22 | - '%LocalAppData%\NuGet\v3-cache' 23 | 24 | install: 25 | - git submodule update --init --recursive 26 | 27 | configuration: 28 | - Release 29 | 30 | dotnet_csproj: 31 | patch: true 32 | file: '**\*.csproj' 33 | version: '{version}' 34 | assembly_version: '{version}' 35 | file_version: '{version}' 36 | informational_version: '{version}' 37 | 38 | build: 39 | project: SAM.sln 40 | parallel: true 41 | verbosity: minimal 42 | 43 | before_build: 44 | - nuget restore 45 | 46 | after_build: 47 | - set TZ=GMT 48 | - git log . > git-log.txt 49 | - 7z a -r -tzip -mx=9 -x!*/LICENSE.txt SteamAchievementManager-%APPVEYOR_BUILD_VERSION%.zip ./LICENSE.txt ./git-log.txt ./upload/*.exe ./upload/*.dll 50 | 51 | artifacts: 52 | - path: '*-*.zip' 53 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | **/Properties/launchSettings.json 13 | private/ 14 | upload/ 15 | 16 | # User-specific files (MonoDevelop/Xamarin Studio) 17 | *.userprefs 18 | 19 | # Mono auto generated files 20 | mono_crash.* 21 | 22 | # Build results 23 | [Dd]ebug/ 24 | [Dd]ebugPublic/ 25 | [Rr]elease/ 26 | [Rr]eleases/ 27 | x64/ 28 | x86/ 29 | [Ww][Ii][Nn]32/ 30 | [Aa][Rr][Mm]/ 31 | [Aa][Rr][Mm]64/ 32 | bld/ 33 | [Bb]in/ 34 | [Oo]bj/ 35 | [Ll]og/ 36 | [Ll]ogs/ 37 | 38 | # Visual Studio 2015/2017 cache/options directory 39 | .vs/ 40 | # Uncomment if you have tasks that create the project's static files in wwwroot 41 | #wwwroot/ 42 | 43 | # Visual Studio 2017 auto generated files 44 | Generated\ Files/ 45 | 46 | # MSTest test Results 47 | [Tt]est[Rr]esult*/ 48 | [Bb]uild[Ll]og.* 49 | 50 | # NUnit 51 | *.VisualState.xml 52 | TestResult.xml 53 | nunit-*.xml 54 | 55 | # Build Results of an ATL Project 56 | [Dd]ebugPS/ 57 | [Rr]eleasePS/ 58 | dlldata.c 59 | 60 | # Benchmark Results 61 | BenchmarkDotNet.Artifacts/ 62 | 63 | # .NET Core 64 | project.lock.json 65 | project.fragment.lock.json 66 | artifacts/ 67 | 68 | # ASP.NET Scaffolding 69 | ScaffoldingReadMe.txt 70 | 71 | # StyleCop 72 | StyleCopReport.xml 73 | 74 | # Files built by Visual Studio 75 | *_i.c 76 | *_p.c 77 | *_h.h 78 | *.ilk 79 | *.meta 80 | *.obj 81 | *.iobj 82 | *.pch 83 | *.pdb 84 | *.ipdb 85 | *.pgc 86 | *.pgd 87 | *.rsp 88 | *.sbr 89 | *.tlb 90 | *.tli 91 | *.tlh 92 | *.tmp 93 | *.tmp_proj 94 | *_wpftmp.csproj 95 | *.log 96 | *.tlog 97 | *.vspscc 98 | *.vssscc 99 | .builds 100 | *.pidb 101 | *.svclog 102 | *.scc 103 | 104 | # Chutzpah Test files 105 | _Chutzpah* 106 | 107 | # Visual C++ cache files 108 | ipch/ 109 | *.aps 110 | *.ncb 111 | *.opendb 112 | *.opensdf 113 | *.sdf 114 | *.cachefile 115 | *.VC.db 116 | *.VC.VC.opendb 117 | 118 | # Visual Studio profiler 119 | *.psess 120 | *.vsp 121 | *.vspx 122 | *.sap 123 | 124 | # Visual Studio Trace Files 125 | *.e2e 126 | 127 | # TFS 2012 Local Workspace 128 | $tf/ 129 | 130 | # Guidance Automation Toolkit 131 | *.gpState 132 | 133 | # ReSharper is a .NET coding add-in 134 | _ReSharper*/ 135 | *.[Rr]e[Ss]harper 136 | *.DotSettings.user 137 | 138 | # TeamCity is a build add-in 139 | _TeamCity* 140 | 141 | # DotCover is a Code Coverage Tool 142 | *.dotCover 143 | 144 | # AxoCover is a Code Coverage Tool 145 | .axoCover/* 146 | !.axoCover/settings.json 147 | 148 | # Coverlet is a free, cross platform Code Coverage Tool 149 | coverage*.json 150 | coverage*.xml 151 | coverage*.info 152 | 153 | # Visual Studio code coverage results 154 | *.coverage 155 | *.coveragexml 156 | 157 | # NCrunch 158 | _NCrunch_* 159 | .*crunch*.local.xml 160 | nCrunchTemp_* 161 | 162 | # MightyMoose 163 | *.mm.* 164 | AutoTest.Net/ 165 | 166 | # Web workbench (sass) 167 | .sass-cache/ 168 | 169 | # Installshield output folder 170 | [Ee]xpress/ 171 | 172 | # DocProject is a documentation generator add-in 173 | DocProject/buildhelp/ 174 | DocProject/Help/*.HxT 175 | DocProject/Help/*.HxC 176 | DocProject/Help/*.hhc 177 | DocProject/Help/*.hhk 178 | DocProject/Help/*.hhp 179 | DocProject/Help/Html2 180 | DocProject/Help/html 181 | 182 | # Click-Once directory 183 | publish/ 184 | 185 | # Publish Web Output 186 | *.[Pp]ublish.xml 187 | *.azurePubxml 188 | # Note: Comment the next line if you want to checkin your web deploy settings, 189 | # but database connection strings (with potential passwords) will be unencrypted 190 | *.pubxml 191 | *.publishproj 192 | 193 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 194 | # checkin your Azure Web App publish settings, but sensitive information contained 195 | # in these scripts will be unencrypted 196 | PublishScripts/ 197 | 198 | # NuGet Packages 199 | *.nupkg 200 | # NuGet Symbol Packages 201 | *.snupkg 202 | # The packages folder can be ignored because of Package Restore 203 | **/[Pp]ackages/* 204 | # except build/, which is used as an MSBuild target. 205 | !**/[Pp]ackages/build/ 206 | # Uncomment if necessary however generally it will be regenerated when needed 207 | #!**/[Pp]ackages/repositories.config 208 | # NuGet v3's project.json files produces more ignorable files 209 | *.nuget.props 210 | *.nuget.targets 211 | 212 | # Nuget personal access tokens and Credentials 213 | nuget.config 214 | 215 | # Microsoft Azure Build Output 216 | csx/ 217 | *.build.csdef 218 | 219 | # Microsoft Azure Emulator 220 | ecf/ 221 | rcf/ 222 | 223 | # Windows Store app package directories and files 224 | AppPackages/ 225 | BundleArtifacts/ 226 | Package.StoreAssociation.xml 227 | _pkginfo.txt 228 | *.appx 229 | *.appxbundle 230 | *.appxupload 231 | 232 | # Visual Studio cache files 233 | # files ending in .cache can be ignored 234 | *.[Cc]ache 235 | # but keep track of directories ending in .cache 236 | !?*.[Cc]ache/ 237 | 238 | # Others 239 | ClientBin/ 240 | ~$* 241 | *~ 242 | *.dbmdl 243 | *.dbproj.schemaview 244 | *.jfm 245 | *.pfx 246 | *.publishsettings 247 | orleans.codegen.cs 248 | 249 | # Including strong name files can present a security risk 250 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 251 | #*.snk 252 | 253 | # Since there are multiple workflows, uncomment next line to ignore bower_components 254 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 255 | #bower_components/ 256 | 257 | # RIA/Silverlight projects 258 | Generated_Code/ 259 | 260 | # Backup & report files from converting an old project file 261 | # to a newer Visual Studio version. Backup files are not needed, 262 | # because we have git ;-) 263 | _UpgradeReport_Files/ 264 | Backup*/ 265 | UpgradeLog*.XML 266 | UpgradeLog*.htm 267 | ServiceFabricBackup/ 268 | *.rptproj.bak 269 | 270 | # SQL Server files 271 | *.mdf 272 | *.ldf 273 | *.ndf 274 | 275 | # Business Intelligence projects 276 | *.rdl.data 277 | *.bim.layout 278 | *.bim_*.settings 279 | *.rptproj.rsuser 280 | *- [Bb]ackup.rdl 281 | *- [Bb]ackup ([0-9]).rdl 282 | *- [Bb]ackup ([0-9][0-9]).rdl 283 | 284 | # Microsoft Fakes 285 | FakesAssemblies/ 286 | 287 | # GhostDoc plugin setting file 288 | *.GhostDoc.xml 289 | 290 | # Node.js Tools for Visual Studio 291 | .ntvs_analysis.dat 292 | node_modules/ 293 | 294 | # Visual Studio 6 build log 295 | *.plg 296 | 297 | # Visual Studio 6 workspace options file 298 | *.opt 299 | 300 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 301 | *.vbw 302 | 303 | # Visual Studio LightSwitch build output 304 | **/*.HTMLClient/GeneratedArtifacts 305 | **/*.DesktopClient/GeneratedArtifacts 306 | **/*.DesktopClient/ModelManifest.xml 307 | **/*.Server/GeneratedArtifacts 308 | **/*.Server/ModelManifest.xml 309 | _Pvt_Extensions 310 | 311 | # Paket dependency manager 312 | .paket/paket.exe 313 | paket-files/ 314 | 315 | # FAKE - F# Make 316 | .fake/ 317 | 318 | # CodeRush personal settings 319 | .cr/personal 320 | 321 | # Python Tools for Visual Studio (PTVS) 322 | __pycache__/ 323 | *.pyc 324 | 325 | # Cake - Uncomment if you are using it 326 | # tools/** 327 | # !tools/packages.config 328 | 329 | # Tabs Studio 330 | *.tss 331 | 332 | # Telerik's JustMock configuration file 333 | *.jmconfig 334 | 335 | # BizTalk build output 336 | *.btp.cs 337 | *.btm.cs 338 | *.odx.cs 339 | *.xsd.cs 340 | 341 | # OpenCover UI analysis results 342 | OpenCover/ 343 | 344 | # Azure Stream Analytics local run output 345 | ASALocalRun/ 346 | 347 | # MSBuild Binary and Structured Log 348 | *.binlog 349 | 350 | # NVidia Nsight GPU debugger configuration file 351 | *.nvuser 352 | 353 | # MFractors (Xamarin productivity tool) working folder 354 | .mfractor/ 355 | 356 | # Local History for Visual Studio 357 | .localhistory/ 358 | 359 | # BeatPulse healthcheck temp database 360 | healthchecksdb 361 | 362 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 363 | MigrationBackup/ 364 | 365 | # Ionide (cross platform F# VS Code tools) working folder 366 | .ionide/ 367 | 368 | # Fody - auto-generated XML schema 369 | FodyWeavers.xsd 370 | 371 | # VS Code files for those working on multiple tools 372 | .vscode/* 373 | !.vscode/settings.json 374 | !.vscode/tasks.json 375 | !.vscode/launch.json 376 | !.vscode/extensions.json 377 | *.code-workspace 378 | 379 | # Local History for Visual Studio Code 380 | .history/ 381 | 382 | # Windows Installer files from build outputs 383 | *.cab 384 | *.msi 385 | *.msix 386 | *.msm 387 | *.msp 388 | 389 | # JetBrains Rider 390 | .idea/ 391 | *.sln.iml 392 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | zlib License 2 | 3 | Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Steam Achievement Manager 2 | 3 | Steam Achievement Manager (SAM) is a lightweight, portable application used to manage achievements and statistics in the popular PC gaming platform Steam. This application requires the [Steam client](https://store.steampowered.com/about/), a Steam account and network access. Steam must be running and the user must be logged in. 4 | 5 | This is the code for SAM. The closed-source version originally released in 2008, last major release in 2011, and last updated in 2013 (a hotfix). 6 | 7 | The code is being made available so that those interested can do as they like with it. 8 | 9 | There are some changes to the code since the last closed-source release: 10 | - General code maintenance to bring it into a more modern state. 11 | - Icons have been replaced with ones from the Fugue Icons set. 12 | - Version has been bumped to 7.0.x.x to indicate the open-source release. 13 | 14 | [Download latest release](https://github.com/gibbed/SteamAchievementManager/releases/latest). 15 | 16 | [![Build status](https://ci.appveyor.com/api/projects/status/00vic6jliar6j0ol/branch/master?svg=true)](https://ci.appveyor.com/project/gibbed/steamachievementmanager/branch/master) 17 | 18 | ## Attribution 19 | 20 | Most (if not all) icons are from the [Fugue Icons](https://p.yusukekamiyamane.com/) set. 21 | -------------------------------------------------------------------------------- /SAM.API/CallHandle.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.API 24 | { 25 | public enum CallHandle : ulong 26 | { 27 | Invalid = 0, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SAM.API/Callback.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | 26 | namespace SAM.API 27 | { 28 | public abstract class Callback : ICallback 29 | { 30 | public delegate void CallbackFunction(IntPtr param); 31 | 32 | public event CallbackFunction OnRun; 33 | 34 | public abstract int Id { get; } 35 | public abstract bool IsServer { get; } 36 | 37 | public void Run(IntPtr param) 38 | { 39 | this.OnRun(param); 40 | } 41 | } 42 | 43 | public abstract class Callback : ICallback 44 | where TParameter : struct 45 | { 46 | public delegate void CallbackFunction(TParameter arg); 47 | 48 | public event CallbackFunction OnRun; 49 | 50 | public abstract int Id { get; } 51 | public abstract bool IsServer { get; } 52 | 53 | public void Run(IntPtr pvParam) 54 | { 55 | var data = (TParameter)Marshal.PtrToStructure(pvParam, typeof(TParameter)); 56 | this.OnRun(data); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /SAM.API/Callbacks/AppDataChanged.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.API.Callbacks 24 | { 25 | public class AppDataChanged : Callback 26 | { 27 | public override int Id => 1001; 28 | public override bool IsServer => false; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SAM.API/Callbacks/UserStatsReceived.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.API.Callbacks 24 | { 25 | public class UserStatsReceived : Callback 26 | { 27 | public override int Id => 1101; 28 | public override bool IsServer => false; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SAM.API/Client.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Collections.Generic; 25 | using System.Globalization; 26 | using System.Linq; 27 | 28 | namespace SAM.API 29 | { 30 | public class Client : IDisposable 31 | { 32 | public Wrappers.SteamClient018 SteamClient; 33 | public Wrappers.SteamUser012 SteamUser; 34 | public Wrappers.SteamUserStats013 SteamUserStats; 35 | public Wrappers.SteamUtils005 SteamUtils; 36 | public Wrappers.SteamApps001 SteamApps001; 37 | public Wrappers.SteamApps008 SteamApps008; 38 | 39 | private bool _IsDisposed = false; 40 | private int _Pipe; 41 | private int _User; 42 | 43 | private readonly List _Callbacks = new(); 44 | 45 | public void Initialize(long appId) 46 | { 47 | if (string.IsNullOrEmpty(Steam.GetInstallPath()) == true) 48 | { 49 | throw new ClientInitializeException(ClientInitializeFailure.GetInstallPath, "failed to get Steam install path"); 50 | } 51 | 52 | if (appId != 0) 53 | { 54 | Environment.SetEnvironmentVariable("SteamAppId", appId.ToString(CultureInfo.InvariantCulture)); 55 | } 56 | 57 | if (Steam.Load() == false) 58 | { 59 | throw new ClientInitializeException(ClientInitializeFailure.Load, "failed to load SteamClient"); 60 | } 61 | 62 | this.SteamClient = Steam.CreateInterface("SteamClient018"); 63 | if (this.SteamClient == null) 64 | { 65 | throw new ClientInitializeException(ClientInitializeFailure.CreateSteamClient, "failed to create ISteamClient018"); 66 | } 67 | 68 | this._Pipe = this.SteamClient.CreateSteamPipe(); 69 | if (this._Pipe == 0) 70 | { 71 | throw new ClientInitializeException(ClientInitializeFailure.CreateSteamPipe, "failed to create pipe"); 72 | } 73 | 74 | this._User = this.SteamClient.ConnectToGlobalUser(this._Pipe); 75 | if (this._User == 0) 76 | { 77 | throw new ClientInitializeException(ClientInitializeFailure.ConnectToGlobalUser, "failed to connect to global user"); 78 | } 79 | 80 | this.SteamUtils = this.SteamClient.GetSteamUtils004(this._Pipe); 81 | if (appId > 0 && this.SteamUtils.GetAppId() != (uint)appId) 82 | { 83 | throw new ClientInitializeException(ClientInitializeFailure.AppIdMismatch, "appID mismatch"); 84 | } 85 | 86 | this.SteamUser = this.SteamClient.GetSteamUser012(this._User, this._Pipe); 87 | this.SteamUserStats = this.SteamClient.GetSteamUserStats013(this._User, this._Pipe); 88 | this.SteamApps001 = this.SteamClient.GetSteamApps001(this._User, this._Pipe); 89 | this.SteamApps008 = this.SteamClient.GetSteamApps008(this._User, this._Pipe); 90 | } 91 | 92 | ~Client() 93 | { 94 | this.Dispose(false); 95 | } 96 | 97 | protected virtual void Dispose(bool disposing) 98 | { 99 | if (this._IsDisposed == true) 100 | { 101 | return; 102 | } 103 | 104 | if (this.SteamClient != null && this._Pipe > 0) 105 | { 106 | if (this._User > 0) 107 | { 108 | this.SteamClient.ReleaseUser(this._Pipe, this._User); 109 | this._User = 0; 110 | } 111 | 112 | this.SteamClient.ReleaseSteamPipe(this._Pipe); 113 | this._Pipe = 0; 114 | } 115 | 116 | this._IsDisposed = true; 117 | } 118 | 119 | public void Dispose() 120 | { 121 | Dispose(true); 122 | GC.SuppressFinalize(this); 123 | } 124 | 125 | public TCallback CreateAndRegisterCallback() 126 | where TCallback : ICallback, new() 127 | { 128 | TCallback callback = new(); 129 | this._Callbacks.Add(callback); 130 | return callback; 131 | } 132 | 133 | private bool _RunningCallbacks; 134 | 135 | public void RunCallbacks(bool server) 136 | { 137 | if (this._RunningCallbacks == true) 138 | { 139 | return; 140 | } 141 | 142 | this._RunningCallbacks = true; 143 | 144 | Types.CallbackMessage message; 145 | while (Steam.GetCallback(this._Pipe, out message, out _) == true) 146 | { 147 | var callbackId = message.Id; 148 | foreach (ICallback callback in this._Callbacks.Where( 149 | candidate => candidate.Id == callbackId && 150 | candidate.IsServer == server)) 151 | { 152 | callback.Run(message.ParamPointer); 153 | } 154 | Steam.FreeLastCallback(this._Pipe); 155 | } 156 | 157 | this._RunningCallbacks = false; 158 | } 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /SAM.API/ClientInitializeException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | using System; 23 | 24 | namespace SAM.API 25 | { 26 | public class ClientInitializeException : Exception 27 | { 28 | public readonly ClientInitializeFailure Failure; 29 | 30 | public ClientInitializeException(ClientInitializeFailure failure) 31 | { 32 | this.Failure = failure; 33 | } 34 | 35 | public ClientInitializeException(ClientInitializeFailure failure, string message) 36 | : base(message) 37 | { 38 | this.Failure = failure; 39 | } 40 | 41 | public ClientInitializeException(ClientInitializeFailure failure, string message, Exception innerException) 42 | : base(message, innerException) 43 | { 44 | this.Failure = failure; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /SAM.API/ClientInitializeFailure.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | namespace SAM.API 23 | { 24 | public enum ClientInitializeFailure : byte 25 | { 26 | Unknown = 0, 27 | GetInstallPath, 28 | Load, 29 | CreateSteamClient, 30 | CreateSteamPipe, 31 | ConnectToGlobalUser, 32 | AppIdMismatch, 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SAM.API/ICallback.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | 25 | namespace SAM.API 26 | { 27 | public interface ICallback 28 | { 29 | int Id { get; } 30 | bool IsServer { get; } 31 | void Run(IntPtr param); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SAM.API/INativeWrapper.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | 25 | namespace SAM.API 26 | { 27 | public interface INativeWrapper 28 | { 29 | void SetupFunctions(IntPtr objectAddress); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SAM.API/Interfaces/ISteamApps001.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | 26 | namespace SAM.API.Interfaces 27 | { 28 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 29 | public struct ISteamApps001 30 | { 31 | public IntPtr GetAppData; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SAM.API/Interfaces/ISteamApps008.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | 26 | namespace SAM.API.Interfaces 27 | { 28 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 29 | public struct ISteamApps008 30 | { 31 | public IntPtr IsSubscribed; 32 | public IntPtr IsLowViolence; 33 | public IntPtr IsCybercafe; 34 | public IntPtr IsVACBanned; 35 | public IntPtr GetCurrentGameLanguage; 36 | public IntPtr GetAvailableGameLanguages; 37 | public IntPtr IsSubscribedApp; 38 | public IntPtr IsDlcInstalled; 39 | public IntPtr GetEarliestPurchaseUnixTime; 40 | public IntPtr IsSubscribedFromFreeWeekend; 41 | public IntPtr GetDLCCount; 42 | public IntPtr GetDLCDataByIndex; 43 | public IntPtr InstallDLC; 44 | public IntPtr UninstallDLC; 45 | public IntPtr RequestAppProofOfPurchaseKey; 46 | public IntPtr GetCurrentBetaName; 47 | public IntPtr MarkContentCorrupt; 48 | public IntPtr GetInstalledDepots; 49 | public IntPtr GetAppInstallDir; 50 | public IntPtr IsAppInstalled; 51 | public IntPtr GetAppOwner; 52 | public IntPtr GetLaunchQueryParam; 53 | public IntPtr GetDlcDownloadProgress; 54 | public IntPtr GetAppBuildId; 55 | public IntPtr RequestAllProofOfPurchaseKeys; 56 | public IntPtr GetFileDetails; 57 | public IntPtr GetLaunchCommandLine; 58 | public IntPtr IsSubscribedFromFamilySharing; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SAM.API/Interfaces/ISteamClient018.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | 26 | namespace SAM.API.Interfaces 27 | { 28 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 29 | public struct ISteamClient018 30 | { 31 | public IntPtr CreateSteamPipe; 32 | public IntPtr ReleaseSteamPipe; 33 | public IntPtr ConnectToGlobalUser; 34 | public IntPtr CreateLocalUser; 35 | public IntPtr ReleaseUser; 36 | public IntPtr GetISteamUser; 37 | public IntPtr GetISteamGameServer; 38 | public IntPtr SetLocalIPBinding; 39 | public IntPtr GetISteamFriends; 40 | public IntPtr GetISteamUtils; 41 | public IntPtr GetISteamMatchmaking; 42 | public IntPtr GetISteamMatchmakingServers; 43 | public IntPtr GetISteamGenericInterface; 44 | public IntPtr GetISteamUserStats; 45 | public IntPtr GetISteamGameServerStats; 46 | public IntPtr GetISteamApps; 47 | public IntPtr GetISteamNetworking; 48 | public IntPtr GetISteamRemoteStorage; 49 | public IntPtr GetISteamScreenshots; 50 | public IntPtr GetISteamGameSearch; 51 | public IntPtr RunFrame; 52 | public IntPtr GetIPCCallCount; 53 | public IntPtr SetWarningMessageHook; 54 | public IntPtr ShutdownIfAllPipesClosed; 55 | public IntPtr GetISteamHTTP; 56 | public IntPtr DEPRECATED_GetISteamUnifiedMessages; 57 | public IntPtr GetISteamController; 58 | public IntPtr GetISteamUGC; 59 | public IntPtr GetISteamAppList; 60 | public IntPtr GetISteamMusic; 61 | public IntPtr GetISteamMusicRemote; 62 | public IntPtr GetISteamHTMLSurface; 63 | public IntPtr DEPRECATED_Set_SteamAPI_CPostAPIResultInProcess; 64 | public IntPtr DEPRECATED_Remove_SteamAPI_CPostAPIResultInProcess; 65 | public IntPtr Set_SteamAPI_CCheckCallbackRegisteredInProcess; 66 | public IntPtr GetISteamInventory; 67 | public IntPtr GetISteamVideo; 68 | public IntPtr GetISteamParentalSettings; 69 | public IntPtr GetISteamInput; 70 | public IntPtr GetISteamParties; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /SAM.API/Interfaces/ISteamUser012.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | 26 | namespace SAM.API.Interfaces 27 | { 28 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 29 | public struct ISteamUser012 30 | { 31 | public IntPtr GetHSteamUser; 32 | public IntPtr LoggedOn; 33 | public IntPtr GetSteamID; 34 | public IntPtr InitiateGameConnection; 35 | public IntPtr TerminateGameConnection; 36 | public IntPtr TrackAppUsageEvent; 37 | public IntPtr GetUserDataFolder; 38 | public IntPtr StartVoiceRecording; 39 | public IntPtr StopVoiceRecording; 40 | public IntPtr GetCompressedVoice; 41 | public IntPtr DecompressVoice; 42 | public IntPtr GetAuthSessionTicket; 43 | public IntPtr BeginAuthSession; 44 | public IntPtr EndAuthSession; 45 | public IntPtr CancelAuthTicket; 46 | public IntPtr UserHasLicenseForApp; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SAM.API/Interfaces/ISteamUserStats013.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | 26 | namespace SAM.API.Interfaces 27 | { 28 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 29 | public class ISteamUserStats013 30 | { 31 | public IntPtr GetStatFloat; 32 | public IntPtr GetStatInteger; 33 | public IntPtr SetStatFloat; 34 | public IntPtr SetStatInteger; 35 | public IntPtr UpdateAvgRateStat; 36 | public IntPtr GetAchievement; 37 | public IntPtr SetAchievement; 38 | public IntPtr ClearAchievement; 39 | public IntPtr GetAchievementAndUnlockTime; 40 | public IntPtr StoreStats; 41 | public IntPtr GetAchievementIcon; 42 | public IntPtr GetAchievementDisplayAttribute; 43 | public IntPtr IndicateAchievementProgress; 44 | public IntPtr GetNumAchievements; 45 | public IntPtr GetAchievementName; 46 | public IntPtr RequestUserStats; 47 | public IntPtr GetUserStatFloat; 48 | public IntPtr GetUserStatInt; 49 | public IntPtr GetUserAchievement; 50 | public IntPtr GetUserAchievementAndUnlockTime; 51 | public IntPtr ResetAllStats; 52 | public IntPtr FindOrCreateLeaderboard; 53 | public IntPtr FindLeaderboard; 54 | public IntPtr GetLeaderboardName; 55 | public IntPtr GetLeaderboardEntryCount; 56 | public IntPtr GetLeaderboardSortMethod; 57 | public IntPtr GetLeaderboardDisplayType; 58 | public IntPtr DownloadLeaderboardEntries; 59 | public IntPtr DownloadLeaderboardEntriesForUsers; 60 | public IntPtr GetDownloadedLeaderboardEntry; 61 | public IntPtr UploadLeaderboardScore; 62 | public IntPtr AttachLeaderboardUGC; 63 | public IntPtr GetNumberOfCurrentPlayers; 64 | public IntPtr RequestGlobalAchievementPercentages; 65 | public IntPtr GetMostAchievedAchievementInfo; 66 | public IntPtr GetNextMostAchievedAchievementInfo; 67 | public IntPtr GetAchievementAchievedPercent; 68 | public IntPtr RequestGlobalStats; 69 | public IntPtr GetGlobalStatFloat; 70 | public IntPtr GetGlobalStatInteger; 71 | public IntPtr GetGlobalStatHistoryFloat; 72 | public IntPtr GetGlobalStatHistoryInteger; 73 | public IntPtr GetAchievementProgressLimitsFloat; 74 | public IntPtr GetAchievementProgressLimitsInteger; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /SAM.API/Interfaces/ISteamUtils005.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | 26 | namespace SAM.API.Interfaces 27 | { 28 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 29 | public struct ISteamUtils005 30 | { 31 | public IntPtr GetSecondsSinceAppActive; 32 | public IntPtr GetSecondsSinceComputerActive; 33 | public IntPtr GetConnectedUniverse; 34 | public IntPtr GetServerRealTime; 35 | public IntPtr GetIPCountry; 36 | public IntPtr GetImageSize; 37 | public IntPtr GetImageRGBA; 38 | public IntPtr GetCSERIPPort; 39 | public IntPtr GetCurrentBatteryPower; 40 | public IntPtr GetAppID; 41 | public IntPtr SetOverlayNotificationPosition; 42 | public IntPtr IsAPICallCompleted; 43 | public IntPtr GetAPICallFailureReason; 44 | public IntPtr GetAPICallResult; 45 | public IntPtr RunFrame; 46 | public IntPtr GetIPCCallCount; 47 | public IntPtr SetWarningMessageHook; 48 | public IntPtr IsOverlayEnabled; 49 | public IntPtr OverlayNeedsPresent; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /SAM.API/LICENSE.txt: -------------------------------------------------------------------------------- 1 | zlib License 2 | 3 | Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. -------------------------------------------------------------------------------- /SAM.API/NativeClass.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | 26 | namespace SAM.API 27 | { 28 | [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] 29 | internal struct NativeClass 30 | { 31 | public IntPtr VirtualTable; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SAM.API/NativeStrings.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | using System.Text; 26 | using Microsoft.Win32.SafeHandles; 27 | 28 | namespace SAM.API 29 | { 30 | internal class NativeStrings 31 | { 32 | public sealed class StringHandle : SafeHandleZeroOrMinusOneIsInvalid 33 | { 34 | internal StringHandle(IntPtr preexistingHandle, bool ownsHandle) 35 | : base(ownsHandle) 36 | { 37 | this.SetHandle(preexistingHandle); 38 | } 39 | 40 | public IntPtr Handle 41 | { 42 | get { return this.handle; } 43 | } 44 | 45 | protected override bool ReleaseHandle() 46 | { 47 | if (handle != IntPtr.Zero) 48 | { 49 | Marshal.FreeHGlobal(handle); 50 | handle = IntPtr.Zero; 51 | return true; 52 | } 53 | 54 | return false; 55 | } 56 | } 57 | 58 | public static unsafe StringHandle StringToStringHandle(string value) 59 | { 60 | if (value == null) 61 | { 62 | return new StringHandle(IntPtr.Zero, true); 63 | } 64 | 65 | var bytes = Encoding.UTF8.GetBytes(value); 66 | var length = bytes.Length; 67 | 68 | var p = Marshal.AllocHGlobal(length + 1); 69 | Marshal.Copy(bytes, 0, p, bytes.Length); 70 | ((byte*)p)[length] = 0; 71 | return new StringHandle(p, true); 72 | } 73 | 74 | public static unsafe string PointerToString(sbyte* bytes) 75 | { 76 | if (bytes == null) 77 | { 78 | return null; 79 | } 80 | 81 | int running = 0; 82 | 83 | var b = bytes; 84 | if (*b == 0) 85 | { 86 | return string.Empty; 87 | } 88 | 89 | while ((*b++) != 0) 90 | { 91 | running++; 92 | } 93 | 94 | return new string(bytes, 0, running, Encoding.UTF8); 95 | } 96 | 97 | public static unsafe string PointerToString(byte* bytes) 98 | { 99 | return PointerToString((sbyte*)bytes); 100 | } 101 | 102 | public static unsafe string PointerToString(IntPtr nativeData) 103 | { 104 | return PointerToString((sbyte*)nativeData.ToPointer()); 105 | } 106 | 107 | public static unsafe string PointerToString(sbyte* bytes, int length) 108 | { 109 | if (bytes == null) 110 | { 111 | return null; 112 | } 113 | 114 | int running = 0; 115 | 116 | var b = bytes; 117 | if (length == 0 || *b == 0) 118 | { 119 | return string.Empty; 120 | } 121 | 122 | while ((*b++) != 0 && 123 | running < length) 124 | { 125 | running++; 126 | } 127 | 128 | return new string(bytes, 0, running, Encoding.UTF8); 129 | } 130 | 131 | public static unsafe string PointerToString(byte* bytes, int length) 132 | { 133 | return PointerToString((sbyte*)bytes, length); 134 | } 135 | 136 | public static unsafe string PointerToString(IntPtr nativeData, int length) 137 | { 138 | return PointerToString((sbyte*)nativeData.ToPointer(), length); 139 | } 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /SAM.API/NativeWrapper.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Collections.Generic; 25 | using System.Runtime.InteropServices; 26 | 27 | namespace SAM.API 28 | { 29 | public abstract class NativeWrapper : INativeWrapper 30 | { 31 | protected IntPtr ObjectAddress; 32 | protected TNativeFunctions Functions; 33 | 34 | public override string ToString() 35 | { 36 | return $"Steam Interface<{typeof(TNativeFunctions)}> #{this.ObjectAddress.ToInt32():X8}"; 37 | } 38 | 39 | public void SetupFunctions(IntPtr objectAddress) 40 | { 41 | this.ObjectAddress = objectAddress; 42 | 43 | var iface = (NativeClass)Marshal.PtrToStructure( 44 | this.ObjectAddress, 45 | typeof(NativeClass)); 46 | 47 | this.Functions = (TNativeFunctions)Marshal.PtrToStructure( 48 | iface.VirtualTable, 49 | typeof(TNativeFunctions)); 50 | } 51 | 52 | private readonly Dictionary _FunctionCache = new(); 53 | 54 | protected Delegate GetDelegate(IntPtr pointer) 55 | { 56 | if (this._FunctionCache.TryGetValue(pointer, out var function) == false) 57 | { 58 | function = Marshal.GetDelegateForFunctionPointer(pointer, typeof(TDelegate)); 59 | this._FunctionCache[pointer] = function; 60 | } 61 | return function; 62 | } 63 | 64 | protected TDelegate GetFunction(IntPtr pointer) 65 | where TDelegate : class 66 | { 67 | return (TDelegate)((object)this.GetDelegate(pointer)); 68 | } 69 | 70 | protected void Call(IntPtr pointer, params object[] args) 71 | { 72 | this.GetDelegate(pointer).DynamicInvoke(args); 73 | } 74 | 75 | protected TReturn Call(IntPtr pointer, params object[] args) 76 | { 77 | return (TReturn)this.GetDelegate(pointer).DynamicInvoke(args); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /SAM.API/Pink.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.API/Pink.ico -------------------------------------------------------------------------------- /SAM.API/SAM.API.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Gibbed 4 | Gibbed 5 | 6 | Copyright © Gibbed 2019 7 | 8 | 9 | 7.0.0 10 | 7.0.0.0 11 | 7.0.0.0 12 | 13 | 14 | Pink.ico 15 | 16 | 17 | https://github.com/gibbed/SteamAchievementManager/ 18 | Git 19 | 20 | 21 | net48 22 | 9.0 23 | x86 24 | 25 | 26 | true 27 | 28 | 29 | true 30 | 31 | -------------------------------------------------------------------------------- /SAM.API/SAM.API.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | No -------------------------------------------------------------------------------- /SAM.API/Steam.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.IO; 25 | using System.Runtime.InteropServices; 26 | using Microsoft.Win32; 27 | 28 | namespace SAM.API 29 | { 30 | public static class Steam 31 | { 32 | private struct Native 33 | { 34 | [DllImport("kernel32.dll", SetLastError = true, BestFitMapping = false, ThrowOnUnmappableChar = true)] 35 | internal static extern IntPtr GetProcAddress(IntPtr module, string name); 36 | 37 | [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] 38 | internal static extern IntPtr LoadLibraryEx(string path, IntPtr file, uint flags); 39 | 40 | [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] 41 | [return: MarshalAs(UnmanagedType.Bool)] 42 | internal static extern bool SetDllDirectory(string path); 43 | 44 | internal const uint LoadWithAlteredSearchPath = 8; 45 | } 46 | 47 | private static Delegate GetExportDelegate(IntPtr module, string name) 48 | { 49 | IntPtr address = Native.GetProcAddress(module, name); 50 | return address == IntPtr.Zero ? null : Marshal.GetDelegateForFunctionPointer(address, typeof(TDelegate)); 51 | } 52 | 53 | private static TDelegate GetExportFunction(IntPtr module, string name) 54 | where TDelegate : class 55 | { 56 | return (TDelegate)((object)GetExportDelegate(module, name)); 57 | } 58 | 59 | private static IntPtr _Handle = IntPtr.Zero; 60 | 61 | public static string GetInstallPath() 62 | { 63 | return (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Valve\Steam", "InstallPath", null); 64 | } 65 | 66 | [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)] 67 | private delegate IntPtr NativeCreateInterface(string version, IntPtr returnCode); 68 | 69 | private static NativeCreateInterface _CallCreateInterface; 70 | 71 | public static TClass CreateInterface(string version) 72 | where TClass : INativeWrapper, new() 73 | { 74 | IntPtr address = _CallCreateInterface(version, IntPtr.Zero); 75 | 76 | if (address == IntPtr.Zero) 77 | { 78 | return default; 79 | } 80 | 81 | TClass instance = new(); 82 | instance.SetupFunctions(address); 83 | return instance; 84 | } 85 | 86 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 87 | [return: MarshalAs(UnmanagedType.I1)] 88 | private delegate bool NativeSteamGetCallback(int pipe, out Types.CallbackMessage message, out int call); 89 | 90 | private static NativeSteamGetCallback _CallSteamBGetCallback; 91 | 92 | public static bool GetCallback(int pipe, out Types.CallbackMessage message, out int call) 93 | { 94 | return _CallSteamBGetCallback(pipe, out message, out call); 95 | } 96 | 97 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 98 | [return: MarshalAs(UnmanagedType.I1)] 99 | private delegate bool NativeSteamFreeLastCallback(int pipe); 100 | 101 | private static NativeSteamFreeLastCallback _CallSteamFreeLastCallback; 102 | 103 | public static bool FreeLastCallback(int pipe) 104 | { 105 | return _CallSteamFreeLastCallback(pipe); 106 | } 107 | 108 | public static bool Load() 109 | { 110 | if (_Handle != IntPtr.Zero) 111 | { 112 | return true; 113 | } 114 | 115 | string path = GetInstallPath(); 116 | if (path == null) 117 | { 118 | return false; 119 | } 120 | 121 | Native.SetDllDirectory(path + ";" + Path.Combine(path, "bin")); 122 | 123 | path = Path.Combine(path, "steamclient.dll"); 124 | IntPtr module = Native.LoadLibraryEx(path, IntPtr.Zero, Native.LoadWithAlteredSearchPath); 125 | if (module == IntPtr.Zero) 126 | { 127 | return false; 128 | } 129 | 130 | _CallCreateInterface = GetExportFunction(module, "CreateInterface"); 131 | if (_CallCreateInterface == null) 132 | { 133 | return false; 134 | } 135 | 136 | _CallSteamBGetCallback = GetExportFunction(module, "Steam_BGetCallback"); 137 | if (_CallSteamBGetCallback == null) 138 | { 139 | return false; 140 | } 141 | 142 | _CallSteamFreeLastCallback = GetExportFunction(module, "Steam_FreeLastCallback"); 143 | if (_CallSteamFreeLastCallback == null) 144 | { 145 | return false; 146 | } 147 | 148 | _Handle = module; 149 | return true; 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /SAM.API/Types/AccountType.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.API.Types 24 | { 25 | public enum AccountType : int 26 | { 27 | Invalid = 0, 28 | Individual = 1, 29 | Multiset = 2, 30 | GameServer = 3, 31 | AnonGameServer = 4, 32 | Pending = 5, 33 | ContentServer = 6, 34 | Clan = 7, 35 | Chat = 8, 36 | P2PSuperSeeder = 9, 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SAM.API/Types/AppDataChanged.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System.Runtime.InteropServices; 24 | 25 | namespace SAM.API.Types 26 | { 27 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 28 | public struct AppDataChanged 29 | { 30 | public uint Id; 31 | public bool Result; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SAM.API/Types/CallbackMessage.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | 26 | namespace SAM.API.Types 27 | { 28 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 29 | public struct CallbackMessage 30 | { 31 | public int User; 32 | public int Id; 33 | public IntPtr ParamPointer; 34 | public int ParamSize; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SAM.API/Types/ItemRequestResult.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.API.Types 24 | { 25 | public enum ItemRequestResult : int 26 | { 27 | InvalidValue = -1, 28 | OK = 0, 29 | Denied = 1, 30 | ServerError = 2, 31 | Timeout = 3, 32 | Invalid = 4, 33 | NoMatch = 5, 34 | UnknownError = 6, 35 | NotLoggedOn = 7, 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /SAM.API/Types/UserItemsReceived.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System.Runtime.InteropServices; 24 | 25 | namespace SAM.API.Types 26 | { 27 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 28 | public struct UserItemsReceived 29 | { 30 | public ulong GameId; 31 | public int Unknown; 32 | public int ItemCount; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SAM.API/Types/UserStatType.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.API.Types 24 | { 25 | public enum UserStatType 26 | { 27 | Invalid = 0, 28 | Integer = 1, 29 | Float = 2, 30 | AverageRate = 3, 31 | Achievements = 4, 32 | GroupAchievements = 5, 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SAM.API/Types/UserStatsReceived.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System.Runtime.InteropServices; 24 | 25 | namespace SAM.API.Types 26 | { 27 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 28 | public struct UserStatsReceived 29 | { 30 | public ulong GameId; 31 | public int Result; 32 | public ulong SteamIdUser; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SAM.API/Types/UserStatsStored.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System.Runtime.InteropServices; 24 | 25 | namespace SAM.API.Types 26 | { 27 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 28 | public struct UserStatsStored 29 | { 30 | public ulong GameId; 31 | public int Result; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SAM.API/Wrappers/SteamApps001.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | using SAM.API.Interfaces; 26 | 27 | namespace SAM.API.Wrappers 28 | { 29 | public class SteamApps001 : NativeWrapper 30 | { 31 | #region GetAppData 32 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 33 | private delegate int NativeGetAppData( 34 | IntPtr self, 35 | uint appId, 36 | IntPtr key, 37 | IntPtr value, 38 | int valueLength); 39 | 40 | public string GetAppData(uint appId, string key) 41 | { 42 | using (var nativeHandle = NativeStrings.StringToStringHandle(key)) 43 | { 44 | const int valueLength = 1024; 45 | var valuePointer = Marshal.AllocHGlobal(valueLength); 46 | int result = this.Call( 47 | this.Functions.GetAppData, 48 | this.ObjectAddress, 49 | appId, 50 | nativeHandle.Handle, 51 | valuePointer, 52 | valueLength); 53 | var value = result == 0 ? null : NativeStrings.PointerToString(valuePointer, valueLength); 54 | Marshal.FreeHGlobal(valuePointer); 55 | return value; 56 | } 57 | } 58 | #endregion 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SAM.API/Wrappers/SteamApps008.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | using SAM.API.Interfaces; 26 | 27 | namespace SAM.API.Wrappers 28 | { 29 | public class SteamApps008 : NativeWrapper 30 | { 31 | #region IsSubscribed 32 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 33 | [return: MarshalAs(UnmanagedType.I1)] 34 | private delegate bool NativeIsSubscribedApp(IntPtr self, uint gameId); 35 | 36 | public bool IsSubscribedApp(uint gameId) 37 | { 38 | return this.Call(this.Functions.IsSubscribedApp, this.ObjectAddress, gameId); 39 | } 40 | #endregion 41 | 42 | #region GetCurrentGameLanguage 43 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 44 | private delegate IntPtr NativeGetCurrentGameLanguage(IntPtr self); 45 | 46 | public string GetCurrentGameLanguage() 47 | { 48 | var languagePointer = this.Call( 49 | this.Functions.GetCurrentGameLanguage, 50 | this.ObjectAddress); 51 | return NativeStrings.PointerToString(languagePointer); 52 | } 53 | #endregion 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /SAM.API/Wrappers/SteamClient018.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | using SAM.API.Interfaces; 26 | 27 | namespace SAM.API.Wrappers 28 | { 29 | public class SteamClient018 : NativeWrapper 30 | { 31 | #region CreateSteamPipe 32 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 33 | private delegate int NativeCreateSteamPipe(IntPtr self); 34 | 35 | public int CreateSteamPipe() 36 | { 37 | return this.Call(this.Functions.CreateSteamPipe, this.ObjectAddress); 38 | } 39 | #endregion 40 | 41 | #region ReleaseSteamPipe 42 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 43 | [return: MarshalAs(UnmanagedType.I1)] 44 | private delegate bool NativeReleaseSteamPipe(IntPtr self, int pipe); 45 | 46 | public bool ReleaseSteamPipe(int pipe) 47 | { 48 | return this.Call(this.Functions.ReleaseSteamPipe, this.ObjectAddress, pipe); 49 | } 50 | #endregion 51 | 52 | #region CreateLocalUser 53 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 54 | private delegate int NativeCreateLocalUser(IntPtr self, ref int pipe, Types.AccountType type); 55 | 56 | public int CreateLocalUser(ref int pipe, Types.AccountType type) 57 | { 58 | var call = this.GetFunction(this.Functions.CreateLocalUser); 59 | return call(this.ObjectAddress, ref pipe, type); 60 | } 61 | #endregion 62 | 63 | #region ConnectToGlobalUser 64 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 65 | private delegate int NativeConnectToGlobalUser(IntPtr self, int pipe); 66 | 67 | public int ConnectToGlobalUser(int pipe) 68 | { 69 | return this.Call( 70 | this.Functions.ConnectToGlobalUser, 71 | this.ObjectAddress, 72 | pipe); 73 | } 74 | #endregion 75 | 76 | #region ReleaseUser 77 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 78 | private delegate void NativeReleaseUser(IntPtr self, int pipe, int user); 79 | 80 | public void ReleaseUser(int pipe, int user) 81 | { 82 | this.Call(this.Functions.ReleaseUser, this.ObjectAddress, pipe, user); 83 | } 84 | #endregion 85 | 86 | #region SetLocalIPBinding 87 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 88 | private delegate void NativeSetLocalIPBinding(IntPtr self, uint host, ushort port); 89 | 90 | public void SetLocalIPBinding(uint host, ushort port) 91 | { 92 | this.Call(this.Functions.SetLocalIPBinding, this.ObjectAddress, host, port); 93 | } 94 | #endregion 95 | 96 | #region GetISteamUser 97 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 98 | private delegate IntPtr NativeGetISteamUser(IntPtr self, int user, int pipe, IntPtr version); 99 | 100 | private TClass GetISteamUser(int user, int pipe, string version) 101 | where TClass : INativeWrapper, new() 102 | { 103 | using (var nativeVersion = NativeStrings.StringToStringHandle(version)) 104 | { 105 | IntPtr address = this.Call( 106 | this.Functions.GetISteamUser, 107 | this.ObjectAddress, 108 | user, 109 | pipe, 110 | nativeVersion.Handle); 111 | TClass result = new(); 112 | result.SetupFunctions(address); 113 | return result; 114 | } 115 | } 116 | #endregion 117 | 118 | #region GetSteamUser012 119 | public SteamUser012 GetSteamUser012(int user, int pipe) 120 | { 121 | return this.GetISteamUser(user, pipe, "SteamUser012"); 122 | } 123 | #endregion 124 | 125 | #region GetISteamUserStats 126 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 127 | private delegate IntPtr NativeGetISteamUserStats(IntPtr self, int user, int pipe, IntPtr version); 128 | 129 | private TClass GetISteamUserStats(int user, int pipe, string version) 130 | where TClass : INativeWrapper, new() 131 | { 132 | using (var nativeVersion = NativeStrings.StringToStringHandle(version)) 133 | { 134 | IntPtr address = this.Call( 135 | this.Functions.GetISteamUserStats, 136 | this.ObjectAddress, 137 | user, 138 | pipe, 139 | nativeVersion.Handle); 140 | TClass result = new(); 141 | result.SetupFunctions(address); 142 | return result; 143 | } 144 | } 145 | #endregion 146 | 147 | #region GetSteamUserStats013 148 | public SteamUserStats013 GetSteamUserStats013(int user, int pipe) 149 | { 150 | return this.GetISteamUserStats(user, pipe, "STEAMUSERSTATS_INTERFACE_VERSION013"); 151 | } 152 | #endregion 153 | 154 | #region GetISteamUtils 155 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 156 | private delegate IntPtr NativeGetISteamUtils(IntPtr self, int pipe, IntPtr version); 157 | 158 | public TClass GetISteamUtils(int pipe, string version) 159 | where TClass : INativeWrapper, new() 160 | { 161 | using (var nativeVersion = NativeStrings.StringToStringHandle(version)) 162 | { 163 | IntPtr address = this.Call( 164 | this.Functions.GetISteamUtils, 165 | this.ObjectAddress, 166 | pipe, 167 | nativeVersion.Handle); 168 | TClass result = new(); 169 | result.SetupFunctions(address); 170 | return result; 171 | } 172 | } 173 | #endregion 174 | 175 | #region GetSteamUtils004 176 | public SteamUtils005 GetSteamUtils004(int pipe) 177 | { 178 | return this.GetISteamUtils(pipe, "SteamUtils005"); 179 | } 180 | #endregion 181 | 182 | #region GetISteamApps 183 | private delegate IntPtr NativeGetISteamApps(int user, int pipe, IntPtr version); 184 | 185 | private TClass GetISteamApps(int user, int pipe, string version) 186 | where TClass : INativeWrapper, new() 187 | { 188 | using (var nativeVersion = NativeStrings.StringToStringHandle(version)) 189 | { 190 | IntPtr address = this.Call( 191 | this.Functions.GetISteamApps, 192 | user, 193 | pipe, 194 | nativeVersion.Handle); 195 | TClass result = new(); 196 | result.SetupFunctions(address); 197 | return result; 198 | } 199 | } 200 | #endregion 201 | 202 | #region GetSteamApps001 203 | public SteamApps001 GetSteamApps001(int user, int pipe) 204 | { 205 | return this.GetISteamApps(user, pipe, "STEAMAPPS_INTERFACE_VERSION001"); 206 | } 207 | #endregion 208 | 209 | #region GetSteamApps008 210 | public SteamApps008 GetSteamApps008(int user, int pipe) 211 | { 212 | return this.GetISteamApps(user, pipe, "STEAMAPPS_INTERFACE_VERSION008"); 213 | } 214 | #endregion 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /SAM.API/Wrappers/SteamUser012.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | using SAM.API.Interfaces; 26 | 27 | namespace SAM.API.Wrappers 28 | { 29 | public class SteamUser012 : NativeWrapper 30 | { 31 | #region IsLoggedIn 32 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 33 | [return: MarshalAs(UnmanagedType.I1)] 34 | private delegate bool NativeLoggedOn(IntPtr self); 35 | 36 | public bool IsLoggedIn() 37 | { 38 | return this.Call(this.Functions.LoggedOn, this.ObjectAddress); 39 | } 40 | #endregion 41 | 42 | #region GetSteamID 43 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 44 | private delegate void NativeGetSteamId(IntPtr self, out ulong steamId); 45 | 46 | public ulong GetSteamId() 47 | { 48 | var call = this.GetFunction(this.Functions.GetSteamID); 49 | ulong steamId; 50 | call(this.ObjectAddress, out steamId); 51 | return steamId; 52 | } 53 | #endregion 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /SAM.API/Wrappers/SteamUserStats013.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | using SAM.API.Interfaces; 26 | 27 | namespace SAM.API.Wrappers 28 | { 29 | public class SteamUserStats013 : NativeWrapper 30 | { 31 | #region GetStatValue (int) 32 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 33 | [return: MarshalAs(UnmanagedType.I1)] 34 | private delegate bool NativeGetStatInt(IntPtr self, IntPtr name, out int data); 35 | 36 | public bool GetStatValue(string name, out int value) 37 | { 38 | using (var nativeName = NativeStrings.StringToStringHandle(name)) 39 | { 40 | var call = this.GetFunction(this.Functions.GetStatInteger); 41 | return call(this.ObjectAddress, nativeName.Handle, out value); 42 | } 43 | } 44 | #endregion 45 | 46 | #region GetStatValue (float) 47 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 48 | [return: MarshalAs(UnmanagedType.I1)] 49 | private delegate bool NativeGetStatFloat(IntPtr self, IntPtr name, out float data); 50 | 51 | public bool GetStatValue(string name, out float value) 52 | { 53 | using (var nativeName = NativeStrings.StringToStringHandle(name)) 54 | { 55 | var call = this.GetFunction(this.Functions.GetStatFloat); 56 | return call(this.ObjectAddress, nativeName.Handle, out value); 57 | } 58 | } 59 | #endregion 60 | 61 | #region SetStatValue (int) 62 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 63 | [return: MarshalAs(UnmanagedType.I1)] 64 | private delegate bool NativeSetStatInt(IntPtr self, IntPtr name, int data); 65 | 66 | public bool SetStatValue(string name, int value) 67 | { 68 | using (var nativeName = NativeStrings.StringToStringHandle(name)) 69 | { 70 | return this.Call( 71 | this.Functions.SetStatInteger, 72 | this.ObjectAddress, 73 | nativeName.Handle, 74 | value); 75 | } 76 | } 77 | #endregion 78 | 79 | #region SetStatValue (float) 80 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 81 | [return: MarshalAs(UnmanagedType.I1)] 82 | private delegate bool NativeSetStatFloat(IntPtr self, IntPtr name, float data); 83 | 84 | public bool SetStatValue(string name, float value) 85 | { 86 | using (var nativeName = NativeStrings.StringToStringHandle(name)) 87 | { 88 | return this.Call( 89 | this.Functions.SetStatFloat, 90 | this.ObjectAddress, 91 | nativeName.Handle, 92 | value); 93 | } 94 | } 95 | #endregion 96 | 97 | #region GetAchievement 98 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 99 | [return: MarshalAs(UnmanagedType.I1)] 100 | private delegate bool NativeGetAchievement( 101 | IntPtr self, 102 | IntPtr name, 103 | [MarshalAs(UnmanagedType.I1)] out bool isAchieved); 104 | 105 | public bool GetAchievement(string name, out bool isAchieved) 106 | { 107 | using (var nativeName = NativeStrings.StringToStringHandle(name)) 108 | { 109 | var call = this.GetFunction(this.Functions.GetAchievement); 110 | return call(this.ObjectAddress, nativeName.Handle, out isAchieved); 111 | } 112 | } 113 | #endregion 114 | 115 | #region SetAchievement 116 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 117 | [return: MarshalAs(UnmanagedType.I1)] 118 | private delegate bool NativeSetAchievement(IntPtr self, IntPtr name); 119 | 120 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 121 | [return: MarshalAs(UnmanagedType.I1)] 122 | private delegate bool NativeClearAchievement(IntPtr self, IntPtr name); 123 | 124 | public bool SetAchievement(string name, bool state) 125 | { 126 | using (var nativeName = NativeStrings.StringToStringHandle(name)) 127 | { 128 | if (state == false) 129 | { 130 | return this.Call( 131 | this.Functions.ClearAchievement, 132 | this.ObjectAddress, 133 | nativeName.Handle); 134 | } 135 | 136 | return this.Call( 137 | this.Functions.SetAchievement, 138 | this.ObjectAddress, 139 | nativeName.Handle); 140 | } 141 | } 142 | #endregion 143 | 144 | #region GetAchievementAndUnlockTime 145 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 146 | [return: MarshalAs(UnmanagedType.I1)] 147 | private delegate bool NativeGetAchievementAndUnlockTime( 148 | IntPtr self, 149 | IntPtr name, 150 | [MarshalAs(UnmanagedType.I1)] out bool isAchieved, 151 | out uint unlockTime); 152 | 153 | public bool GetAchievementAndUnlockTime(string name, out bool isAchieved, out uint unlockTime) 154 | { 155 | using (var nativeName = NativeStrings.StringToStringHandle(name)) 156 | { 157 | var call = this.GetFunction(this.Functions.GetAchievementAndUnlockTime); 158 | return call(this.ObjectAddress, nativeName.Handle, out isAchieved, out unlockTime); 159 | } 160 | } 161 | #endregion 162 | 163 | #region StoreStats 164 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 165 | [return: MarshalAs(UnmanagedType.I1)] 166 | private delegate bool NativeStoreStats(IntPtr self); 167 | 168 | public bool StoreStats() 169 | { 170 | return this.Call(this.Functions.StoreStats, this.ObjectAddress); 171 | } 172 | #endregion 173 | 174 | #region GetAchievementIcon 175 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 176 | private delegate int NativeGetAchievementIcon(IntPtr self, IntPtr name); 177 | 178 | public int GetAchievementIcon(string name) 179 | { 180 | using (var nativeName = NativeStrings.StringToStringHandle(name)) 181 | { 182 | return this.Call( 183 | this.Functions.GetAchievementIcon, 184 | this.ObjectAddress, 185 | nativeName.Handle); 186 | } 187 | } 188 | #endregion 189 | 190 | #region GetAchievementDisplayAttribute 191 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 192 | private delegate IntPtr NativeGetAchievementDisplayAttribute(IntPtr self, IntPtr name, IntPtr key); 193 | 194 | public string GetAchievementDisplayAttribute(string name, string key) 195 | { 196 | using (var nativeName = NativeStrings.StringToStringHandle(name)) 197 | using (var nativeKey = NativeStrings.StringToStringHandle(key)) 198 | { 199 | var result = this.Call( 200 | this.Functions.GetAchievementDisplayAttribute, 201 | this.ObjectAddress, 202 | nativeName.Handle, 203 | nativeKey.Handle); 204 | return NativeStrings.PointerToString(result); 205 | } 206 | } 207 | #endregion 208 | 209 | #region RequestUserStats 210 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 211 | private delegate CallHandle NativeRequestUserStats(IntPtr self, ulong steamIdUser); 212 | 213 | public CallHandle RequestUserStats(ulong steamIdUser) 214 | { 215 | return this.Call(this.Functions.RequestUserStats, this.ObjectAddress, steamIdUser); 216 | } 217 | #endregion 218 | 219 | #region ResetAllStats 220 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 221 | [return: MarshalAs(UnmanagedType.I1)] 222 | private delegate bool NativeResetAllStats(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool achievementsToo); 223 | 224 | public bool ResetAllStats(bool achievementsToo) 225 | { 226 | return this.Call( 227 | this.Functions.ResetAllStats, 228 | this.ObjectAddress, 229 | achievementsToo); 230 | } 231 | #endregion 232 | } 233 | } 234 | -------------------------------------------------------------------------------- /SAM.API/Wrappers/SteamUtils005.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | using SAM.API.Interfaces; 26 | 27 | namespace SAM.API.Wrappers 28 | { 29 | public class SteamUtils005 : NativeWrapper 30 | { 31 | #region GetConnectedUniverse 32 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 33 | private delegate int NativeGetConnectedUniverse(IntPtr self); 34 | 35 | public int GetConnectedUniverse() 36 | { 37 | return this.Call(this.Functions.GetConnectedUniverse, this.ObjectAddress); 38 | } 39 | #endregion 40 | 41 | #region GetIPCountry 42 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 43 | private delegate IntPtr NativeGetIPCountry(IntPtr self); 44 | 45 | public string GetIPCountry() 46 | { 47 | var result = this.Call(this.Functions.GetIPCountry, this.ObjectAddress); 48 | return NativeStrings.PointerToString(result); 49 | } 50 | #endregion 51 | 52 | #region GetImageSize 53 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 54 | [return: MarshalAs(UnmanagedType.I1)] 55 | private delegate bool NativeGetImageSize(IntPtr self, int index, out int width, out int height); 56 | 57 | public bool GetImageSize(int index, out int width, out int height) 58 | { 59 | var call = this.GetFunction(this.Functions.GetImageSize); 60 | return call(this.ObjectAddress, index, out width, out height); 61 | } 62 | #endregion 63 | 64 | #region GetImageRGBA 65 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 66 | [return: MarshalAs(UnmanagedType.I1)] 67 | private delegate bool NativeGetImageRGBA(IntPtr self, int index, byte[] buffer, int length); 68 | 69 | public bool GetImageRGBA(int index, byte[] data) 70 | { 71 | if (data == null) 72 | { 73 | throw new ArgumentNullException("data"); 74 | } 75 | var call = this.GetFunction(this.Functions.GetImageRGBA); 76 | return call(this.ObjectAddress, index, data, data.Length); 77 | } 78 | #endregion 79 | 80 | #region GetAppID 81 | [UnmanagedFunctionPointer(CallingConvention.ThisCall)] 82 | private delegate uint NativeGetAppId(IntPtr self); 83 | 84 | public uint GetAppId() 85 | { 86 | return this.Call(this.Functions.GetAppID, this.ObjectAddress); 87 | } 88 | #endregion 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /SAM.Game/Blank.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Game/Blank.ico -------------------------------------------------------------------------------- /SAM.Game/DoubleBufferedListView.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System.Windows.Forms; 24 | 25 | namespace SAM.Game 26 | { 27 | internal class DoubleBufferedListView : ListView 28 | { 29 | public DoubleBufferedListView() 30 | { 31 | base.DoubleBuffered = true; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SAM.Game/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "SAM.Game.KeyValue.#LoadAsBinary(System.String)")] 2 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "SAM.Game.KeyValue.#ReadAsBinary(System.IO.Stream)")] 3 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "SAM.Game.Manager.#LoadUserGameStatsSchema()")] 4 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "SAM.Game.Manager.#OnIconDownload(System.Object,System.Net.DownloadDataCompletedEventArgs)")] 5 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "SAM.Game.Manager.#OnUserStatsReceived(SAM.API.Types.UserStatsReceived)")] 6 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1064:ExceptionsShouldBePublic", Scope = "type", Target = "SAM.Game.Stats.StatIsProtectedException")] 7 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")] 8 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.ColumnHeader.set_Text(System.String)", Scope = "member", Target = "SAM.Game.Manager.#InitializeComponent()")] 9 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.Control.set_Text(System.String)", Scope = "member", Target = "SAM.Game.Manager.#InitializeComponent()")] 10 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.Form.set_Text(System.String)", Scope = "member", Target = "SAM.Game.Manager.#.ctor(System.Int64,SAM.API.Client)")] 11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Game.Manager.#OnResetAllStats(System.Object,System.EventArgs)")] 12 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Game.Manager.#OnUserStatsReceived(SAM.API.Types.UserStatsReceived)")] 13 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Game.Program.#Main(System.String[])")] 14 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window,System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Game.Manager.#OnCheckAchievement(System.Object,System.Windows.Forms.ItemCheckEventArgs)")] 15 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window,System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Game.Manager.#OnResetAllStats(System.Object,System.EventArgs)")] 16 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window,System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Game.Manager.#OnStore(System.Object,System.EventArgs)")] 17 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window,System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Game.Manager.#RefreshStats()")] 18 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window,System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Game.Manager.#Store()")] 19 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window,System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Game.Manager.#StoreAchievements()")] 20 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window,System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Game.Manager.#StoreStatistics()")] 21 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.ToolStripItem.set_Text(System.String)", Scope = "member", Target = "SAM.Game.Manager.#DownloadNextIcon()")] 22 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.ToolStripItem.set_Text(System.String)", Scope = "member", Target = "SAM.Game.Manager.#InitializeComponent()")] 23 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.ToolStripItem.set_Text(System.String)", Scope = "member", Target = "SAM.Game.Manager.#OnUserStatsReceived(SAM.API.Types.UserStatsReceived)")] 24 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.ToolStripItem.set_Text(System.String)", Scope = "member", Target = "SAM.Game.Manager.#RefreshStats()")] 25 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.ToolStripItem.set_ToolTipText(System.String)", Scope = "member", Target = "SAM.Game.Manager.#InitializeComponent()")] 26 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1309:UseOrdinalStringComparison", MessageId = "System.String.StartsWith(System.String,System.StringComparison)", Scope = "member", Target = "SAM.Game.Manager.#GetAchievements()")] 27 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "wstring", Scope = "member", Target = "SAM.Game.KeyValue.#ReadAsBinary(System.IO.Stream)")] 28 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "member", Target = "SAM.Game.Manager.#GetStatistics()")] 29 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "member", Target = "SAM.Game.Manager.#StoreStatistics()")] 30 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "SAM.Game.Stats.AchievementInfo.#ImageIndex")] 31 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "SAM.Game.Stats.StatInfo.#DisplayName")] 32 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "SAM.Game.Stats.StatInfo.#Extra")] 33 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "SAM.Game.Stats.StatInfo.#IsIncrementOnly")] 34 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "SAM.Game.Stats.StatIsProtectedException.#.ctor(System.String)")] 35 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "SAM.Game.Stats.StatIsProtectedException.#.ctor(System.String,System.Exception)")] 36 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "SAM.Game.StreamHelpers.#ReadStringAscii(System.IO.Stream)")] 37 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "SAM.Game.Stats.AchievementDefinition.#IsHidden")] 38 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "SAM.Game.Stats.FloatStatDefinition.#DefaultValue")] 39 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "SAM.Game.Stats.FloatStatDefinition.#MaxChange")] 40 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "SAM.Game.Stats.FloatStatDefinition.#MaxValue")] 41 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "SAM.Game.Stats.FloatStatDefinition.#MinValue")] 42 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "SAM.Game.Stats.IntegerStatDefinition.#DefaultValue")] 43 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "SAM.Game.Stats.IntegerStatDefinition.#MaxChange")] 44 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "SAM.Game.Stats.IntegerStatDefinition.#MaxValue")] 45 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "SAM.Game.Stats.IntegerStatDefinition.#MinValue")] 46 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "SAM.Game.Manager.#.ctor(System.Int64,SAM.API.Client)")] 47 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "SAM.Game.Manager.#InitializeComponent()")] 48 | -------------------------------------------------------------------------------- /SAM.Game/InvariantShorthand.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | 25 | namespace SAM.Game 26 | { 27 | public static class InvariantShorthand 28 | { 29 | public static string _(FormattableString formattable) 30 | { 31 | return FormattableString.Invariant(formattable); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SAM.Game/KeyValue.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Collections.Generic; 25 | using System.IO; 26 | using System.Linq; 27 | 28 | namespace SAM.Game 29 | { 30 | internal class KeyValue 31 | { 32 | private static readonly KeyValue _Invalid = new(); 33 | public string Name = ""; 34 | public KeyValueType Type = KeyValueType.None; 35 | public object Value; 36 | public bool Valid; 37 | 38 | public List Children = null; 39 | 40 | public KeyValue this[string key] 41 | { 42 | get 43 | { 44 | if (this.Children == null) 45 | { 46 | return _Invalid; 47 | } 48 | 49 | var child = this.Children.SingleOrDefault( 50 | c => string.Compare(c.Name, key, StringComparison.InvariantCultureIgnoreCase) == 0); 51 | 52 | if (child == null) 53 | { 54 | return _Invalid; 55 | } 56 | 57 | return child; 58 | } 59 | } 60 | 61 | public string AsString(string defaultValue) 62 | { 63 | if (this.Valid == false) 64 | { 65 | return defaultValue; 66 | } 67 | 68 | if (this.Value == null) 69 | { 70 | return defaultValue; 71 | } 72 | 73 | return this.Value.ToString(); 74 | } 75 | 76 | public int AsInteger(int defaultValue) 77 | { 78 | if (this.Valid == false) 79 | { 80 | return defaultValue; 81 | } 82 | 83 | switch (this.Type) 84 | { 85 | case KeyValueType.String: 86 | case KeyValueType.WideString: 87 | { 88 | return int.TryParse((string)this.Value, out int value) == false 89 | ? defaultValue 90 | : value; 91 | } 92 | 93 | case KeyValueType.Int32: 94 | { 95 | return (int)this.Value; 96 | } 97 | 98 | case KeyValueType.Float32: 99 | { 100 | return (int)((float)this.Value); 101 | } 102 | 103 | case KeyValueType.UInt64: 104 | { 105 | return (int)((ulong)this.Value & 0xFFFFFFFF); 106 | } 107 | } 108 | 109 | return defaultValue; 110 | } 111 | 112 | public float AsFloat(float defaultValue) 113 | { 114 | if (this.Valid == false) 115 | { 116 | return defaultValue; 117 | } 118 | 119 | switch (this.Type) 120 | { 121 | case KeyValueType.String: 122 | case KeyValueType.WideString: 123 | { 124 | return float.TryParse((string)this.Value, out float value) == false 125 | ? defaultValue 126 | : value; 127 | } 128 | 129 | case KeyValueType.Int32: 130 | { 131 | return (int)this.Value; 132 | } 133 | 134 | case KeyValueType.Float32: 135 | { 136 | return (float)this.Value; 137 | } 138 | 139 | case KeyValueType.UInt64: 140 | { 141 | return (ulong)this.Value & 0xFFFFFFFF; 142 | } 143 | } 144 | 145 | return defaultValue; 146 | } 147 | 148 | public bool AsBoolean(bool defaultValue) 149 | { 150 | if (this.Valid == false) 151 | { 152 | return defaultValue; 153 | } 154 | 155 | switch (this.Type) 156 | { 157 | case KeyValueType.String: 158 | case KeyValueType.WideString: 159 | { 160 | return int.TryParse((string)this.Value, out int value) == false 161 | ? defaultValue 162 | : value != 0; 163 | } 164 | 165 | case KeyValueType.Int32: 166 | { 167 | return ((int)this.Value) != 0; 168 | } 169 | 170 | case KeyValueType.Float32: 171 | { 172 | return ((int)((float)this.Value)) != 0; 173 | } 174 | 175 | case KeyValueType.UInt64: 176 | { 177 | return ((ulong)this.Value) != 0; 178 | } 179 | } 180 | 181 | return defaultValue; 182 | } 183 | 184 | public override string ToString() 185 | { 186 | if (this.Valid == false) 187 | { 188 | return ""; 189 | } 190 | 191 | if (this.Type == KeyValueType.None) 192 | { 193 | return this.Name; 194 | } 195 | 196 | return $"{this.Name} = {this.Value}"; 197 | } 198 | 199 | public static KeyValue LoadAsBinary(string path) 200 | { 201 | if (File.Exists(path) == false) 202 | { 203 | return null; 204 | } 205 | 206 | try 207 | { 208 | using (var input = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) 209 | { 210 | KeyValue kv = new(); 211 | if (kv.ReadAsBinary(input) == false) 212 | { 213 | return null; 214 | } 215 | return kv; 216 | } 217 | } 218 | catch (Exception) 219 | { 220 | return null; 221 | } 222 | } 223 | 224 | public bool ReadAsBinary(Stream input) 225 | { 226 | this.Children = new(); 227 | try 228 | { 229 | while (true) 230 | { 231 | var type = (KeyValueType)input.ReadValueU8(); 232 | 233 | if (type == KeyValueType.End) 234 | { 235 | break; 236 | } 237 | 238 | KeyValue current = new() 239 | { 240 | Type = type, 241 | Name = input.ReadStringUnicode(), 242 | }; 243 | 244 | switch (type) 245 | { 246 | case KeyValueType.None: 247 | { 248 | current.ReadAsBinary(input); 249 | break; 250 | } 251 | 252 | case KeyValueType.String: 253 | { 254 | current.Valid = true; 255 | current.Value = input.ReadStringUnicode(); 256 | break; 257 | } 258 | 259 | case KeyValueType.WideString: 260 | { 261 | throw new FormatException("wstring is unsupported"); 262 | } 263 | 264 | case KeyValueType.Int32: 265 | { 266 | current.Valid = true; 267 | current.Value = input.ReadValueS32(); 268 | break; 269 | } 270 | 271 | case KeyValueType.UInt64: 272 | { 273 | current.Valid = true; 274 | current.Value = input.ReadValueU64(); 275 | break; 276 | } 277 | 278 | case KeyValueType.Float32: 279 | { 280 | current.Valid = true; 281 | current.Value = input.ReadValueF32(); 282 | break; 283 | } 284 | 285 | case KeyValueType.Color: 286 | { 287 | current.Valid = true; 288 | current.Value = input.ReadValueU32(); 289 | break; 290 | } 291 | 292 | case KeyValueType.Pointer: 293 | { 294 | current.Valid = true; 295 | current.Value = input.ReadValueU32(); 296 | break; 297 | } 298 | 299 | default: 300 | { 301 | throw new FormatException(); 302 | } 303 | } 304 | 305 | if (input.Position >= input.Length) 306 | { 307 | throw new FormatException(); 308 | } 309 | 310 | this.Children.Add(current); 311 | } 312 | 313 | this.Valid = true; 314 | return input.Position == input.Length; 315 | } 316 | catch (Exception) 317 | { 318 | return false; 319 | } 320 | } 321 | } 322 | } 323 | -------------------------------------------------------------------------------- /SAM.Game/KeyValueType.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.Game 24 | { 25 | internal enum KeyValueType : byte 26 | { 27 | None = 0, 28 | String = 1, 29 | Int32 = 2, 30 | Float32 = 3, 31 | Pointer = 4, 32 | WideString = 5, 33 | Color = 6, 34 | UInt64 = 7, 35 | End = 8, 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /SAM.Game/LICENSE.txt: -------------------------------------------------------------------------------- 1 | zlib License 2 | 3 | Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. -------------------------------------------------------------------------------- /SAM.Game/Manager.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | False 122 | 123 | 124 | False 125 | 126 | 127 | 17, 17 128 | 129 | 130 | 352, 20 131 | 132 | 133 | 230, 17 134 | 135 | 136 | 502, 20 137 | 138 | 139 | 628, 20 140 | 141 | 142 | 143 | 144 | AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 145 | AADAgP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 146 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 147 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 148 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 149 | AAAAAAAAAAAAAAAAAAAAAAAA 150 | 151 | 152 | -------------------------------------------------------------------------------- /SAM.Game/Program.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Diagnostics; 25 | using System.Windows.Forms; 26 | 27 | namespace SAM.Game 28 | { 29 | internal static class Program 30 | { 31 | [STAThread] 32 | public static void Main(string[] args) 33 | { 34 | long appId; 35 | 36 | if (args.Length == 0) 37 | { 38 | Process.Start("SAM.Picker.exe"); 39 | return; 40 | } 41 | 42 | if (long.TryParse(args[0], out appId) == false) 43 | { 44 | MessageBox.Show( 45 | "Could not parse application ID from command line argument.", 46 | "Error", 47 | MessageBoxButtons.OK, 48 | MessageBoxIcon.Error); 49 | return; 50 | } 51 | 52 | if (API.Steam.GetInstallPath() == Application.StartupPath) 53 | { 54 | MessageBox.Show( 55 | "This tool declines to being run from the Steam directory.", 56 | "Error", 57 | MessageBoxButtons.OK, 58 | MessageBoxIcon.Error); 59 | return; 60 | } 61 | 62 | using (API.Client client = new()) 63 | { 64 | try 65 | { 66 | client.Initialize(appId); 67 | } 68 | catch (API.ClientInitializeException e) 69 | { 70 | if (e.Failure == API.ClientInitializeFailure.ConnectToGlobalUser) 71 | { 72 | MessageBox.Show( 73 | "Steam is not running. Please start Steam then run this tool again.\n\n" + 74 | "If you have the game through Family Share, the game may be locked due to\n" + 75 | "the Family Share account actively playing a game.\n\n" + 76 | "(" + e.Message + ")", 77 | "Error", 78 | MessageBoxButtons.OK, 79 | MessageBoxIcon.Error); 80 | } 81 | else if (string.IsNullOrEmpty(e.Message) == false) 82 | { 83 | MessageBox.Show( 84 | "Steam is not running. Please start Steam then run this tool again.\n\n" + 85 | "(" + e.Message + ")", 86 | "Error", 87 | MessageBoxButtons.OK, 88 | MessageBoxIcon.Error); 89 | } 90 | else 91 | { 92 | MessageBox.Show( 93 | "Steam is not running. Please start Steam then run this tool again.", 94 | "Error", 95 | MessageBoxButtons.OK, 96 | MessageBoxIcon.Error); 97 | } 98 | return; 99 | } 100 | catch (DllNotFoundException) 101 | { 102 | MessageBox.Show( 103 | "You've caused an exceptional error!", 104 | "Error", 105 | MessageBoxButtons.OK, 106 | MessageBoxIcon.Error); 107 | return; 108 | } 109 | 110 | Application.EnableVisualStyles(); 111 | Application.SetCompatibleTextRenderingDefault(false); 112 | Application.Run(new Manager(appId, client)); 113 | } 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /SAM.Game/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SAM.Game { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SAM.Game.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap Download { 67 | get { 68 | object obj = ResourceManager.GetObject("Download", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap Invert { 77 | get { 78 | object obj = ResourceManager.GetObject("Invert", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap Lock { 87 | get { 88 | object obj = ResourceManager.GetObject("Lock", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap Refresh { 97 | get { 98 | object obj = ResourceManager.GetObject("Refresh", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap Reset { 107 | get { 108 | object obj = ResourceManager.GetObject("Reset", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Drawing.Bitmap. 115 | /// 116 | internal static System.Drawing.Bitmap Sad { 117 | get { 118 | object obj = ResourceManager.GetObject("Sad", resourceCulture); 119 | return ((System.Drawing.Bitmap)(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Drawing.Bitmap. 125 | /// 126 | internal static System.Drawing.Bitmap Save { 127 | get { 128 | object obj = ResourceManager.GetObject("Save", resourceCulture); 129 | return ((System.Drawing.Bitmap)(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Drawing.Bitmap. 135 | /// 136 | internal static System.Drawing.Bitmap Unlock { 137 | get { 138 | object obj = ResourceManager.GetObject("Unlock", resourceCulture); 139 | return ((System.Drawing.Bitmap)(obj)); 140 | } 141 | } 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /SAM.Game/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | Resources\lock.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | Resources\arrow-circle-double.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | Resources\lock-unlock.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | Resources\bomb.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | Resources\lock--pencil.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | Resources\transmitter.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | Resources\poop-smiley-sad-enlarged.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 141 | 142 | 143 | Resources\download-cloud.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 144 | 145 | -------------------------------------------------------------------------------- /SAM.Game/Resources/arrow-circle-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Game/Resources/arrow-circle-double.png -------------------------------------------------------------------------------- /SAM.Game/Resources/bomb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Game/Resources/bomb.png -------------------------------------------------------------------------------- /SAM.Game/Resources/download-cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Game/Resources/download-cloud.png -------------------------------------------------------------------------------- /SAM.Game/Resources/lock--pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Game/Resources/lock--pencil.png -------------------------------------------------------------------------------- /SAM.Game/Resources/lock-unlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Game/Resources/lock-unlock.png -------------------------------------------------------------------------------- /SAM.Game/Resources/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Game/Resources/lock.png -------------------------------------------------------------------------------- /SAM.Game/Resources/poop-smiley-sad-enlarged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Game/Resources/poop-smiley-sad-enlarged.png -------------------------------------------------------------------------------- /SAM.Game/Resources/poop-smiley-sad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Game/Resources/poop-smiley-sad.png -------------------------------------------------------------------------------- /SAM.Game/Resources/transmitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Game/Resources/transmitter.png -------------------------------------------------------------------------------- /SAM.Game/SAM.Game.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Steam Achievement Manager 4 | Gibbed 5 | Gibbed 6 | A manager for game achievements in Steam. 7 | Copyright © Gibbed 2019 8 | 9 | 10 | 7.0.0 11 | 7.0.0.0 12 | 7.0.0.0 13 | 14 | 15 | Blank.ico 16 | app.manifest 17 | 18 | 19 | https://github.com/gibbed/SteamAchievementManager/ 20 | Git 21 | 22 | 23 | WinExe 24 | net48 25 | 9.0 26 | x86 27 | false 28 | 29 | 30 | ..\bin\ 31 | 32 | 33 | ..\upload\ 34 | false 35 | 36 | 37 | 38 | 39 | 40 | 41 | Component 42 | 43 | 44 | Form 45 | 46 | 47 | True 48 | Resources.resx 49 | True 50 | 51 | 52 | ResXFileCodeGenerator 53 | Resources.Designer.cs 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /SAM.Game/SAM.Game.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | No -------------------------------------------------------------------------------- /SAM.Game/Stats/AchievementDefinition.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.Game.Stats 24 | { 25 | internal class AchievementDefinition 26 | { 27 | public string Id; 28 | public string Name; 29 | public string Description; 30 | public string IconNormal; 31 | public string IconLocked; 32 | public bool IsHidden; 33 | public int Permission; 34 | 35 | public override string ToString() 36 | { 37 | return $"{this.Name ?? this.Id ?? base.ToString()}: {this.Permission}"; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SAM.Game/Stats/AchievementInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Windows.Forms; 25 | 26 | namespace SAM.Game.Stats 27 | { 28 | internal class AchievementInfo 29 | { 30 | public string Id; 31 | public bool IsAchieved; 32 | public DateTime? UnlockTime; 33 | public int Permission; 34 | public string IconNormal; 35 | public string IconLocked; 36 | public string Name; 37 | public string Description; 38 | public ListViewItem Item; 39 | 40 | #region public int ImageIndex; 41 | public int ImageIndex 42 | { 43 | get => this.Item.ImageIndex; 44 | set => this.Item.ImageIndex = value; 45 | } 46 | #endregion 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SAM.Game/Stats/FloatStatDefinition.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.Game.Stats 24 | { 25 | internal class FloatStatDefinition : StatDefinition 26 | { 27 | public float MinValue; 28 | public float MaxValue; 29 | public float MaxChange; 30 | public bool IncrementOnly; 31 | public float DefaultValue; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SAM.Game/Stats/FloatStatInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.Game.Stats 24 | { 25 | internal class FloatStatInfo : StatInfo 26 | { 27 | public float OriginalValue; 28 | public float FloatValue; 29 | 30 | public override object Value 31 | { 32 | get => this.FloatValue; 33 | set 34 | { 35 | var f = float.Parse((string)value, System.Globalization.CultureInfo.CurrentCulture); 36 | if ((this.Permission & 2) != 0 && 37 | this.FloatValue.Equals(f) == false) 38 | { 39 | throw new StatIsProtectedException(); 40 | } 41 | this.FloatValue = f; 42 | } 43 | } 44 | 45 | public override bool IsModified => this.FloatValue.Equals(this.OriginalValue) == false; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /SAM.Game/Stats/IntStatInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.Game.Stats 24 | { 25 | internal class IntStatInfo : StatInfo 26 | { 27 | public int OriginalValue; 28 | public int IntValue; 29 | 30 | public override object Value 31 | { 32 | get => this.IntValue; 33 | set 34 | { 35 | var i = int.Parse((string)value, System.Globalization.CultureInfo.CurrentCulture); 36 | if ((this.Permission & 2) != 0 && 37 | this.IntValue != i) 38 | { 39 | throw new StatIsProtectedException(); 40 | } 41 | this.IntValue = i; 42 | } 43 | } 44 | 45 | public override bool IsModified => this.IntValue != this.OriginalValue; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /SAM.Game/Stats/IntegerStatDefinition.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.Game.Stats 24 | { 25 | internal class IntegerStatDefinition : StatDefinition 26 | { 27 | public int MinValue; 28 | public int MaxValue; 29 | public int MaxChange; 30 | public bool IncrementOnly; 31 | public bool SetByTrustedGameServer; 32 | public int DefaultValue; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SAM.Game/Stats/StatDefinition.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.Game.Stats 24 | { 25 | internal abstract class StatDefinition 26 | { 27 | public string Id; 28 | public string DisplayName; 29 | public int Permission; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SAM.Game/Stats/StatFlags.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | 25 | namespace SAM.Game.Stats 26 | { 27 | [Flags] 28 | internal enum StatFlags 29 | { 30 | None = 0, 31 | IncrementOnly = 1 << 0, 32 | Protected = 1 << 1, 33 | UnknownPermission = 1 << 2, 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SAM.Game/Stats/StatInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | namespace SAM.Game.Stats 24 | { 25 | internal abstract class StatInfo 26 | { 27 | public abstract bool IsModified { get; } 28 | public string Id { get; set; } 29 | public string DisplayName { get; set; } 30 | public abstract object Value { get; set; } 31 | public bool IsIncrementOnly { get; set; } 32 | public int Permission { get; set; } 33 | 34 | public string Extra 35 | { 36 | get 37 | { 38 | var flags = StatFlags.None; 39 | flags |= this.IsIncrementOnly == false ? 0 : StatFlags.IncrementOnly; 40 | flags |= ((this.Permission & 2) != 0) == false ? 0 : StatFlags.Protected; 41 | flags |= ((this.Permission & ~2) != 0) == false ? 0 : StatFlags.UnknownPermission; 42 | return flags.ToString(); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /SAM.Game/Stats/StatIsProtectedException.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.Serialization; 25 | 26 | namespace SAM.Game.Stats 27 | { 28 | [Serializable] 29 | internal class StatIsProtectedException : Exception 30 | { 31 | public StatIsProtectedException() 32 | { 33 | } 34 | 35 | public StatIsProtectedException(string message) 36 | : base(message) 37 | { 38 | } 39 | 40 | public StatIsProtectedException(string message, Exception innerException) 41 | : base(message, innerException) 42 | { 43 | } 44 | 45 | protected StatIsProtectedException(SerializationInfo info, StreamingContext context) 46 | : base(info, context) 47 | { 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /SAM.Game/StreamHelpers.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Diagnostics; 25 | using System.Globalization; 26 | using System.IO; 27 | using System.Text; 28 | 29 | namespace SAM.Game 30 | { 31 | internal static class StreamHelpers 32 | { 33 | public static byte ReadValueU8(this Stream stream) 34 | { 35 | return (byte)stream.ReadByte(); 36 | } 37 | 38 | public static int ReadValueS32(this Stream stream) 39 | { 40 | var data = new byte[4]; 41 | int read = stream.Read(data, 0, 4); 42 | Debug.Assert(read == 4); 43 | return BitConverter.ToInt32(data, 0); 44 | } 45 | 46 | public static uint ReadValueU32(this Stream stream) 47 | { 48 | var data = new byte[4]; 49 | int read = stream.Read(data, 0, 4); 50 | Debug.Assert(read == 4); 51 | return BitConverter.ToUInt32(data, 0); 52 | } 53 | 54 | public static ulong ReadValueU64(this Stream stream) 55 | { 56 | var data = new byte[8]; 57 | int read = stream.Read(data, 0, 8); 58 | Debug.Assert(read == 8); 59 | return BitConverter.ToUInt64(data, 0); 60 | } 61 | 62 | public static float ReadValueF32(this Stream stream) 63 | { 64 | var data = new byte[4]; 65 | int read = stream.Read(data, 0, 4); 66 | Debug.Assert(read == 4); 67 | return BitConverter.ToSingle(data, 0); 68 | } 69 | 70 | internal static string ReadStringInternalDynamic(this Stream stream, Encoding encoding, char end) 71 | { 72 | int characterSize = encoding.GetByteCount("e"); 73 | Debug.Assert(characterSize == 1 || characterSize == 2 || characterSize == 4); 74 | string characterEnd = end.ToString(CultureInfo.InvariantCulture); 75 | 76 | int i = 0; 77 | var data = new byte[128 * characterSize]; 78 | 79 | while (true) 80 | { 81 | if (i + characterSize > data.Length) 82 | { 83 | Array.Resize(ref data, data.Length + (128 * characterSize)); 84 | } 85 | 86 | int read = stream.Read(data, i, characterSize); 87 | Debug.Assert(read == characterSize); 88 | 89 | if (encoding.GetString(data, i, characterSize) == characterEnd) 90 | { 91 | break; 92 | } 93 | 94 | i += characterSize; 95 | } 96 | 97 | if (i == 0) 98 | { 99 | return ""; 100 | } 101 | 102 | return encoding.GetString(data, 0, i); 103 | } 104 | 105 | public static string ReadStringAscii(this Stream stream) 106 | { 107 | return stream.ReadStringInternalDynamic(Encoding.ASCII, '\0'); 108 | } 109 | 110 | public static string ReadStringUnicode(this Stream stream) 111 | { 112 | return stream.ReadStringInternalDynamic(Encoding.UTF8, '\0'); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /SAM.Game/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /SAM.Game/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | true 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /SAM.Picker/GameInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System.Globalization; 24 | using System.Windows.Forms; 25 | 26 | namespace SAM.Picker 27 | { 28 | internal class GameInfo 29 | { 30 | private string _Name; 31 | 32 | public uint Id; 33 | public string Type; 34 | public int ImageIndex; 35 | 36 | public string Name 37 | { 38 | get => this._Name; 39 | set => this._Name = value ?? "App " + this.Id.ToString(CultureInfo.InvariantCulture); 40 | } 41 | 42 | public string ImageUrl; 43 | 44 | public ListViewItem Item; 45 | 46 | public GameInfo(uint id, string type) 47 | { 48 | this.Id = id; 49 | this.Type = type; 50 | this.Name = null; 51 | this.ImageIndex = 0; 52 | this.ImageUrl = null; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /SAM.Picker/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "SAM.Picker.GamePicker.#DoDownloadLogo(System.Object,System.ComponentModel.DoWorkEventArgs)")] 2 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")] 3 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.Control.set_Text(System.String)", Scope = "member", Target = "SAM.Picker.GamePicker.#InitializeComponent()")] 4 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Picker.Program.#Main()")] 5 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window,System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Picker.GamePicker.#OnActivateGame(System.Object,System.EventArgs)")] 6 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window,System.String,System.String,System.Windows.Forms.MessageBoxButtons,System.Windows.Forms.MessageBoxIcon)", Scope = "member", Target = "SAM.Picker.GamePicker.#OnAddGame(System.Object,System.EventArgs)")] 7 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.ToolStripItem.set_Text(System.String)", Scope = "member", Target = "SAM.Picker.GamePicker.#DownloadNextLogo()")] 8 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.ToolStripItem.set_Text(System.String)", Scope = "member", Target = "SAM.Picker.GamePicker.#InitializeComponent()")] 9 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "System.Windows.Forms.ToolStripItem.set_Text(System.String)", Scope = "member", Target = "SAM.Picker.GamePicker.#RefreshGames()")] 10 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "statusStrip", Scope = "member", Target = "SAM.Picker.GamePicker.#InitializeComponent()")] 11 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "SAM.Picker.GamePicker.#.ctor(SAM.API.Client)")] 12 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "SAM.Picker.GamePicker.#InitializeComponent()")] 13 | -------------------------------------------------------------------------------- /SAM.Picker/InvariantShorthand.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | 25 | namespace SAM.Picker 26 | { 27 | internal static class InvariantShorthand 28 | { 29 | public static string _(FormattableString formattable) 30 | { 31 | return FormattableString.Invariant(formattable); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SAM.Picker/LICENSE.txt: -------------------------------------------------------------------------------- 1 | zlib License 2 | 3 | Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. -------------------------------------------------------------------------------- /SAM.Picker/LogoInfo.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System.Drawing; 24 | 25 | namespace SAM.Picker 26 | { 27 | internal class LogoInfo 28 | { 29 | public readonly uint Id; 30 | public readonly Bitmap Bitmap; 31 | 32 | public LogoInfo(uint id, Bitmap bitmap) 33 | { 34 | this.Id = id; 35 | this.Bitmap = bitmap; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SAM.Picker/MyListView.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Runtime.InteropServices; 25 | using System.Windows.Forms; 26 | 27 | namespace SAM.Picker 28 | { 29 | internal class MyListView : ListView 30 | { 31 | public event ScrollEventHandler Scroll; 32 | 33 | public MyListView() 34 | { 35 | base.DoubleBuffered = true; 36 | } 37 | 38 | protected virtual void OnScroll(ScrollEventArgs e) 39 | { 40 | this.Scroll?.Invoke(this, e); 41 | } 42 | 43 | protected override void WndProc(ref Message m) 44 | { 45 | base.WndProc(ref m); 46 | 47 | switch (m.Msg) 48 | { 49 | case 0x0100: // WM_KEYDOWN 50 | { 51 | ScrollEventType type; 52 | if (TranslateKeyScrollEvent((Keys)m.WParam.ToInt32(), out type) == true) 53 | { 54 | this.OnScroll(new(type, Win32.GetScrollPos(this.Handle, 1 /*SB_VERT*/))); 55 | } 56 | break; 57 | } 58 | 59 | case 0x0115: // WM_VSCROLL 60 | case 0x020A: // WM_MOUSEWHEEL 61 | { 62 | this.OnScroll(new(ScrollEventType.EndScroll, Win32.GetScrollPos(this.Handle, 1 /*SB_VERT*/))); 63 | break; 64 | } 65 | } 66 | } 67 | 68 | private static bool TranslateKeyScrollEvent(Keys keys, out ScrollEventType type) 69 | { 70 | switch (keys) 71 | { 72 | case Keys.Down: 73 | { 74 | type = ScrollEventType.SmallIncrement; 75 | return true; 76 | } 77 | 78 | case Keys.Up: 79 | { 80 | type = ScrollEventType.SmallDecrement; 81 | return true; 82 | } 83 | 84 | case Keys.PageDown: 85 | { 86 | type = ScrollEventType.LargeIncrement; 87 | return true; 88 | } 89 | 90 | case Keys.PageUp: 91 | { 92 | type = ScrollEventType.SmallDecrement; 93 | return true; 94 | } 95 | 96 | case Keys.Home: 97 | { 98 | type = ScrollEventType.First; 99 | return true; 100 | } 101 | 102 | case Keys.End: 103 | { 104 | type = ScrollEventType.Last; 105 | return true; 106 | } 107 | } 108 | 109 | type = default; 110 | return false; 111 | } 112 | 113 | private static class Win32 114 | { 115 | [DllImport("user32.dll", SetLastError = true)] 116 | public static extern int GetScrollPos(IntPtr hWnd, int nBar); 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /SAM.Picker/Program.cs: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2024 Rick (rick 'at' gibbed 'dot' us) 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would 14 | * be appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not 17 | * be misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source 20 | * distribution. 21 | */ 22 | 23 | using System; 24 | using System.Windows.Forms; 25 | 26 | namespace SAM.Picker 27 | { 28 | internal static class Program 29 | { 30 | [STAThread] 31 | private static void Main() 32 | { 33 | if (API.Steam.GetInstallPath() == Application.StartupPath) 34 | { 35 | MessageBox.Show( 36 | "This tool declines to being run from the Steam directory.", 37 | "Error", 38 | MessageBoxButtons.OK, 39 | MessageBoxIcon.Error); 40 | return; 41 | } 42 | 43 | using (API.Client client = new()) 44 | { 45 | try 46 | { 47 | client.Initialize(0); 48 | } 49 | catch (API.ClientInitializeException e) 50 | { 51 | if (string.IsNullOrEmpty(e.Message) == false) 52 | { 53 | MessageBox.Show( 54 | "Steam is not running. Please start Steam then run this tool again.\n\n" + 55 | "(" + e.Message + ")", 56 | "Error", 57 | MessageBoxButtons.OK, 58 | MessageBoxIcon.Error); 59 | } 60 | else 61 | { 62 | MessageBox.Show( 63 | "Steam is not running. Please start Steam then run this tool again.", 64 | "Error", 65 | MessageBoxButtons.OK, 66 | MessageBoxIcon.Error); 67 | } 68 | return; 69 | } 70 | catch (DllNotFoundException) 71 | { 72 | MessageBox.Show( 73 | "You've caused an exceptional error!", 74 | "Error", 75 | MessageBoxButtons.OK, 76 | MessageBoxIcon.Error); 77 | return; 78 | } 79 | 80 | Application.EnableVisualStyles(); 81 | Application.SetCompatibleTextRenderingDefault(false); 82 | Application.Run(new GamePicker(client)); 83 | } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /SAM.Picker/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SAM.Picker { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SAM.Picker.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap Download { 67 | get { 68 | object obj = ResourceManager.GetObject("Download", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap Filter { 77 | get { 78 | object obj = ResourceManager.GetObject("Filter", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap Refresh { 87 | get { 88 | object obj = ResourceManager.GetObject("Refresh", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap Search { 97 | get { 98 | object obj = ResourceManager.GetObject("Search", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /SAM.Picker/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | Resources\arrow-circle-double.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | Resources\television-test.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | Resources\magnifier.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | Resources\download-cloud.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | -------------------------------------------------------------------------------- /SAM.Picker/Resources/arrow-circle-double.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Picker/Resources/arrow-circle-double.png -------------------------------------------------------------------------------- /SAM.Picker/Resources/download-cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Picker/Resources/download-cloud.png -------------------------------------------------------------------------------- /SAM.Picker/Resources/magnifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Picker/Resources/magnifier.png -------------------------------------------------------------------------------- /SAM.Picker/Resources/television-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Picker/Resources/television-test.png -------------------------------------------------------------------------------- /SAM.Picker/SAM.Picker.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Steam Achievement Manager Picker 4 | Gibbed 5 | Gibbed 6 | A game picker for the Steam Achievement Manager. 7 | Copyright © Gibbed 2019 8 | 9 | 10 | 7.0.0 11 | 7.0.0.0 12 | 7.0.0.0 13 | 14 | 15 | SAM.ico 16 | app.manifest 17 | 18 | 19 | https://github.com/gibbed/SteamAchievementManager/ 20 | Git 21 | 22 | 23 | WinExe 24 | net48 25 | 9.0 26 | x86 27 | false 28 | 29 | 30 | ..\bin\ 31 | 32 | 33 | ..\upload\ 34 | false 35 | 36 | 37 | 38 | 39 | 40 | 41 | Component 42 | 43 | 44 | Form 45 | 46 | 47 | ResXFileCodeGenerator 48 | Resources.Designer.cs 49 | 50 | 51 | True 52 | Resources.resx 53 | True 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /SAM.Picker/SAM.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gibbed/SteamAchievementManager/257aa157669e01d526ff49af17945e00d39066cd/SAM.Picker/SAM.ico -------------------------------------------------------------------------------- /SAM.Picker/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | true 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /SAM.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28803.156 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SAM.Picker", "SAM.Picker\SAM.Picker.csproj", "{E89E57BB-0F09-47F3-98A0-2026E2E65FBA}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SAM.API", "SAM.API\SAM.API.csproj", "{DF9102D5-048A-4D21-8CE3-3544CBDF0ED1}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SAM.Game", "SAM.Game\SAM.Game.csproj", "{7640DE31-E54E-45F9-9CF0-8DF3A3EA30FC}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|x86 = Debug|x86 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {E89E57BB-0F09-47F3-98A0-2026E2E65FBA}.Debug|x86.ActiveCfg = Debug|x86 19 | {E89E57BB-0F09-47F3-98A0-2026E2E65FBA}.Debug|x86.Build.0 = Debug|x86 20 | {E89E57BB-0F09-47F3-98A0-2026E2E65FBA}.Release|x86.ActiveCfg = Release|x86 21 | {E89E57BB-0F09-47F3-98A0-2026E2E65FBA}.Release|x86.Build.0 = Release|x86 22 | {DF9102D5-048A-4D21-8CE3-3544CBDF0ED1}.Debug|x86.ActiveCfg = Debug|x86 23 | {DF9102D5-048A-4D21-8CE3-3544CBDF0ED1}.Debug|x86.Build.0 = Debug|x86 24 | {DF9102D5-048A-4D21-8CE3-3544CBDF0ED1}.Release|x86.ActiveCfg = Release|x86 25 | {DF9102D5-048A-4D21-8CE3-3544CBDF0ED1}.Release|x86.Build.0 = Release|x86 26 | {7640DE31-E54E-45F9-9CF0-8DF3A3EA30FC}.Debug|x86.ActiveCfg = Debug|x86 27 | {7640DE31-E54E-45F9-9CF0-8DF3A3EA30FC}.Debug|x86.Build.0 = Debug|x86 28 | {7640DE31-E54E-45F9-9CF0-8DF3A3EA30FC}.Release|x86.ActiveCfg = Release|x86 29 | {7640DE31-E54E-45F9-9CF0-8DF3A3EA30FC}.Release|x86.Build.0 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {FB343317-9FA7-49C3-A55C-D95A69E836EC} 36 | EndGlobalSection 37 | EndGlobal 38 | --------------------------------------------------------------------------------