Skip to content

Commit 26efe03

Browse files
author
babelshift
committed
Code cleanup, auto formatting, and refactoring some namespaces.
1 parent b7165da commit 26efe03

55 files changed

Lines changed: 202 additions & 356 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SteamWebAPI2.Models/CSGO/App.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

SteamWebAPI2.Models/CSGO/Datacenter.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

SteamWebAPI2.Models/CSGO/Matchmaking.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

SteamWebAPI2.Models/CSGO/ServerStatusResult.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,65 @@
1-
using System;
1+
using Newtonsoft.Json;
2+
using SteamWebAPI2.Models.Utilities;
23
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
64

75
namespace SteamWebAPI2.Models.CSGO
86
{
7+
public class ServerStatusApp
8+
{
9+
public int Version { get; set; }
10+
public long Timestamp { get; set; }
11+
public string Time { get; set; }
12+
}
13+
14+
public class ServerStatusDatacenter
15+
{
16+
public string Name { get; set; }
17+
public string Capacity { get; set; }
18+
public string Load { get; set; }
19+
}
20+
21+
public class ServerStatusMatchmaking
22+
{
23+
public string Scheduler { get; set; }
24+
25+
[JsonProperty(PropertyName = "online_servers")]
26+
public int OnlineServers { get; set; }
27+
28+
[JsonProperty(PropertyName = "online_players")]
29+
public int OnlinePlayers { get; set; }
30+
31+
[JsonProperty(PropertyName = "searching_players")]
32+
public int SearchingPlayers { get; set; }
33+
34+
[JsonProperty(PropertyName = "search_seconds_avg")]
35+
public int SearchSecondsAverage { get; set; }
36+
}
37+
38+
public class ServerStatusServices
39+
{
40+
public string SessionsLogon { get; set; }
41+
public string SteamCommunity { get; set; }
42+
public string IEconItems { get; set; }
43+
public string Leaderboards { get; set; }
44+
}
45+
46+
public class ServerStatusResult
47+
{
48+
public ServerStatusApp App { get; set; }
49+
public ServerStatusServices Services { get; set; }
50+
51+
/// <summary>
52+
/// We have to use a custom converter here because the JSON response for data centers is badly formatted. Instead of using a JSON array in which
53+
/// all data centers are listed, Valve decided to make individual objects for each data center. So we fix that by parsing them into an array.
54+
/// </summary>
55+
[JsonConverter(typeof(CSGODataCenterJsonConverter))]
56+
public IList<ServerStatusDatacenter> Datacenters { get; set; }
57+
58+
public ServerStatusMatchmaking Matchmaking { get; set; }
59+
}
60+
961
public class ServerStatusResultContainer
1062
{
1163
public ServerStatusResult Result { get; set; }
1264
}
13-
}
65+
}

SteamWebAPI2.Models/CSGO/Services.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

SteamWebAPI2.Models/BadgesResultContainer.cs renamed to SteamWebAPI2.Models/SteamCommunity/BadgesResultContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Newtonsoft.Json;
55
using System.Collections.Generic;
66

7-
namespace SteamWebAPI2.Models
7+
namespace SteamWebAPI2.Models.SteamCommunity
88
{
99
public class Badge
1010
{

SteamWebAPI2.Models/CommunityBadgeProgressResultContainer.cs renamed to SteamWebAPI2.Models/SteamCommunity/CommunityBadgeProgressResultContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Newtonsoft.Json;
55
using System.Collections.Generic;
66

7-
namespace SteamWebAPI2.Models
7+
namespace SteamWebAPI2.Models.SteamCommunity
88
{
99
public class BadgeQuest
1010
{

SteamWebAPI2.Models/FriendListResultContainer.cs renamed to SteamWebAPI2.Models/SteamCommunity/FriendListResultContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System;
77
using System.Collections.Generic;
88

9-
namespace SteamWebAPI2.Models
9+
namespace SteamWebAPI2.Models.SteamCommunity
1010
{
1111
public class Friend
1212
{

SteamWebAPI2.Models/GlobalAchievementPercentagesResultContainer.cs renamed to SteamWebAPI2.Models/SteamCommunity/GlobalAchievementPercentagesResultContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Newtonsoft.Json;
55
using System.Collections.Generic;
66

7-
namespace SteamWebAPI2.Models
7+
namespace SteamWebAPI2.Models.SteamCommunity
88
{
99
public class GlobalAchievementPercentage
1010
{

0 commit comments

Comments
 (0)