Exemple #1
0
        private static void Dota()
        {
            //tell steam 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)
            });
            steamClient.Send(playGame);
            //give game coordinator time
            Thread.Sleep(5000);
            //send a dota client hello message(ensures dota client has started)
            var clientHello = new ClientGCMsgProtobuf <CMsgClientHello>((uint)EGCBaseClientMsg.k_EMsgGCClientHello);

            clientHello.Body.engine = ESourceEngine.k_ESE_Source2;
            gameCoordinator.Send(clientHello, 570);
            manager.RunWaitCallbacks(TimeSpan.FromSeconds(15));
            //give dota time
            Thread.Sleep(5000);
            //run a request to establish a stream
            SteamBotModule.CallIsPro(gameCoordinator, 36343070);
            dotaResponse = true;
            manager.RunWaitAllCallbacks(TimeSpan.FromSeconds(5));
            SteamBotModule.CallSourceTv(gameCoordinator);
        }
Exemple #2
0
        static void CallBackThread() //continously checks for responses from the server
        {
            int keepRunning = 0;

            while (true)
            {
                if (keepRunning == 300)
                {
                    keepRunning = 0;
                    SteamBotModule.CallSourceTv(gameCoordinator);
                    if (!dotaResponse)
                    {
                        Dota();
                    }
                    dotaResponse = false;
                }
                manager.RunWaitAllCallbacks(TimeSpan.FromMilliseconds(100));
                DotaHandler.TriggerNextAction();
                keepRunning++;
            }
        }