|
6 months ago | |
---|---|---|
LICENSE.md | 1 year ago | |
README.md | 6 months ago | |
steam_stat_utils.py | 6 months ago |
Command line utility for parsing detailed Steam stat information.
steam_stat_utils.py
fetches data primarily from two sources: the Steam client’s local filesystem cache and the Steam Web API. With this information you can view global stats as well as signed-in users’ stats.
You can also dump raw data for local/offline playtesting, such as with Goldberg Emulator. Steam’s copy of data can change over time and as your games receive major updates, so this process should be repeated regularly.
Usage details are in development and likely to change with future commits.
steam_stat_utils.py path/to/steam_dir appid [userid]
achievements.json
file format used by Goldberg Emulatordll/local_storage.h
add the following preprocessor directive next to the other defines near the top of the file:#define GLOBALSTATS_STORAGE_FOLDER "globalstats"
dll/steam_user_stats.h
replace the two GetGlobalStat placeholder functions with these implementations:// Gets the lifetime totals for an aggregated stat
bool GetGlobalStat( const char *pchStatName, int64 *pData )
{
PRINT_DEBUG("GetGlobalStat %s\n", pchStatName);
if (!pchStatName || !pData) return false;
std::lock_guard<std::recursive_mutex> lock(global_mutex);
int read_data = local_storage->get_data(GLOBALSTATS_STORAGE_FOLDER, pchStatName, (char* )pData, sizeof(*pData));
if (read_data == sizeof(int64))
return true;
return false;
}
bool GetGlobalStat( const char *pchStatName, double *pData )
{
PRINT_DEBUG("GetGlobalStat %s\n", pchStatName);
if (!pchStatName || !pData) return false;
std::lock_guard<std::recursive_mutex> lock(global_mutex);
int read_data = local_storage->get_data(GLOBALSTATS_STORAGE_FOLDER, pchStatName, (char* )pData, sizeof(*pData));
if (read_data == sizeof(int64))
return true;
return false;
}