public void Start() { //get game coordinator handler, use in game _steamGameCoordinator = _steamClient.GetHandler <SteamGameCoordinator>(); _callbackManager.Subscribe <SteamGameCoordinator.MessageCallback>(OnGcMessage); //tell that we are playing DOTA var playGame = new ClientMsgProtobuf <CMsgClientGamesPlayed>(EMsg.ClientGamesPlayed); playGame.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed { game_id = new GameID(570), // or game_id = APPID, }); _steamClient.Send(playGame); // inform the dota GC that we want a session var clientHello = new ClientGCMsgProtobuf <CMsgClientHello>((uint)EGCBaseClientMsg.k_EMsgGCClientHello) { Body = { engine = ESourceEngine.k_ESE_Source2, client_session_need = 104 } }; AddMessageHandler((uint)EGCBaseClientMsg.k_EMsgGCClientWelcome, Connected); AddMessageHandler((uint)ESOMsg.k_ESOMsg_CacheSubscribed, OnCacheSubscribed); AddMessageHandler((uint)ESOMsg.k_ESOMsg_UpdateMultiple, OnUpdateMultiple); _steamGameCoordinator.Send(clientHello, 570); _status = DotaManagerStatus.Connecting; }
public static void CallSourceTv(SteamGameCoordinator gc) { var sourceTvRequest = new ClientGCMsgProtobuf <CMsgClientToGCFindTopSourceTVGames>((uint)EDOTAGCMsg.k_EMsgClientToGCFindTopSourceTVGames); sourceTvRequest.Body.start_game = 50; gc.Send(sourceTvRequest, 570); }
static void SteamLogin() { steamClient = new SteamClient(); #region callbacks manager = new CallbackManager(steamClient); manager.Subscribe <SteamClient.ConnectedCallback>(OnConnected); manager.Subscribe <SteamUser.LoggedOnCallback>(OnLoggedOn); manager.Subscribe <SteamUser.UpdateMachineAuthCallback>(UpdateMachineAuthCallback); // If steam guard auth succeeded manager.Subscribe <SteamClient.DisconnectedCallback>(OnDisconnected); manager.Subscribe <SteamUser.AccountInfoCallback>(OnAccountInfo); manager.Subscribe <SteamFriends.FriendMsgCallback>(OnChatMessage); manager.Subscribe <SteamUser.LoggedOffCallback>(OnLoggedOff); manager.Subscribe <SteamFriends.FriendAddedCallback>(OnFriendAdded); manager.Subscribe <SteamFriends.FriendsListCallback>(OnFriendsList); manager.Subscribe <SteamGameCoordinator.MessageCallback>(OnGCMessage); #endregion #region Handlers steamUser = steamClient.GetHandler <SteamUser>(); steamFriends = steamClient.GetHandler <SteamFriends>(); gameCoordinator = steamClient.GetHandler <SteamGameCoordinator>(); #endregion isRunning = true; steamClient.Connect(); while (isRunning) { manager.RunWaitCallbacks(TimeSpan.FromSeconds(1)); } Console.ReadKey(); }
public static void CallProfileCard(SteamGameCoordinator gc, UInt32 steamId32) { var requestProfileCard = new ClientGCMsgProtobuf <CMsgDOTAProfileCard>((uint)EDOTAGCMsg.k_EMsgClientToGCGetProfileCard); requestProfileCard.Body.account_id = steamId32; gc.Send(requestProfileCard, 570); }
public GameCoordinator(SteamClient steamClient, CallbackManager manager) { SessionMap = new Dictionary <uint, SessionInfo>(); // Map gc messages to our callback functions MessageMap = new Dictionary <uint, Action <uint, IPacketGCMsg> > { { (uint)EGCBaseClientMsg.k_EMsgGCClientConnectionStatus, OnConnectionStatus }, { (uint)EGCBaseClientMsg.k_EMsgGCClientWelcome, OnWelcome }, { (uint)EGCItemMsg.k_EMsgGCUpdateItemSchema, OnItemSchemaUpdate }, { (uint)EGCItemMsg.k_EMsgGCClientVersionUpdated, OnVersionUpdate }, { (uint)EGCBaseMsg.k_EMsgGCSystemMessage, OnSystemMessage }, // TF2 specific messages { k_EMsgGCClientGoodbye, OnConnectionStatus }, { (uint)EGCItemMsg.k_EMsgGCGoldenWrenchBroadcast, OnWrenchBroadcast }, { k_EMsgGCTFSpecificItemBroadcast, OnItemBroadcast }, }; SteamGameCoordinator = steamClient.GetHandler <SteamGameCoordinator>(); SessionTimer = new Timer(); SessionTimer.Interval = TimeSpan.FromSeconds(30).TotalMilliseconds; SessionTimer.Elapsed += OnSessionTick; SessionTimer.Start(); manager.Subscribe <SteamGameCoordinator.MessageCallback>(OnGameCoordinatorMessage); manager.Subscribe <SteamUser.LoggedOnCallback>(OnLoggedOn); manager.Subscribe <SteamUser.LoggedOffCallback>(OnLoggedOff); manager.Subscribe <SteamClient.DisconnectedCallback>(OnDisconnected); }
public static void CallPlayerInfo(SteamGameCoordinator gc, ProPlayers proPlayers) { var w = new ClientGCMsgProtobuf <CMsgGCPlayerInfoRequest>((uint)EDOTAGCMsg.k_EMsgGCPlayerInfoRequest); w.Body.player_infos = proPlayers.PlayerInfoRequest; gc.Send(w, 570); }
public static void CallIsPro(SteamGameCoordinator gc, UInt32 steamId32) { var msg = new ClientGCMsgProtobuf <CMsgGCIsProQuery>((uint)EDOTAGCMsg.k_EMsgGCIsProQuery); msg.Body.account_id = 36343070; gc.Send(msg, 570); }
public UnprotectedAccount(JsonAccounts.JsonAccount json) : base(json) { _log = LogCreator.Create("GC - " + json.Username + (!Titan.Instance.Options.Secure ? " (Unprotected)" : "")); _steamConfig = SteamConfiguration.Create(builder => { builder.WithConnectionTimeout(TimeSpan.FromMinutes(1)); //builder.WithWebAPIKey(Titan.Instance.WebHandle.GetKey()); Is null at time of this creation - needs fix }); _steamClient = new SteamClient(_steamConfig); _callbacks = new CallbackManager(_steamClient); _steamUser = _steamClient.GetHandler <SteamUser>(); _steamFriends = _steamClient.GetHandler <SteamFriends>(); _gameCoordinator = _steamClient.GetHandler <SteamGameCoordinator>(); _titanHandle = new TitanHandler(); _steamClient.AddHandler(_titanHandle); // Initialize debug network sniffer when debug mode is enabled if (Titan.Instance.Options.Debug) { var dir = new DirectoryInfo(Path.Combine(Titan.Instance.DebugDirectory.ToString(), json.Username)); if (!dir.Exists) { dir.Create(); } _steamClient.DebugNetworkListener = new NetHookNetworkListener( dir.ToString() ); } _log.Debug("Successfully initialized account object for {Username}.", json.Username); }
/// <summary> /// Starts the callback thread and connects to Steam via SteamKit2. /// </summary> /// <remarks> /// THIS NEVER RETURNS. /// </remarks> /// <returns><c>true</c>. See remarks</returns> public bool RestartBot() { if (IsRunning) { return(false); } log = new Log(LogFile, this.DisplayName, LogLevel); // Hacking around https ServicePointManager.ServerCertificateValidationCallback += SteamWeb.ValidateRemoteCertificate; log.Debug("Initializing Steam Bot..."); SteamClient = new SteamClient(); SteamTrade = SteamClient.GetHandler <SteamTrading>(); SteamUser = SteamClient.GetHandler <SteamUser>(); SteamFriends = SteamClient.GetHandler <SteamFriends>(); SteamGameCoordinator = SteamClient.GetHandler <SteamGameCoordinator>(); backgroundWorker = new BackgroundWorker { WorkerSupportsCancellation = true }; backgroundWorker.DoWork += BackgroundWorkerOnDoWork; backgroundWorker.RunWorkerCompleted += BackgroundWorkerOnRunWorkerCompleted; backgroundWorker.RunWorkerAsync(); log.Info("Connecting..."); SteamClient.Connect(); IsRunning = true; log.Info("Done Loading Bot!"); return(true); // never get here }
public Account(string Username, string Password, bool Protected = false, string SharedSecret = "") { this.Username = Username; this.Password = Password; this.Protected = Protected; this.SharedSecret = SharedSecret; this.PREFIX = "[" + Username + "] "; sentry = new SentryFile(Username); steamClient = new SteamClient(SteamConfiguration.Create((builder) => builder.WithConnectionTimeout(TimeSpan.FromSeconds(20)))); steamUser = steamClient.GetHandler <SteamUser>(); steamFriends = steamClient.GetHandler <SteamFriends>(); steamGameCoordinator = steamClient.GetHandler <SteamGameCoordinator>(); callbackManager = new CallbackManager(steamClient); callbackManager.Subscribe <SteamClient.ConnectedCallback>(OnConnected); callbackManager.Subscribe <SteamClient.DisconnectedCallback>(OnDisconnected); callbackManager.Subscribe <SteamUser.UpdateMachineAuthCallback>(OnUpdateMachineAuth); callbackManager.Subscribe <SteamUser.LoggedOnCallback>(OnLoggedOn); callbackManager.Subscribe <SteamUser.LoginKeyCallback>((callback) => { LoginKeys[Username] = callback.LoginKey; LoginKeys.Save(); }); callbackManager.Subscribe <SteamGameCoordinator.MessageCallback>(OnGCMessage); }
public UnprotectedAccount(JsonAccounts.JsonAccount json) : base(json) { _log = LogCreator.Create("GC - " + json.Username + " (Unprotected)"); _steamClient = new SteamClient(); _callbacks = new CallbackManager(_steamClient); _steamUser = _steamClient.GetHandler <SteamUser>(); _steamFriends = _steamClient.GetHandler <SteamFriends>(); _gameCoordinator = _steamClient.GetHandler <SteamGameCoordinator>(); // Initialize debug network sniffer when debug mode is enabled if (Titan.Instance.Options.Debug) { var dir = new DirectoryInfo(Path.Combine(Titan.Instance.DebugDirectory.ToString(), json.Username)); if (!dir.Exists) { dir.Create(); } _steamClient.DebugNetworkListener = new NetHookNetworkListener( dir.ToString() ); } _log.Debug("Successfully initialized account object for {0}.", json.Username); }
public BotActor() { _client = new SteamClient(); _callBackManager = new CallbackManager(_client); _userHandler = _client.GetHandler <SteamUser>(); _friendsHandler = _client.GetHandler <SteamFriends>(); _coordinatorHandler = _client.GetHandler <SteamGameCoordinator>(); }
public Bot(Configuration.BotInfo config, string apiKey, UserHandlerCreator handlerCreator, bool debug = false, bool process = false) { logOnDetails = new SteamUser.LogOnDetails { Username = config.Username, Password = config.Password }; DisplayName = config.DisplayName; MaximumTradeTime = config.MaximumTradeTime; MaximiumActionGap = config.MaximumActionGap; DisplayNamePrefix = config.DisplayNamePrefix; TradePollingInterval = config.TradePollingInterval <= 100 ? 800 : config.TradePollingInterval; Admins = config.Admins; BackpackUrl = config.Backpack; sNumberTradeFile = config.TradeNumberSaveFile; this.apiKey = apiKey; this.isprocess = process; try { LogLevel = (Log.LogLevel)Enum.Parse(typeof(Log.LogLevel), config.LogLevel, true); } catch (ArgumentException) { Console.WriteLine("Invalid LogLevel provided in configuration. Defaulting to 'INFO'"); LogLevel = Log.LogLevel.Info; } log = new Log(config.LogFile, this.DisplayName, LogLevel); CreateHandler = handlerCreator; BotControlClass = config.BotControlClass; // Hacking around https ServicePointManager.ServerCertificateValidationCallback += SteamWeb.ValidateRemoteCertificate; dReserved = new Dictionary <ulong, SteamID>(); dDonated = new Dictionary <ulong, SteamID>(); log.Debug("Initializing Steam Bot..."); SteamClient = new SteamClient(); SteamTrade = SteamClient.GetHandler <SteamTrading>(); SteamUser = SteamClient.GetHandler <SteamUser>(); SteamFriends = SteamClient.GetHandler <SteamFriends>(); SteamGameCoordinator = SteamClient.GetHandler <SteamGameCoordinator>(); craftHandler = new CraftingHandler(this); informHandler = new InformHandler(this, BotControlClass.Substring(9)); AdvertiseHandler = new AdvertiseHandler(this, BotControlClass.Substring(9), clsFunctions.BotGroup); backgroundWorker = new BackgroundWorker { WorkerSupportsCancellation = true }; if (!Directory.Exists(FriendsFolder)) { Directory.CreateDirectory(FriendsFolder); } this.FriendActivity = FriendActivity.LoadFriendActivity(FriendsFolder + logOnDetails.Username + ".json"); backgroundWorker.DoWork += BackgroundWorkerOnDoWork; backgroundWorker.RunWorkerCompleted += BackgroundWorkerOnRunWorkerCompleted; backgroundWorker.RunWorkerAsync(); }
public void Initialize(bool useUDP) { SteamClient = new SteamClient(useUDP ? ProtocolType.Udp : ProtocolType.Tcp); SteamFriends = SteamClient.GetHandler <SteamFriends>(); SteamUser = SteamClient.GetHandler <SteamUser>(); SteamTrading = SteamClient.GetHandler <SteamTrading>(); SteamWeb = SteamClient.GetHandler <SteamWeb>(); SteamGC = SteamClient.GetHandler <SteamGameCoordinator>(); }
public ProtectedAccount(JsonAccounts.JsonAccount json) : base(json) { _log = LogCreator.Create("GC - " + json.Username + (!Titan.Instance.Options.Secure ? " (Protected)" : "")); _steamConfig = SteamConfiguration.Create(builder => { builder.WithConnectionTimeout(TimeSpan.FromMinutes(1)); var key = Titan.Instance.WebHandle.GetKey(); if (!string.IsNullOrEmpty(key)) { builder.WithWebAPIKey(key); _log.Debug("Initializing with preloaded API key."); } else { _log.Debug("Initializing without API key."); } }); _sentry = new Sentry.Sentry(this); _loginKey = new LoginKey(this); _steamClient = new SteamClient(_steamConfig); _callbacks = new CallbackManager(_steamClient); _steamUser = _steamClient.GetHandler <SteamUser>(); _steamFriends = _steamClient.GetHandler <SteamFriends>(); _gameCoordinator = _steamClient.GetHandler <SteamGameCoordinator>(); // This clause excludes SteamKit debug mode as that mode is handeled seperately. // Normal debug mode doesn't equal SteamKit debug mode. if (Titan.Instance.Options.Debug) { _titanHandle = new TitanHandler(); _steamClient.AddHandler(_titanHandle); // Initialize debug network sniffer when debug mode is enabled var dir = new DirectoryInfo(Path.Combine(Titan.Instance.DebugDirectory.ToString(), json.Username)); if (!dir.Exists) { dir.Create(); } _steamClient.DebugNetworkListener = new NetHookNetworkListener( dir.ToString() ); } if (!string.IsNullOrWhiteSpace(JsonAccount.SharedSecret)) { _sharedSecretGenerator = new SharedSecret(this); } _log.Debug("Successfully initialized account object for " + json.Username + "."); }
public SteamClient(ILogger logger) { steamClient = new SteamKit2.SteamClient(); manager = new CallbackManager(steamClient); steamUser = steamClient.GetHandler <SteamUser>(); gameCoordinator = steamClient.GetHandler <SteamGameCoordinator>(); this.logger = logger; SubscribeOnCallbacks(); }
public UnprotectedAccount(JsonAccounts.JsonAccount json) : base(json) { _log = LogCreator.Create("GC - " + json.Username + " (Unprotected)"); _steamClient = new SteamClient(); _callbacks = new CallbackManager(_steamClient); _steamUser = _steamClient.GetHandler <SteamUser>(); _steamFriends = _steamClient.GetHandler <SteamFriends>(); _gameCoordinator = _steamClient.GetHandler <SteamGameCoordinator>(); _log.Debug("Successfully initialized account object for {0}.", json.Username); }
public void Start(string[] args) { DebugLog.AddListener((category, msg) => Console.WriteLine("AnonymousMethod - {0}: {1}", category, msg)); DebugLog.Enabled = false; if (args.Length < 2) { Console.WriteLine("Sample1: No username and password specified!"); return; } // save our logon details user = args[0]; pass = args[1]; // create our steamclient instance steamClient = new SteamClient(); // create the callback manager which will route callbacks to function calls manager = new CallbackManager(steamClient); // get the steamuser handler, which is used for logging on after successfully connecting steamUser = steamClient.GetHandler <SteamUser>(); // get the steam friends handler, which is used for interacting with friends on the network after logging on steamFriends = steamClient.GetHandler <SteamFriends>(); gameCoordinator = steamClient.GetHandler <SteamGameCoordinator>(); manager.Subscribe <SteamGameCoordinator.MessageCallback>(OnGCMessage); // register a few callbacks we're interested in // these are registered upon creation to a callback manager, which will then route the callbacks // to the functions specified manager.Subscribe <SteamClient.ConnectedCallback>(OnConnected); manager.Subscribe <SteamClient.DisconnectedCallback>(OnDisconnected); manager.Subscribe <SteamUser.LoggedOnCallback>(OnLoggedOn); manager.Subscribe <SteamUser.LoggedOffCallback>(OnLoggedOff); isRunning = true; Console.WriteLine("Connecting to Steam..."); // initiate the connection steamClient.Connect(); // create our callback handling loop while (isRunning) { // in order for the callbacks to get routed, they need to be handled by the manager manager.RunWaitCallbacks(TimeSpan.FromSeconds(1)); } }
public Bot(Configuration.BotInfo config, string apiKey, UserHandlerCreator handlerCreator, bool debug = false, bool process = false) { logOnDetails = new SteamUser.LogOnDetails { Username = config.Username, Password = config.Password }; DisplayName = config.DisplayName; ChatResponse = config.ChatResponse; MaximumTradeTime = config.MaximumTradeTime; MaximiumActionGap = config.MaximumActionGap; DisplayNamePrefix = config.DisplayNamePrefix; TradePollingInterval = config.TradePollingInterval <= 100 ? 800 : config.TradePollingInterval; SchemaLang = config.SchemaLang != null && config.SchemaLang.Length == 2 ? config.SchemaLang.ToLower() : "en"; Admins = config.Admins; this.ApiKey = !String.IsNullOrEmpty(config.ApiKey) ? config.ApiKey : apiKey; this.isprocess = process; try { LogLevel = (Log.LogLevel)Enum.Parse(typeof(Log.LogLevel), config.LogLevel, true); } catch (ArgumentException) { Console.WriteLine("Invalid LogLevel provided in configuration. Defaulting to 'INFO'"); LogLevel = Log.LogLevel.Info; } log = new Log(config.LogFile, this.DisplayName, LogLevel); CreateHandler = handlerCreator; BotControlClass = config.BotControlClass; SteamWeb = new SteamWeb(); // Hacking around https ServicePointManager.ServerCertificateValidationCallback += SteamWeb.ValidateRemoteCertificate; log.Debug("Initializing Steam Bot..."); SteamClient = new SteamClient(); SteamClient.AddHandler(new SteamNotifications()); SteamTrade = SteamClient.GetHandler <SteamTrading>(); SteamUser = SteamClient.GetHandler <SteamUser>(); SteamFriends = SteamClient.GetHandler <SteamFriends>(); SteamGameCoordinator = SteamClient.GetHandler <SteamGameCoordinator>(); SteamNotifications = SteamClient.GetHandler <SteamNotifications>(); backgroundWorker = new BackgroundWorker { WorkerSupportsCancellation = true }; backgroundWorker.DoWork += BackgroundWorkerOnDoWork; backgroundWorker.RunWorkerCompleted += BackgroundWorkerOnRunWorkerCompleted; backgroundWorker.RunWorkerAsync(); }
public bool Send(SteamGameCoordinator steamGC) { var request = new ClientGCMsgProtobuf <CMsgGCCStrike15_v2_Client2GCEconPreviewDataBlockRequest>((uint)ECsgoGCMsg.k_EMsgGCCStrike15_v2_Client2GCEconPreviewDataBlockRequest); request.Body.param_s = param_s; request.Body.param_a = param_a; request.Body.param_d = param_d; request.Body.param_m = param_m; //Console.WriteLine($"Requesting skin: ASSETID[{param_a}], DICKID[{param_d}], STEAMID[{param_s}], MARKETID[{param_m}]"); steamGC.Send(request, 730); return(true); }
public Dota2Client(string userName, string password) { this.userName = userName; this.password = password; isStartOver = false; steamClient = new SteamClient(); // get our handlers steamUser = steamClient.GetHandler <SteamUser>(); steamGameCoordinator = steamClient.GetHandler <SteamGameCoordinator>(); // setup callbacks callbackMgr = new CallbackManager(steamClient); callbackMgr.Subscribe <SteamClient.ConnectedCallback>(OnConnected); callbackMgr.Subscribe <SteamClient.DisconnectedCallback>(OnDisconnected); callbackMgr.Subscribe <SteamUser.LoggedOnCallback>(OnLoggedOn); callbackMgr.Subscribe <SteamGameCoordinator.MessageCallback>(OnGCMessage); }
public Dota2Client() { steam = new SteamClient(); user = steam.GetHandler <SteamUser>(); manager = new CallbackManager(steam); gameCoordinator = steam.GetHandler <SteamGameCoordinator>(); manager.Subscribe <SteamClient.ConnectedCallback>(onConnect); manager.Subscribe <SteamUser.LoggedOnCallback>(onLogon); manager.Subscribe <SteamGameCoordinator.MessageCallback>(onMessage); connected = false; loggedOn = false; welcomed = false; receivedReplayURLs = new List <string>(); }
static void Main() { Console.WriteLine("CSGO Lobby Chatter ©Radat."); Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine("Login with your Steam Account."); Console.WriteLine("Username:"******"Password:"******"LobbyID to Chat?"); * lobbyid = ulong.Parse(Console.ReadLine());*/ Console.WriteLine("Connecting to Steam..."); steamClient.Connect(); while (isRunning) { manager.RunWaitCallbacks(TimeSpan.FromSeconds(1)); } }
public ProtectedAccount(JsonAccounts.JsonAccount json) : base(json) { _log = LogCreator.Create("GC - " + json.Username + (!Titan.Instance.Options.Secure ? " (Protected)" : "")); _steamConfig = new SteamConfiguration { ConnectionTimeout = TimeSpan.FromMinutes(3), WebAPIKey = Titan.Instance.WebHandle.GetKey() // May be null at this time, but we can accept that for now }; _sentry = new Sentry.Sentry(this); _steamClient = new SteamClient(_steamConfig); _callbacks = new CallbackManager(_steamClient); _steamUser = _steamClient.GetHandler <SteamUser>(); _steamFriends = _steamClient.GetHandler <SteamFriends>(); _gameCoordinator = _steamClient.GetHandler <SteamGameCoordinator>(); _titanHandle = new TitanHandler(); _steamClient.AddHandler(_titanHandle); // Initialize debug network sniffer when debug mode is enabled if (Titan.Instance.Options.Debug) { var dir = new DirectoryInfo(Path.Combine(Titan.Instance.DebugDirectory.ToString(), json.Username)); if (!dir.Exists) { dir.Create(); } _steamClient.DebugNetworkListener = new NetHookNetworkListener( dir.ToString() ); } if (json.SharedSecret != null) { _sgAccount = new SteamGuardAccount { SharedSecret = json.SharedSecret }; } _log.Debug("Successfully initialized account object for " + json.Username + "."); }
public DotaClient(string userName, string password, uint matchId) { this.userName = userName; this.password = password; this.matchId = matchId; client = new SteamClient(); user = client.GetHandler <SteamUser>(); gameCoordinator = client.GetHandler <SteamGameCoordinator>(); callbackMgr = new CallbackManager(client); callbackMgr.Subscribe <SteamClient.ConnectedCallback>(OnConnected); callbackMgr.Subscribe <SteamUser.LoggedOnCallback>(OnLoggedOn); callbackMgr.Subscribe <SteamGameCoordinator.MessageCallback>(OnGCMessage); }
static void SteamLogin() { steamClient = new SteamClient(); #region callbacks manager = new CallbackManager(steamClient); manager.Subscribe <SteamClient.ConnectedCallback>(OnConnected); manager.Subscribe <SteamClient.DisconnectedCallback>(OnDisconnected); manager.Subscribe <SteamUser.LoggedOnCallback>(OnLoggedOn); manager.Subscribe <SteamUser.UpdateMachineAuthCallback>(UpdateMachineAuthCallback); // If steam guard auth succeeded manager.Subscribe <SteamUser.AccountInfoCallback>(OnAccountInfo); manager.Subscribe <SteamUser.LoggedOffCallback>(OnLoggedOff); manager.Subscribe <SteamFriends.FriendMsgCallback>(OnChatMessage); manager.Subscribe <SteamFriends.FriendAddedCallback>(OnFriendAdded); manager.Subscribe <SteamFriends.FriendsListCallback>(OnFriendsList); manager.Subscribe <SteamGameCoordinator.MessageCallback>(OnGCMessage); #endregion #region Handlers steamUser = steamClient.GetHandler <SteamUser>(); steamFriends = steamClient.GetHandler <SteamFriends>(); steamCloud = steamClient.GetHandler <SteamCloud>(); steamGameServer = steamClient.GetHandler <SteamGameServer>(); steamMasterServer = steamClient.GetHandler <SteamMasterServer>(); steamGameCoordinator = steamClient.GetHandler <SteamGameCoordinator>(); steamScreenshots = steamClient.GetHandler <SteamScreenshots>(); steamTrading = steamClient.GetHandler <SteamTrading>(); steamUFM = steamClient.GetHandler <SteamUnifiedMessages>(); steamUserStats = steamClient.GetHandler <SteamUserStats>(); steamWorkShop = steamClient.GetHandler <SteamWorkshop>(); #endregion isRunning = true; Console.Title = "Steam Bot - Connecting..."; steamClient.Connect(); while (isRunning) { manager.RunWaitCallbacks(TimeSpan.FromSeconds(1)); } Console.ReadKey(); }
public DotaClient(LoginInfo loginInfo) { this.loginInfo = loginInfo; client = new SteamClient(); // get our handlers user = client.GetHandler <SteamUser>(); gameCoordinator = client.GetHandler <SteamGameCoordinator>(); // setup callbacks callbackMgr = new CallbackManager(client); callbackMgr.Subscribe <SteamClient.ConnectedCallback>(OnConnected); callbackMgr.Subscribe <SteamClient.DisconnectedCallback>(OnDisconnected); callbackMgr.Subscribe <SteamUser.LoggedOnCallback>(OnLoggedOn); callbackMgr.Subscribe <SteamUser.LoggedOffCallback>(OnLoggedOff); callbackMgr.Subscribe <SteamGameCoordinator.MessageCallback>(OnGCMessage); }
public DotaClient(string userName, string password, uint matchId) { this.userName = userName; this.password = password; this.matchId = matchId; client = new SteamClient(); // get our handlers user = client.GetHandler <SteamUser>(); gameCoordinator = client.GetHandler <SteamGameCoordinator>(); // setup callbacks callbackMgr = new CallbackManager(client); new Callback <SteamClient.ConnectedCallback>(OnConnected, callbackMgr); new Callback <SteamUser.LoggedOnCallback>(OnLoggedOn, callbackMgr); new Callback <SteamGameCoordinator.MessageCallback>(OnGCMessage, callbackMgr); }
public SteamBot() { steamUser = steamClient.GetHandler <SteamUser>(); steamFriends = steamClient.GetHandler <SteamFriends>(); gameCoordinator = steamClient.GetHandler <SteamGameCoordinator>(); manager.Subscribe <SteamClient.ConnectedCallback>(new JobID(), OnConnected); manager.Subscribe <SteamUser.LoggedOnCallback>(new JobID(), OnLoggedOn); manager.Subscribe <SteamClient.DisconnectedCallback>(new JobID(), OnDisconected); manager.Subscribe <SteamUser.UpdateMachineAuthCallback>(new JobID(), UpdateMachineAuthCallBack); manager.Subscribe <SteamGameCoordinator.MessageCallback>(new JobID(), DotaHandler.OnGCMessage); //connect to steam steamClient.Connect(); ConnectionCallback(); Dota(); //start dedicated callback listener Thread.Sleep(5000); Thread callbackThread = new Thread(new ThreadStart(CallBackThread)); callbackThread.Start(); }
public BanCheck(string login, string pass) { username = login; password = pass; steamClient = new SteamClient(); manager = new CallbackManager(steamClient); steamUser = steamClient.GetHandler <SteamUser>(); SteamGameCoordinator = steamClient.GetHandler <SteamGameCoordinator>(); manager.Subscribe <SteamClient.ConnectedCallback>(OnConnected); manager.Subscribe <SteamClient.DisconnectedCallback>(OnDisconnected); manager.Subscribe <SteamApps.VACStatusCallback>(OnVACStatus); manager.Subscribe <SteamUser.LoggedOnCallback>(OnLoggedOn); manager.Subscribe <SteamUser.LoggedOffCallback>(OnLoggedOff); manager.Subscribe <SteamGameCoordinator.MessageCallback>(OnMessageCall); }