public static void Shutdown()
        {
            Event.DisposeAllClient();

            initialized = false;

            ShutdownInterfaces();
            SteamApps.Shutdown();
            SteamUtils.Shutdown();
            SteamParental.Shutdown();
            SteamMusic.Shutdown();
            SteamVideo.Shutdown();
            SteamUser.Shutdown();
            SteamFriends.Shutdown();
            SteamScreenshots.Shutdown();
            SteamUserStats.Shutdown();
            SteamInventory.Shutdown();
            SteamNetworking.Shutdown();
            SteamMatchmaking.Shutdown();
            SteamParties.Shutdown();
            SteamNetworkingUtils.Shutdown();
            SteamNetworkingSockets.Shutdown();
            ServerList.Base.Shutdown();

            SteamAPI.Shutdown();
        }
        public static void Init(uint appid)
        {
            System.Environment.SetEnvironmentVariable("SteamAppId", appid.ToString());
            System.Environment.SetEnvironmentVariable("SteamGameId", appid.ToString());

            if (!SteamAPI.Init())
            {
                throw new System.Exception("SteamApi_Init returned false. Steam isn't running, couldn't find Steam, AppId is ureleased, Don't own AppId.");
            }

            AppId = appid;

            initialized = true;

            SteamApps.InstallEvents();
            SteamUtils.InstallEvents();
            SteamParental.InstallEvents();
            SteamMusic.InstallEvents();
            SteamVideo.InstallEvents();
            SteamUser.InstallEvents();
            SteamFriends.InstallEvents();
            SteamScreenshots.InstallEvents();
            SteamUserStats.InstallEvents();
            SteamInventory.InstallEvents();
            SteamNetworking.InstallEvents();
            SteamMatchmaking.InstallEvents();
            SteamParties.InstallEvents();
            SteamNetworkingSockets.InstallEvents();
            SteamInput.InstallEvents();

            RunCallbacksAsync();
        }
Esempio n. 3
0
        public static void Init(uint appid)
        {
            if (IntPtr.Size != 8)
            {
                throw new System.Exception("Only 64bit processes are currently supported");
            }

            System.Environment.SetEnvironmentVariable("SteamAppId", appid.ToString());
            System.Environment.SetEnvironmentVariable("SteamGameId", appid.ToString());

            if (!SteamAPI.Init())
            {
                throw new System.Exception("SteamApi_Init returned false. Steam isn't running, couldn't find Steam, AppId is ureleased, Don't own AppId.");
            }

            AppId = appid;

            initialized = true;


            SteamApps.InstallEvents();
            SteamUtils.InstallEvents();
            SteamParental.InstallEvents();
            SteamMusic.InstallEvents();
            SteamVideo.InstallEvents();
            SteamUser.InstallEvents();
            SteamFriends.InstallEvents();
            SteamScreenshots.InstallEvents();
            SteamUserStats.InstallEvents();
            SteamInventory.InstallEvents();

            RunCallbacksAsync();
        }
Esempio n. 4
0
        public async Task GetFileDetails()
        {
            var fileinfo = await SteamApps.GetFileDetailsAsync("RustClient.exe");

            Console.WriteLine($"fileinfo.SizeInBytes: {fileinfo?.SizeInBytes}");
            Console.WriteLine($"fileinfo.Sha1: {fileinfo?.Sha1}");
            Console.WriteLine($"fileinfo.Flags: {fileinfo?.Flags}");
        }
Esempio n. 5
0
        public void AppInstallDir()
        {
            var str = SteamApps.AppInstallDir();

            Assert.IsNotNull(str);
            Assert.IsTrue(str.Length > 3);

            Console.WriteLine($"{str}");
        }
Esempio n. 6
0
        public void InstalledDepots()
        {
            var depots = SteamApps.InstalledDepots().ToArray();

            Assert.IsNotNull(depots);
            Assert.IsTrue(depots.Length > 0);

            foreach (var depot in depots)
            {
                Console.WriteLine($"{depot.Value}");
            }
        }
Esempio n. 7
0
        public static void Shutdown()
        {
            Event.DisposeAllClient();

            initialized = false;

            SteamApps.Shutdown();
            SteamUtils.Shutdown();
            SteamParental.Shutdown();
            SteamMusic.Shutdown();
            SteamVideo.Shutdown();
            SteamUser.Shutdown();
            SteamFriends.Shutdown();
            SteamScreenshots.Shutdown();
            SteamUserStats.Shutdown();
            SteamInventory.Shutdown();

            SteamAPI.Shutdown();
        }
Esempio n. 8
0
 public static bool ResolveChineseLanguage(out string chineseLanguage)
 {
     if (global::Application.chineseLanguage == null)
     {
         global::Application.chineseLanguage = string.Empty;
         try
         {
             Steamworks.SteamApps steamApps = Steamworks.SteamAPI.SteamApps;
             if (steamApps != null)
             {
                 string currentGameLanguage = steamApps.GetCurrentGameLanguage();
                 if (currentGameLanguage == "tchinese" || currentGameLanguage == "schinese")
                 {
                     global::Application.chineseLanguage = currentGameLanguage;
                 }
             }
         }
         catch
         {
         }
     }
     chineseLanguage = global::Application.chineseLanguage;
     return(!string.IsNullOrEmpty(global::Application.chineseLanguage));
 }