Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enums class to contain enums for SteamAPI, such as Game Ids. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dota2Banlist/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ static void Main()
var player = summaries.Players.Single(p => object.Equals(p.SteamId, ids[i]));

var psa = new PlayerServiceApi(steamKey);
var dota = psa.GetOwnedGames(ids[i], 570);
var game = dota.Games != null ? psa.GetOwnedGames(ids[i], 570).Games.FirstOrDefault(g => g.AppId == 570) : null;
var dota = psa.GetOwnedGames(ids[i], (int)Dota2BanlistCore.Steam.Api.Enums.GameId.Dota2);
var game = dota.Games != null ? psa.GetOwnedGames(ids[i], (int)Dota2BanlistCore.Steam.Api.Enums.GameId.Dota2).Games.FirstOrDefault(g => g.AppId == (int)Dota2BanlistCore.Steam.Api.Enums.GameId.Dota2) : null;

var friends = player.CommunityVisibilityState == 3 ? api.GetFriendList(ids[i]).Friends : null;
var friendsInGame = friends != null ? friends.Select(f => summaries.Players.SingleOrDefault(p => object.Equals(p.SteamId, f.SteamId))).Where(f => f != null).ToList() : new List<PlayerSummary>();
Expand Down
1 change: 1 addition & 0 deletions Dota2BanlistCore/Dota2BanlistCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<Compile Include="DotaBuff\Model\MostPlayedHero.cs" />
<Compile Include="DotaBuff\Model\PlayerDetailsOverview.cs" />
<Compile Include="DotaBuff\Model\VersusDetails.cs" />
<Compile Include="Steam\Api\Enums.cs" />
<Compile Include="Util\CConsole.cs" />
<Compile Include="Db\BanlistDb.Designer.cs">
<AutoGen>True</AutoGen>
Expand Down
15 changes: 15 additions & 0 deletions Dota2BanlistCore/Steam/Api/Enums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dota2BanlistCore.Steam.Api
{
public static class Enums
{
public enum GameId
{
Dota2 = 570,
}
}
}