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?)
Describe the bug
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
Additional context
No response