Skip to content

Commit

Permalink
Use gibbed#62 as base
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowsun™ authored and Shadowsun™ committed Mar 18, 2023
1 parent 7b301fa commit e238628
Show file tree
Hide file tree
Showing 80 changed files with 1,148 additions and 1,054 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*.userosscache
*.sln.docstates
private/
upload/

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
12 changes: 6 additions & 6 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
zlib License

Copyright (c) 2019 Rick (rick 'at' gibbed 'dot' us)
Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand All @@ -11,12 +11,12 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
misrepresented as being the original software.

3. This notice may not be removed or altered from any source
distribution.
distribution.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Steam Achievement Manager
# Steam Achievement Manager Auto

This is the code for SAM, originally released in 2008, last major release in 2011, and last updated in 2013 (a hotfix).

Expand All @@ -9,10 +9,17 @@ There are some changes to the code since the last closed-source release:
- Icons have been replaced with ones from the Fugue Icons set.
- Version has been bumped to 7.0.x.x to indicate the open-source release.

[Download latest release](https://github.com/gibbed/SteamAchievementManager/releases/latest).
[Download latest gibbed release](https://github.com/gibbed/SteamAchievementManager/releases/latest).
[Download latest SAM Auto release](https://github.com/gotkrypto76/SteamAchievementManager/releases/latest).

[![Build status](https://ci.appveyor.com/api/projects/status/00vic6jliar6j0ol/branch/master?svg=true)](https://ci.appveyor.com/project/gibbed/steamachievementmanager/branch/master)
[![Gibbed Build status](https://ci.appveyor.com/api/projects/status/00vic6jliar6j0ol/branch/master?svg=true)](https://ci.appveyor.com/project/gibbed/steamachievementmanager/branch/master)

## What's new
- A new "Unlock All" feature has been added that loops through all of the displayed games and unlocks everything automatically.

## Will I get banned for using the "Unlock All" feature?
Honestly, I'm not really sure. I doubt it's any worse than just using this program normally. I let it run through 460+ games and I'm doing fine. Please don't hold me or the original author responsible for any damages this could cause.

## Attribution

Most (if not all) icons are from the [Fugue Icons](http://p.yusukekamiyamane.com/) set.
Most (if not all) icons are from the [Fugue Icons](http://p.yusukekamiyamane.com/) set.
2 changes: 1 addition & 1 deletion SAM.API/Callback.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019 Rick (rick 'at' gibbed 'dot' us)
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion SAM.API/Callbacks/AppDataChanged.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019 Rick (rick 'at' gibbed 'dot' us)
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion SAM.API/Callbacks/UserStatsReceived.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019 Rick (rick 'at' gibbed 'dot' us)
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down
62 changes: 20 additions & 42 deletions SAM.API/Client.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2019 Rick (rick 'at' gibbed 'dot' us)
/* Copyright (c) 2017 Rick (rick 'at' gibbed 'dot' us)
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
Expand Down Expand Up @@ -27,99 +27,77 @@

namespace SAM.API
{
public class Client : IDisposable
public class Client
{
public Wrappers.SteamClient018 SteamClient;
public Wrappers.SteamClient009 SteamClient;
public Wrappers.SteamUser012 SteamUser;
public Wrappers.SteamUserStats007 SteamUserStats;
public Wrappers.SteamUtils005 SteamUtils;
public Wrappers.SteamApps001 SteamApps001;
public Wrappers.SteamApps008 SteamApps008;
public Wrappers.SteamApps003 SteamApps003;

private bool _IsDisposed = false;
private int _Pipe;
private int _User;

private readonly List<ICallback> _Callbacks = new List<ICallback>();

public void Initialize(long appId)
public bool Initialize(long appId)
{
if (string.IsNullOrEmpty(Steam.GetInstallPath()) == true)
if (appId != 0)
{
throw new ClientInitializeException(ClientInitializeFailure.GetInstallPath, "failed to get Steam install path");
Environment.SetEnvironmentVariable("SteamAppId", appId.ToString(CultureInfo.InvariantCulture));
}

if (appId != 0)
if (Steam.GetInstallPath() == null)
{
Environment.SetEnvironmentVariable("SteamAppId", appId.ToString(CultureInfo.InvariantCulture));
return false;
}

if (Steam.Load() == false)
{
throw new ClientInitializeException(ClientInitializeFailure.Load, "failed to load SteamClient");
return false;
}

this.SteamClient = Steam.CreateInterface<Wrappers.SteamClient018>("SteamClient018");
this.SteamClient = Steam.CreateInterface<Wrappers.SteamClient009>("SteamClient009");
if (this.SteamClient == null)
{
throw new ClientInitializeException(ClientInitializeFailure.CreateSteamClient, "failed to create ISteamClient018");
return false;
}

this._Pipe = this.SteamClient.CreateSteamPipe();
if (this._Pipe == 0)
{
throw new ClientInitializeException(ClientInitializeFailure.CreateSteamPipe, "failed to create pipe");
return false;
}

this._User = this.SteamClient.ConnectToGlobalUser(this._Pipe);
if (this._User == 0)
{
throw new ClientInitializeException(ClientInitializeFailure.ConnectToGlobalUser, "failed to connect to global user");
return false;
}

this.SteamUtils = this.SteamClient.GetSteamUtils004(this._Pipe);
if (appId > 0 && this.SteamUtils.GetAppId() != (uint)appId)
{
throw new ClientInitializeException(ClientInitializeFailure.AppIdMismatch, "appID mismatch");
return false;
}

this.SteamUser = this.SteamClient.GetSteamUser012(this._User, this._Pipe);
this.SteamUserStats = this.SteamClient.GetSteamUserStats006(this._User, this._Pipe);
this.SteamApps001 = this.SteamClient.GetSteamApps001(this._User, this._Pipe);
this.SteamApps008 = this.SteamClient.GetSteamApps008(this._User, this._Pipe);
this.SteamApps003 = this.SteamClient.GetSteamApps003(this._User, this._Pipe);
return true;
}

~Client()
{
this.Dispose(false);
}

protected virtual void Dispose(bool disposing)
{
if (this._IsDisposed == true)
{
return;
}

if (this.SteamClient != null && this._Pipe > 0)
if (this.SteamClient != null)
{
if (this._User > 0)
{
this.SteamClient.ReleaseUser(this._Pipe, this._User);
this._User = 0;
}

this.SteamClient.ReleaseUser(this._Pipe, this._User);
this._User = 0;
this.SteamClient.ReleaseSteamPipe(this._Pipe);
this._Pipe = 0;
}

this._IsDisposed = true;
}

public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

public TCallback CreateAndRegisterCallback<TCallback>()
Expand Down
50 changes: 0 additions & 50 deletions SAM.API/ClientInitializeException.cs

This file was deleted.

Loading

0 comments on commit e238628

Please sign in to comment.