Skip to main content

Forums / Support / Halo API Support

HaloSharp (A C# Wrapper) (v2.0.1.0 - 2017-03-22)

OP Furiousn00b

  1. 1
  2. ...
  3. 2
  4. 3
  5. ...
  6. 4
v1.4.3.0 (GitHub | NuGet)

Release Notes:
  • Fixed a bug where trying to get the service record of a now defunct Gamertag would throw a JSON parsing exception.
When a player changes their gamertag, their 'old' service record and match history will start to return no data. This might be a 404 or might be a non-valid result.

In the case of Service Records, the ResultCode is being set to 'NotFound', but the response still contains data (It's just empty or zeroed out). This was causing an issue for HaloSharp.
v1.5.0.0 (GitHub | NuGet)

Release Notes:
  • New Stats endpoint (Leaderboards)
  • Updated MatchEvents model for new Event Types (Impulses, Medals, Player Spawns, Round Starts, Round Ends, Weapon Drops, Weapon Pickups, and Weapon Pickup Pads)
  • Updated ArenaPlaylistStat model to include new property: CsrPercentile
  • Updated XpInfo/CreditsEarned models to include two new properties: MatchSpeedWinAmount, ObjectivesCompletedAmount
***EDIT***
OK, so this was a dumb mistake. I am new to all of this, so I missed some obvious stuff. Rather than deleting all of this text, I will post what I did to correct my mistake.

  1. For the method doing work for me, I made sure to make its return type Task.
  2. When calling this method from Main, I use MethodName().Wait(); You can't do an await from Main, because you can't use async on an entry method.
Sorry for posting this. I just wasn't sure what was going on. Thanks again for HaloSharp. It is awesome.
==========================================

First, thanks for HaloSharp. It is great.

Next, I am wondering if I am doing something wrong. I did the following:

  1. I created a new console application. I didn't change anything with it.
  2. I added HaloSharp using NuGet
  3. I updated Newtonsoft.Json
  4. I added all necessary 'using' statements in the application
  5. I copied/pasted your example code from gitHub into the application
  6. I changed the "000....000" to my API key
When I run the application, it will run to the following line:

var matchSet = await session.Query(query);

It just exits. No exceptions are thrown, no error messages appear in the Output screen, and the program prints nothing. Nothing after that line is executed. If I put a break on that line and attempt to debug through it, the program just ends.

Would you happen to have any ideas?
v1.5.1.0 (GitHub | NuGet)

Release Notes:
  • Added new Medal Enum (Infection)
  • A few of boring bug fixes.
Okay, another question for you. I'm pulling matches, like A LOT of matches. Using the GetMatches.Skip parameter, I'm going through a player's entire Arena history for fun analysis, and I've got about 15 gamertags each with about 1000 matches to pull MatchID's for.

Needless to say, this takes a while, but the database I'm storing them in doesn't really care what order they come in. So I was wondering if I could place each gamertag's series of calls into its own thread to speed up database writes and the processing I'm doing with each.

The problem is, because I'm using the same developer key, each HaloSharp client is sharing a rate limit, and I'm not sure if there's an easy way to make it coordinate across the threads. Right now, I just get a lot of rate limit exceeded problems when I try to use more than one thread for calls.

Any ideas in this space, or should I just resign myself to the rate limit being my bottleneck and optimize accordingly?
Okay, another question for you. I'm pulling matches, like A LOT of matches. Using the GetMatches.Skip parameter, I'm going through a player's entire Arena history for fun analysis, and I've got about 15 gamertags each with about 1000 matches to pull MatchID's for.

Needless to say, this takes a while, but the database I'm storing them in doesn't really care what order they come in. So I was wondering if I could place each gamertag's series of calls into its own thread to speed up database writes and the processing I'm doing with each.

The problem is, because I'm using the same developer key, each HaloSharp client is sharing a rate limit, and I'm not sure if there's an easy way to make it coordinate across the threads. Right now, I just get a lot of rate limit exceeded problems when I try to use more than one thread for calls.

Any ideas in this space, or should I just resign myself to the rate limit being my bottleneck and optimize accordingly?
Ideally, you should only ever create a single HaloClient and start a single HaloSession (and reuse it across your entire app). Use dependency injection (single instance) and resolve the session where ever you need it. HaloSharp is thread safe.

The internal rate limiter only really works if you're running a single instance (it can't track requests that it didn't make).

You're on the right path (and it's exactly how I do it). Doing it like this (assuming your bandwidth / latency is OK), you'll easily max out your rate limit without having to worry about rate limit exceptions.
Makes sense. Thanks again for your fast responses! ^_^
v1.5.2.0 (GitHub | NuGet)

Release Notes:
  1. Updated Service Record models.
    • New property: FastestMatchWin
  2. Updated ArenaMatch model.
    • New property: BoostInfo
  3. Updated WarzoneMatch model.
    • New property: BoostInfo
    • New property: PveTotalRoundAssistBonuses
    • New property: PveTotalRoundKillBonuses
    • New property: PveTotalRoundSpeedBonuses
    • New property: PveTotalRoundSurvivalBonuses
v1.5.3.0 (GitHub | NuGet)

Release Notes:
  1. Updated Warzone Match model.
    • New property: ObjectivesCompleted
v1.5.4.0 (GitHub | NuGet)

Release Notes:
  1. Updated Player Stat model.
    • New property: GameEndStatus
Hey Furiousn00b!

Are you seeing any issues with games coming back with null values for PlayerStats[].XpInfo.PerformanceXP? Starting just today--as far as I know--I had my game collection routine start crapping out because I was hitting certain games where the PerformanceXP comes back as null. I end up with the following error:

Quote:
{"Error converting value {null} to type 'System.Int32'. Path 'PlayerStats[0].XpInfo.PerformanceXP', line 1, position 190."}

at the line Await _session.Query(New GetWarzoneMatchDetails().ForMatchId([GUID here]) in my code
It seems like just Warzone Firefight games causing the issue, but I am trying to nail that down. Every one that I have seen so far has been a FF game. I have handled FF games in the past without issue, and I am currently using HaloSharp 1.5.5. I did a search through your change log and here in the forums, but I didn't see any mention of it. My games collection routine has been running for several days straight with no changes to the code. It wasn't until either last night or today that it started reporting errors.

Here is a FF game with the issue: 01590cb3-6F95-497d-866F-b760946760ee
Here is a regular WZ game without the issue: e9595569-da81-4c5e-b692-181231e40bd5

Arena games all seem to be coming back with values in there.

Apologies if this was something mentioned elsewhere and I missed it.
b01000100 wrote:
Hey Furiousn00b!

Are you seeing any issues with games coming back with null values for PlayerStats[].XpInfo.PerformanceXP? Starting just today--as far as I know--I had my game collection routine start crapping out because I was hitting certain games where the PerformanceXP comes back as null. I end up with the following error:

Quote:
{"Error converting value {null} to type 'System.Int32'. Path 'PlayerStats[0].XpInfo.PerformanceXP', line 1, position 190."}

at the line Await _session.Query(New GetWarzoneMatchDetails().ForMatchId([GUID here]) in my code
It seems like just Warzone Firefight games causing the issue, but I am trying to nail that down. Every one that I have seen so far has been a FF game. I have handled FF games in the past without issue, and I am currently using HaloSharp 1.5.5. I did a search through your change log and here in the forums, but I didn't see any mention of it. My games collection routine has been running for several days straight with no changes to the code. It wasn't until either last night or today that it started reporting errors.

Here is a FF game with the issue: 01590cb3-6F95-497d-866F-b760946760ee
Here is a regular WZ game without the issue: e9595569-da81-4c5e-b692-181231e40bd5

Arena games all seem to be coming back with values in there.

Apologies if this was something mentioned elsewhere and I missed it.
Hey b :)

I noticed this yesterday too but got caught up doing some other work. Not sure why they changed PerformanceXP from and int to a nullable int as returning a 0 would seem to make sense (?).

I'll whip up 1.5.6 in the next few hours and get an update out. Cheers for the reminder.
v1.5.6.0 (GitHub | NuGet)

Release Notes:
  1. Updated XP Info model.
    • Updated property: PerformanceXP
CC: b01000100
Looks good! Thanks for the work and quick turnaround!
v1.6.0.0 (GitHub | NuGet)

Release Notes:
  1. Added User Generated Content (UGC) endpoints.
    • List Game Variants
    • Get Game Variant
    • List Map Variants
    • Get Map Variant
Turnaround time took a little longer on this release; I took some time off from working on personal projects while trying to find some balance. I'm back and HaloSharp's back up to date :)

Looking forward to a PC build soon and any API changes that brings!
Hey Furiousn00b - question for you on adding HaloSharp to a new UWP project through NuGet (Visual Studio 2015 community, if it matters). When I attempt to add the package, I get this error message:

"Error Package restore failed. Rolling back package changes for 'HelloXbox'."

I get this a lot with other packages (including my own!), so I assume it's a package compatibility thing with NuGet 3.1... Do you have any plans to update HaloSharp to work with UWP? If not, do you know if it's it possible to add HaloSharp to my project without the use of a package manager to avoid this error? You've got a ton of great functionality here, and I'm reluctant to go create my own calls from scratch if I can just use HaloSharp =)

