Exemplo n.º 1
0
        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();
        }
Exemplo 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();
        }
Exemplo 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}");
        }
Exemplo n.º 5
0
        public void AppInstallDir()
        {
            var str = SteamApps.AppInstallDir();

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

            Console.WriteLine($"{str}");
        }
Exemplo 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}");
            }
        }
Exemplo 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();
        }
Exemplo 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));
 }