...
 
Commits (2)
/bin/libsteam_api*
/bin/*
!/bin/.gitkeep
/data/*
!/data/.gitkeep
/config.sh
......
......@@ -11,5 +11,8 @@
# Default value: 1
export DSA_LOG_LEVEL=1
# The directory where DSA stores persistent data (e.g. achievements)
export DSA_DATA_DIR="${DSA_DIR}/data"
# STEAM_USER_ID is the name of the directory inside ${HOME}/.steam/steam/userdata
export STEAM_USER_ID=1
This diff is collapsed.
......@@ -16,6 +16,13 @@ struct ISteamUserStats
typedef uint64_t steam_leaderboard_t;
enum steam_user_stats_limit
{
STEAM_USER_STATS_LIMIT_STAT_NAME_MAX = 128,
STEAM_USER_STATS_LIMIT_LEADERBOARD_NAME_MAX = 128,
STEAM_USER_STATS_LIMIT_LEADERBOARD_DETAILS_MAX = 64
};
enum steam_user_stats_leaderboard_display_type
{
STEAM_USER_STATS_LEADERBOARD_DISPLAY_TYPE_NONE = 0u,
......@@ -38,6 +45,21 @@ PACKED_STRUCT steam_callback_data_user_stats_user_stats_received
union CSteamID steam_id_user;
};
PACKED_STRUCT steam_callback_data_user_stats_user_stats_stored
{
union CGameID game_id;
enum steam_result result;
};
PACKED_STRUCT steam_callback_data_user_stats_user_achievement_stored
{
union CGameID game_id;
steam_bool_t is_group_achievement;
char achievement_name[STEAM_USER_STATS_LIMIT_STAT_NAME_MAX];
uint32_t cur_progress;
uint32_t max_progress;
};
PACKED_STRUCT steam_callback_data_user_stats_leaderboard_find_result
{
steam_leaderboard_t leaderboard;
......
......@@ -3,6 +3,7 @@
#include "CCallback.h"
#include "steam.h"
#include "vdf/vdf.h"
#include "ISteamUserStats.h"
......@@ -11,6 +12,8 @@ struct ISteamUserStatsImplCommon
steam_bool_t is_init : 1;
const char *default_version;
struct CCallResult request_current_stats_call_result;
char *stats_filename;
struct dsa_vdf *stats;
};
struct ISteamUserStatsImpl
......
......@@ -9,6 +9,7 @@ enum dsa_cfg
{
/* DSA_CFG_LOG_LEVEL should be the first to avoid printing unwanted log messages. */
DSA_CFG_LOG_LEVEL = 0,
DSA_CFG_DATA_DIR,
DSA_CFG_ORIG_STEAM_API_LIB,
DSA_CFG_STEAM_APP_ID,
DSA_CFG_STEAM_GAME_ID,
......@@ -26,7 +27,8 @@ struct dsa_cfg_var
#define DSA_CFG_VAR0(name) DSA_CFG_VAR(name, "${" name "}")
static struct dsa_cfg_var cfg_vars[] = {
[DSA_CFG_LOG_LEVEL] = DSA_CFG_VAR("DSA_LOG_LEVEL", TO_STR(DSA_LOG_LEVEL_WARN)),
[DSA_CFG_LOG_LEVEL] = DSA_CFG_VAR("DSA_LOG_LEVEL", "1"),
[DSA_CFG_DATA_DIR] = DSA_CFG_VAR0("DSA_DATA_DIR"),
[DSA_CFG_ORIG_STEAM_API_LIB] = DSA_CFG_VAR0("DSA_ORIG_STEAM_API_LIB"),
[DSA_CFG_STEAM_APP_ID] = DSA_CFG_VAR("SteamAppId", "1"),
[DSA_CFG_STEAM_GAME_ID] = DSA_CFG_VAR("SteamGameId", "1"),
......@@ -64,6 +66,11 @@ enum dsa_log_level dsa_config_get_log_level(void)
return strtoul(cfg_vars[DSA_CFG_LOG_LEVEL].val, NULL, 0);
}
const char *dsa_config_get_data_dir(void)
{
return cfg_vars[DSA_CFG_DATA_DIR].val;
}
const char *dsa_config_get_orig_steam_api_lib(void)
{
return cfg_vars[DSA_CFG_ORIG_STEAM_API_LIB].val;
......
......@@ -6,6 +6,7 @@
int dsa_config_init(void);
enum dsa_log_level dsa_config_get_log_level(void);
const char *dsa_config_get_data_dir(void);
const char *dsa_config_get_orig_steam_api_lib(void);
const char *dsa_config_get_steam_app_id_str(void);
steam_app_id_t dsa_config_get_steam_app_id(void);
......