예제 #1
0
        public void Dispose()
        {
            if (DepotProcessor != null)
            {
                DepotProcessor.Dispose();
                DepotProcessor = null;
            }

            if (WatchdogHandle != null)
            {
                WatchdogHandle.Dispose();
                WatchdogHandle = null;
            }

            if (FreeLicense != null)
            {
                FreeLicense.Dispose();
                FreeLicense = null;
            }

            if (KeyActivatorHandle != null)
            {
                KeyActivatorHandle.Dispose();
                KeyActivatorHandle = null;
            }
        }
예제 #2
0
        private Steam()
        {
            Configuration = SteamConfiguration.Create(b => b
                                                      .WithServerListProvider(new FileStorageServerListProvider(Path.Combine(Path.GetTempPath(), "steamdb_steamkit_servers.bin")))
                                                      .WithProtocolTypes(ProtocolTypes.Tcp)
                                                      .WithWebAPIKey(Settings.Current.Steam.WebAPIKey)
                                                      );

            Client = new SteamClient(Configuration, "SteamDB");

#if DEBUG_NETHOOK
            Client.DebugNetworkListener = new NetHookNetworkListener();
#endif

            User            = Client.GetHandler <SteamUser>();
            Apps            = Client.GetHandler <SteamApps>();
            Friends         = Client.GetHandler <SteamFriends>();
            UserStats       = Client.GetHandler <SteamUserStats>();
            UnifiedMessages = Client.GetHandler <SteamUnifiedMessages>();

            CallbackManager = new CallbackManager(Client);

            Client.AddHandler(new PurchaseResponse());

            Handlers = new List <SteamHandler>
            {
                new Connection(CallbackManager),
                new AccountInfo(CallbackManager),
                new PICSProductInfo(CallbackManager),
                new PICSTokens(CallbackManager),
                new LicenseList(CallbackManager),
                new WebAuth(CallbackManager)
            };

            if (!Settings.IsFullRun)
            {
                Handlers.Add(new ClanState(CallbackManager));

                if (Settings.IsMillhaven)
                {
                    KeyActivatorHandle = new KeyActivator();
                }
            }

            FreeLicense    = new FreeLicense(CallbackManager);
            PICSChanges    = new PICSChanges(CallbackManager);
            DepotProcessor = new DepotProcessor(Client);
            WatchdogHandle = new Watchdog();

            IsRunning = true;
        }