Example #1
0
        public async Task <IActionResult> StartReplay(long matchId, int playerSlot)
        {
            Match match = await OpenDotaHelper.GetMatch(matchId);

            Replay replay = await OpenDotaHelper.GetReplay(matchId);

            string replayUrl = OpenDotaHelper.BuildReplayUrl(replay.match_id, replay.cluster, replay.replay_salt);

            FileHelper.InitializeWatcher();
            FileHelper.DownloadAndUnzipReplay(replayUrl, matchId);

            Debug.WriteLine("Match id is: " + matchId);
            bool success = await DotaClientHelper.LaunchDota();

            Debug.Write("success when starting dota is: " + success);

            DotaClientHelper.StartReplay(playerSlot, matchId);

            await ObsStudioHelper.StartObs();

            Debug.Write("watching for ths many seconds:  " + match.duration);
            await ObsStudioHelper.WatchObs(match.duration);

            ObsStudioHelper.StopObs();

            return(Ok(200));
        }
Example #2
0
        public async Task <IActionResult> GetMatchDetails(long matchId)
        {
            Match match = await OpenDotaHelper.GetMatch(matchId);

            JObject matchDetails = OpenDotaHelper.GetMatchDetails(match);

            return(Ok(JsonConvert.SerializeObject((matchDetails))));
        }
Example #3
0
        public IActionResult GetHeroImage(int heroId)
        {
            Hero   hero            = OpenDotaHelper.GetHeroFromId(heroId);
            string contentRootPath = hostingEnvironment.ContentRootPath;
            string file            = Path.GetFullPath(Path.Combine(contentRootPath, Constants.HeroImagesPath, hero.img));

            Console.WriteLine(file);
            Byte[] bytes = System.IO.File.ReadAllBytes(file);
            return(File(bytes, "image/png"));
        }
Example #4
0
 public void Dispose()
 {
     TopPanel.OnDeactivate();
     HeroOverlay.OnDeactivate();
     ItemPanel.OnDeactivate();
     NetworthPanel.OnDeactivate();
     ShrineHelper.OnDeactivate();
     TpCatcher.OnDeactivate();
     LastPositionTracker.OnDeactivate();
     OpenDotaHelper.OnDeactivate();
     ShowMeMore.Dispose();
     RoshanTimer.Dispose();
     ShowIllusions.Dispose();
     Factory?.Dispose();
 }
Example #5
0
        public Config(OverlayInformation overlayInformation)
        {
            Factory = MenuFactory.Create("Overlay Information");
            Factory.Target.SetFontColor(Color.YellowGreen);

            Main                = overlayInformation;
            TopPanel            = new TopPanel(this);
            HeroOverlay         = new HeroOverlay(this);
            CourEsp             = new CourEsp(this);
            ItemPanel           = new ItemPanel(this);
            NetworthPanel       = new NetworthPanel(this);
            ShrineHelper        = new ShrineHelper(this);
            TpCatcher           = new TpCatcher(this);
            LastPositionTracker = new LastPositionTracker(this);
            OpenDotaHelper      = new OpenDotaHelper(this);
            ShowMeMore          = new ShowMeMore(this);
            RoshanTimer         = new RoshanTimer(this);
            ShowIllusions       = new ShowIllusions(this);
        }