Esempio n. 1
0
    public static void Init()
    {
        RawFuncs.Print("Steam init! TestVer: 003");

        SteamStatsAndAchievements.WhatsMySteamName();
        leaderboardLabels = new string[totalNumOfLeaderboards];
        leaderboardTypes  = new FreshLevels.Type[totalNumOfLeaderboards];
        queue             = new List <Item>();

        for (int i = 0; i < totalNumOfLeaderboards; i++)
        {
            leaderboardTypes[i] = FreshLevels.IndexForLevelLeaderboard(i);
            bool syncThis = true;
            if (PlayerPrefs.HasKey("Syncd_" + leaderboardTypes[i]))
            {
                int result = 0;
                result = PlayerPrefs.GetInt("Syncd_" + leaderboardTypes[i], 0);
                if (result == 1)
                {
                    syncThis = false;
                }
            }

            if (syncThis)
            {
                float pb = PlayerPrefs.GetFloat("LevelTime_" + leaderboardTypes[i], -1);
                AddToQueue(FreshLevels.IndexForLevelLeaderboard(i), pb);

                RawFuncs.Print("" + leaderboardTypes[i] + ": " + pb + ", added to queue");
            }
        }
    }
Esempio n. 2
0
 /// <summary>
 /// RUn after isValidApp.
 /// </summary>
 public static void FinalInit()
 {
     statsAndAchievements   = new SteamStatsAndAchievements();
     SteamUGCworkshop       = new SteamUGCTest();
     SteamRemoteStorageTest = new SteamRemoteStorageTest();
     SteamAntiCheatClass    = new SteamAntiCheat();
     SteamFriendsClass      = new SteamFriendsA();
     SteamMatchmakingClass  = new SteamMatchmakingTest();
 }
Esempio n. 3
0
    // Use this for initialization
    public void Start()
    {
        if (m_StatsAndAchievements == null)
        {
            m_StatsAndAchievements = GameObject.FindObjectOfType <SteamStatsAndAchievements>();

            if (m_StatsAndAchievements != null)
            {
                m_StatsAndAchievements.OnGameStateChange(EClientGameState.k_EClientGameActive);
            }
        }
    }
Esempio n. 4
0
	private void Awake() {
		// Only one instance of SteamManager at a time!
		if (s_instance != null) {
			Destroy(gameObject);
			return;
		}
		s_instance = this;

		// We want our SteamManager Instance to persist across scenes.
		DontDestroyOnLoad(gameObject);

		if (!Packsize.Test()) {
			Debug.LogError("[Steamworks.NET] Packsize Test returned false, the wrong version of Steamworks.NET is being run in this platform.", this);
		}

		try {
			// If Steam is not running or the game wasn't started through Steam, SteamAPI_RestartAppIfNecessary starts the 
			// Steam client and also launches this game again if the User owns it. This can act as a rudimentary form of DRM.

			// Once you get a Steam AppID assigned by Valve, you need to replace AppId_t.Invalid with it and
			// remove steam_appid.txt from the game depot. eg: "(AppId_t)480" or "new AppId_t(480)".
			// See the Valve documentation for more information: https://partner.steamgames.com/documentation/drm#FAQ
			if (SteamAPI.RestartAppIfNecessary(AppId_t.Invalid)) {
				Application.Quit();
				return;
			}
		}
		catch (System.DllNotFoundException e) { // We catch this exception here, as it will be the first occurence of it.
			Debug.LogError("[Steamworks.NET] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + e, this);

			Application.Quit();
			return;
		}

		m_StatsAndAchievements = gameObject.AddComponent<SteamStatsAndAchievements>();
		m_Leaderboards = gameObject.AddComponent<SteamLeaderboards>();

		// Initialize the SteamAPI, if Init() returns false this can happen for many reasons.
		// Some examples include:
		// Steam Client is not running.
		// Launching from outside of steam without a steam_appid.txt file in place.
		// https://partner.steamgames.com/documentation/example // Under: Common Build Problems
		// https://partner.steamgames.com/documentation/bootstrap_stats // At the very bottom

		// If you're running into Init issues try running DbgView prior to launching to get the internal output from Steam.
		// http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
		m_bInitialized = SteamAPI.Init();
		if (!m_bInitialized) {
			Debug.LogError("[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.", this);

			return;
		}
	}
Esempio n. 5
0
 // Start is called before the first frame update
 void Start()
 {
     steamStats = GetComponent <SteamStatsAndAchievements>();
     //assign accountpref strings based on UI Manager's endgame stats:
     accountPrefs = new string[UIManager.UIM.p1Texts.Length];
     for (int i = 0; i < UIManager.UIM.p1Texts.Length; i++)
     {
         accountPrefs[i] = UIManager.UIM.p1Texts[i].name;
     }
     matchesMade = new int[5, 10];//setting this here now, but may not need to if we use the SetStats function
     pStats      = new int[3, 20];
     InitEndGame();
 }
Esempio n. 6
0
    public static void GetAchivo(Achivos achivo)
    {
        if (myAchivos[(int)achivo] == false)
        {
            PopupAchivo(achivo);

            if (achivo == Achivos.Achivo_AllasKlar)
            {
                if (SteamManager.Initialized)
                {
                    SteamUserStats.SetAchievement("allesklar");
                }
            }
        }
        myAchivos[(int)achivo] = true;
        Fresh_Saving.SaveLocalAchivos();


        SteamStatsAndAchievements.TellSteamAboutMyAchievos();
    }
Esempio n. 7
0
    private void Start()
    {
        IniPos = transform.position;
        Hide();

        _steamStatsAndAchievements = FindObjectOfType <SteamStatsAndAchievements>();

        var titleLbl = GetChildCalled("Title");

        _title = titleLbl.GetComponentInChildren <Text>();

        var selLoad = GetChildCalled("Selected_To_Load");

        var saveNameLbl = GetChildCalled("Save_Name_Lbl");

        var scroll = GetChildCalled("Scroll_View");

        _content = GetGrandChildCalledFromThis("Content", scroll);
        _contentRectTransform = _content.GetComponent <RectTransform>();

        _scroll_Ini_PosGO = GetChildCalledOnThis("Scroll_Ini_Pos", _content);
    }
	private void OnEnable() {
		m_StatsAndAchievements = GameObject.FindObjectOfType<SteamStatsAndAchievements>();

		m_StatsAndAchievements.OnGameStateChange(EClientGameState.k_EClientGameActive);
	}
Esempio n. 9
0
 private void OnEnable()
 {
     m_StatsAndAchievements = GameObject.FindObjectOfType <SteamStatsAndAchievements>();
 }
Esempio n. 10
0
    private void OnEnable()
    {
        m_StatsAndAchievements = GameObject.FindObjectOfType <SteamStatsAndAchievements>();

        m_StatsAndAchievements.OnGameStateChange(EClientGameState.k_EClientGameActive);
    }