Example #1
0
        private Steam()
        {
            Configuration = SteamConfiguration.Create(b => b
                                                      .WithServerListProvider(new FileStorageServerListProvider(Path.Combine(Application.Path, "files", ".support", "servers.bin")))
                                                      .WithCellID(LocalConfig.Current.CellID)
                                                      .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.Current.CanQueryStore)
            {
                Handlers.Add(new FreeLicense(CallbackManager));
            }

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

                WatchdogHandle = new Watchdog();
            }

            PICSChanges    = new PICSChanges(CallbackManager);
            DepotProcessor = new DepotProcessor(Client, CallbackManager);

            IsRunning = true;
        }
Example #2
0
        public void Dispose()
        {
            if (DepotProcessor != null)
            {
                DepotProcessor.Dispose();
                DepotProcessor = null;
            }

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