Thanks!
Hey Furiousn00b - question for you on adding HaloSharp to a new UWP project through NuGet (Visual Studio 2015 community, if it matters). When I attempt to add the package, I get this error message:

"Error Package restore failed. Rolling back package changes for 'HelloXbox'."

I get this a lot with other packages (including my own!), so I assume it's a package compatibility thing with NuGet 3.1... Do you have any plans to update HaloSharp to work with UWP? If not, do you know if it's it possible to add HaloSharp to my project without the use of a package manager to avoid this error? You've got a ton of great functionality here, and I'm reluctant to go create my own calls from scratch if I can just use HaloSharp =)

Thanks!
I'm not fully accross UWP programs, but I'll take a stab. The following are the steps I took:
  1. Created a new UWP project
  2. Updated UniversalWindowsPlatform to version v5.2.2
  3. Imported the .NET 4.5.2 framework (HaloSharp is a .NET 4.5.2 project)
  4. Built the project
The following is what my project.json looks like now (with it building successfully):

Quote:
{
"dependencies": {
"HaloSharp": "1.6.0",
"Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2"
},
"frameworks": {
"uap10.0": {
"imports": [
"net452"
] }
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
}
I don't have time right this minute, but I'll have a go at packaging the library targeting more frameworks soon (tm) to make it easier.
Adding the 4.5.2 framework... That's what I was missing! Seems obvious, but I'm still learning...

No rush on any updates, but I seriously appreciate the work you put in here ^_^
v1.6.1.0 (GitHub | NuGet)

Release Notes:
  1. Updated RequisitionPack model.
    • New property: GiftableAcquisitionMethods
    • New property: IsGiftOnly
v2.0.0.0! (GitHub | NuGet)

Release Notes:
    • So many breaking changes, I don't know what to do with myself.
    • All Halo 5 queries.
    • All Halo 5: Forge queries.
    • All Halo Wars 2 queries.
  1. 1
  2. ...
  3. 2
  4. 3
  5. ...
  6. 4