Beispiel #1
0
    public RemoteStatInfo GetRemoteStatInfo(int i_Id)
    {
        RemoteStatInfo info = null;

        m_StatsMap.TryGetValue(i_Id, out info);
        return(info);
    }
    private void StoreFloatUserStat(UserStatFloat i_UserStatFloat)
    {
        string         statId         = i_UserStatFloat.id;
        RemoteStatInfo remoteStatInfo = m_RemoteStatsMapper.GetRemoteStatInfo(statId);

        if (remoteStatInfo != null)
        {
            string steamStatId = remoteStatInfo.steamId;
            if (steamStatId != "")
            {
                float statValue = i_UserStatFloat.floatValue;
                SteamUserStats.SetStat(steamStatId, statValue);
            }
        }
    }
    private void CombineFloatUserStat(UserStatFloat i_UserStatFloat)
    {
        string         statId         = i_UserStatFloat.id;
        RemoteStatInfo remoteStatInfo = m_RemoteStatsMapper.GetRemoteStatInfo(statId);

        if (remoteStatInfo != null)
        {
            string steamStatId = remoteStatInfo.steamId;
            if (steamStatId != "")
            {
                float remoteValue = 0;
                if (SteamUserStats.GetStat(steamStatId, out remoteValue))
                {
                    i_UserStatFloat.Combine(remoteValue);
                }
            }
        }
    }
Beispiel #4
0
    // LOGIC

    public void Initialize()
    {
        m_Map = Resources.Load <RemoteStatsMap>(m_MapResourcePath);

        if (m_Map != null)
        {
            foreach (string key in m_Map.keys)
            {
                RemoteStatInfo statInfo = m_Map.GetRemoteStatInfo(key);
                if (statInfo != null)
                {
                    int hash = StringUtils.GetHashCode(key);
                    m_StatsMap.Add(hash, statInfo);
                }
            }
        }
        else
        {
            LogManager.LogWarning(this, "Map could not be loaded.");
        }
    }