September 25, 2020, 02:00:00 AM

Author Topic: SteamSDK.mod is missing TSteamUserStats.GetStat()  (Read 277 times)

Offline Oddball

  • Jr. Member
  • **
  • Posts: 10
SteamSDK.mod is missing TSteamUserStats.GetStat()
« on: June 18, 2020, 11:32:23 AM »
As the title says TSteamUserStats.GetStat() is completely missing. But I think I've figured out how to add it. Here's what I added.

steamsdk.bmx -> line 877
Code: [Select]
Rem
bbdoc: Gets the current value of the a stat for the current user.
about: You must have called RequestCurrentStats and it needs to return successfully via its callback prior to calling this.

To receive stats for other users use #GetUserStat.

This function returns true upon success if all of the following conditions are met; otherwise, false.
* The specified stat exists in App Admin on the Steamworks website, and the changes are published.
* #RequestCurrentStats has completed and successfully returned its callback.
* The type passed to this function must match the type listed in the App Admin panel of the Steamworks website.

See Also: #RequestCurrentStats, #SetStat, #UpdateAvgRateStat, #StoreStats, #ResetAllStats
End Rem
Method GetStat:Int(name:String, data:Int Var)
Return bmx_SteamAPI_ISteamUserStats_GetStat(instancePtr, name, data)
End Method

Rem
bbdoc: Gets the current value of the a stat for the current user.
about: You must have called RequestCurrentStats and it needs to return successfully via its callback prior to calling this.

To receive stats for other users use #GetUserStat.

This function returns true upon success if all of the following conditions are met; otherwise, false.
* The specified stat exists in App Admin on the Steamworks website, and the changes are published.
* #RequestCurrentStats has completed and successfully returned its callback.
* The type passed to this function must match the type listed in the App Admin panel of the Steamworks website.

See Also: #RequestCurrentStats, #SetStat, #UpdateAvgRateStat, #StoreStats, #ResetAllStats
End Rem
Method GetStat:Int(name:String, data:Float Var)
Return bmx_SteamAPI_ISteamUserStats_GetStat0(instancePtr, name, data)
End Method

common.bmx -> line 101
Code: [Select]
Function bmx_SteamAPI_ISteamUserStats_GetStat:Int(inst:Byte Ptr, name:String, data:Int Var)
Function bmx_SteamAPI_ISteamUserStats_GetStat0:Int(inst:Byte Ptr, name:String, data:Float Var)

glue/glue.cpp -> line 167
Code: [Select]
int bmx_SteamAPI_ISteamUserStats_GetStat(intptr_t instancePtr, BBString * name, int * data);
int bmx_SteamAPI_ISteamUserStats_GetStat0(intptr_t instancePtr, BBString * name, float * data);

glue/glue.cpp -> line 930
Code: [Select]
int bmx_SteamAPI_ISteamUserStats_GetStat(intptr_t instancePtr, BBString * name, int * data) {
char * n = bbStringToUTF8String(name);
int res = SteamAPI_ISteamUserStats_GetStat(instancePtr, n, data);
bbMemFree(n);
return res;
}

int bmx_SteamAPI_ISteamUserStats_GetStat0(intptr_t instancePtr, BBString * name, float * data) {
char * n = bbStringToUTF8String(name);
int res = SteamAPI_ISteamUserStats_GetStat0(instancePtr, n, data);
bbMemFree(n);
return res;
}

Obviously I'm gonna test all this thoroughly, but was wondering if anyone knows if this is on the right tracks? I'm surprised this wasn't picked up earlier as it's a pretty major function of the Steam api. Is anyone even using BlitzMax NG in released games?

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal