SHARE
TWEET

Untitled

a guest Aug 11th, 2016 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using SteamKit2;
  3.  
  4. namespace StartProject
  5. {
  6.     class Program
  7.     {
  8.         private static SteamUser su;
  9.         private static bool running;
  10.  
  11.         static void Main(string[] args)
  12.         {
  13.             running = true;
  14.             SteamClient steamClient = new SteamClient();
  15.  
  16.             CallbackManager cbManager;
  17.             cbManager = new CallbackManager(steamClient);
  18.  
  19.             su = steamClient.GetHandler<SteamUser>();
  20.  
  21.             cbManager.Subscribe<SteamClient.ConnectedCallback>(ConnectedCallback);
  22.             cbManager.Subscribe<SteamApps.AppChangesCallback>(AppChangesCallback);
  23.             cbManager.Subscribe<SteamUser.LoggedOnCallback>(OnLogOn);
  24.  
  25.             Console.WriteLine("connecting...");
  26.  
  27.             steamClient.Connect();
  28.  
  29.             while (running)
  30.             {
  31.                 cbManager.RunWaitCallbacks(TimeSpan.FromSeconds(1));
  32.             }
  33.         }
  34.        
  35.         static void AppChangesCallback(SteamApps.AppChangesCallback cbd)
  36.         {
  37.             Console.WriteLine("changenumber: " + cbd.CurrentChangeNumber);
  38.         }
  39.  
  40.         static void ConnectedCallback(SteamClient.ConnectedCallback cbd)
  41.         {
  42.             if(cbd.Result != EResult.OK)
  43.             {
  44.                 Console.WriteLine("Cannot connect to steam");
  45.                 return;
  46.             }
  47.             Console.WriteLine("connected");
  48.  
  49.             su.LogOn(new SteamUser.LogOnDetails() { Username = "niggerfaggot1115", Password = "ihatemyparents" });
  50.         }
  51.  
  52.  
  53.         static void OnLogOn(SteamUser.LoggedOnCallback cbd)
  54.         {
  55.             if(cbd.Result != EResult.OK)
  56.             {
  57.                 Console.WriteLine("unable to log on: {0} / {1}", cbd.Result, cbd.ExtendedResult);
  58.                 return;
  59.             }
  60.             Console.WriteLine("logged on");
  61.         }
  62.  
  63.     }
  64. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top