You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue1: Added RealmId to the config file format. Added a Version code as well that is now 1 for the current version. Older versions will start at 0, which is the default if the Version element is not present in the file. I also added a small flow that will update the existing config file to the new version and use default values for the new RealmId field (1). The readme has been updated to reflect the new version.
Copy file name to clipboardExpand all lines: README.md
+20-8Lines changed: 20 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,26 @@ It requires a Blizzard API key which you can get for free but will need to creat
8
8
To get started, create a file called "Config.json" (or whatever you want) and copy the contents of "Config.json.example" into it.
9
9
Then change the settings to your preferences and put in your own ClientId and ClientSecret.
10
10
This is what the different settings are and how to set them:
11
-
* "MsPerRead": This is how often to ask for MMR updates in milliseconds. I found that MMR typically takes 10 seconds or so anyway to be updated on Blizzard's server so this doesn't have to be too quick.
12
-
* "DataDirectory": This is a directory to store temp files that the application needs. It can be a path relative to the executable or an absolute path. "" just means put the files in the same directory as the executable.
13
-
* "MmrFilePath": This is a file path to put the MMR in. If the file doesn't exist it is created. If they file exists it is overwritten. The path can be relative to the executable or an absolute path.
14
-
* "RegionId": This is the region to use. It can be "US", "EU", "KO" or "CN".
15
-
* "ProfileId": This is the ID of the profile you want to get the MMR for. You can find this by navigating to Starcraft2.com, log into your Blizzard account and click View Profile. The ProfileId will be the last number in the URL at the top. For example: in "https://starcraft2.com/en-us/profile/1/1/1986271", the ProfileId is 1986271.
16
-
* "LadderId": This is the ID of the particular Ladder you want the MMR for (since you have separate MMR for each race and for team games). To find this, go to Ladders on the Blizzard account profile site mentioned above and click the ladder you would like to get the MMR for. The LadderId will be the last number in the URL at the top. For example: in "https://starcraft2.com/en-us/profile/1/1/1986271/ladders?ladderId=274006", the LadderId is 274006.
17
-
* "ClientId": You will need to sign up for a Blizzard API key to get a ClientId and ClientSecret. This will give you access to Blizzard's API for access to ladder information. To do this, go to https://develop.battle.net/access and log in with your Blizzard account. If you don't have an Authenticator set up, it will make you do this first. Once you're logged in, create a new Client. Click on the Client and it will tell you the ClientId and ClientSecret. Just copy/paste them in.
18
-
* "ClientSecret": See instructions for ClientId above.
11
+
***Version**
12
+
This identifies the version of the config file. If any parameters are added, removed or changed this will be incremented. Users don't have to change this unless they are manually upgrading to the next version.
13
+
***MsPerRead**
14
+
This is how often to ask for MMR updates in milliseconds. I found that MMR typically takes 10 seconds or so anyway to be updated on Blizzard's server so this doesn't have to be too quick.
15
+
***DataDirectory**
16
+
This is a directory to store temp files that the application needs. It can be a path relative to the executable or an absolute path. "" just means put the files in the same directory as the executable.
17
+
***MmrFilePath**
18
+
This is a file path to put the MMR in. If the file doesn't exist it is created. If they file exists it is overwritten. The path can be relative to the executable or an absolute path.
19
+
***RegionId**
20
+
This is the region to use. It can be "US", "EU", "KO" or "CN".
21
+
***RealmId**
22
+
This is the realm ID of the profile and can be 1 or 2. You can see what it is for your account by logging into your Blizzard account on Startcraft2.com, clicking View Profile and taking the number in the [RealmId] position in the URL: "ht<span>tps://starcraft2.com/en-us/profile/</span>[RegionId]/**[RealmId]**/...". For example, the realm ID is "1" in the following URL: "ht<span>tps://starcraft2.com/en-us/profile/2/</span>**1**/1986271"
23
+
***ProfileId**
24
+
This is the ID of the profile you want to get the MMR for. You can find this by navigating to Starcraft2.com, log into your Blizzard account and click View Profile. The ProfileId will be the last number in the URL at the top. For example: in "https://starcraft2.com/en-us/profile/1/1/1986271", the ProfileId is 1986271.
25
+
***LadderId**
26
+
This is the ID of the particular Ladder you want the MMR for (since you have separate MMR for each race and for team games). To find this, go to Ladders on the Blizzard account profile site mentioned above and click the ladder you would like to get the MMR for. The LadderId will be the last number in the URL at the top. For example: in "https://starcraft2.com/en-us/profile/1/1/1986271/ladders?ladderId=274006", the LadderId is 274006.
27
+
***ClientId**
28
+
You will need to sign up for a Blizzard API key to get a ClientId and ClientSecret. This will give you access to Blizzard's API for access to ladder information. To do this, go to https://develop.battle.net/access and log in with your Blizzard account. If you don't have an Authenticator set up, it will make you do this first. Once you're logged in, create a new Client. Click on the Client and it will tell you the ClientId and ClientSecret. Just copy/paste them in.
29
+
***ClientSecret**
30
+
See instructions for ClientId above.
19
31
20
32
# Running
21
33
To run the program, either double click on the exe or run this from command line:
Console.WriteLine("The specified config file version is for a new version of Sc2MmrReader. Please update to the latest version or downgrade your config file to version "+ReaderConfig.ReaderConfigVersion);
Copy file name to clipboardExpand all lines: Sc2MmrReader/ReaderConfig.cs
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,32 @@ namespace Sc2MmrReader {
6
6
/// deserialized into it. So if you rename or change parameters here, you must upgrade the config file format as well.
7
7
/// </summary>
8
8
publicclassReaderConfig{
9
+
// This is the current version and should always be incremented when changing the config file format.
10
+
publicstaticintReaderConfigVersion=1;
11
+
12
+
// Version
13
+
publicintVersion{get;set;}=0;// This identifies the version of the config file. If it's not set it will be at 0.
14
+
15
+
// Config settings:
16
+
publiclongMsPerRead{get;set;}// How many milliseconds inbetween reads
17
+
publicStringDataDirectory{get;set;}// Where to store cached files
18
+
publicStringMmrFilePath{get;set;}// Where to output the MMR to
19
+
20
+
// Information about the account to get the MMR for:
21
+
publicStringRegionId{get;set;}// Can be "US", "EU", "KO" or "CN"
22
+
publicintRealmId{get;set;}=1;// Can be 1 or 2. You get this from the link below ".../profile/<regionId>/<realmId>/...". This defaults to 1 for backwards compatibility.
23
+
publiclongProfileId{get;set;}// Example: https://starcraft2.com/en-us/profile/1/1/1986271/ladders?ladderId=274006, profile ID is 1986271
24
+
publiclongLadderId{get;set;}// In the above link, the LadderId is 274006
25
+
26
+
// Information about who is connecting:
27
+
publicStringClientId{get;set;}// Get this by making a developer account for the Blizzard API.
28
+
publicStringClientSecret{get;set;}// Same as above.
29
+
}
30
+
31
+
// Keep track of old config versions in case we want to be
32
+
// able to update old versions in a smarter way.
33
+
#region OldConfigVersions
34
+
publicclassReaderConfigV0{
9
35
// Config settings:
10
36
publiclongMsPerRead{get;set;}// How many milliseconds inbetween reads
11
37
publicStringDataDirectory{get;set;}// Where to store cached files
@@ -20,4 +46,5 @@ public class ReaderConfig {
20
46
publicStringClientId{get;set;}// Get this by making a developer account for the Blizzard API.
21
47
publicStringClientSecret{get;set;}// Same as above.
0 commit comments