Facepunch / sbox-issues

177 stars 12 forks source link

Generic Exception when getting API "https://services.facepunch.com/sbox/package/stats/[game ident]/u/[steam id] #6122

Open agincel opened 3 months ago

agincel commented 3 months ago

Describe the bug

Stats.PlayerStats playerStats = Sandbox.Services.Stats.GetLocalPlayerStats( "marble_racer" );
await playerStats.Refresh();
if ( playerStats.TryGet(ident, out var stat))
{
    Log.Info( "Retrieved stat: " + ident + " with value: " + stat.ValueString );
    return stat;
}

This feels correct as far as the documentation for querying stats goes, but this is returning an exception on the web request with no additional details.

All of the stats in question exist in the web interface and submitting to them with Sandbox.Services.Stats.SetValue( ident, value ) works as expected.

To Reproduce

Attempt to use the attached StatsHelper to query any stat, and see an error.

Expected behavior

Querying stats works as expected. (Unless I'm doing something stupid here?? In which case maybe better docs / error messaging?)

Media/Files

StatsHelper.zip image

Additional context

No response

garrynewman commented 2 months ago

Hey is this still happening?