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)); }
public async Task <IActionResult> GetMatchDetails(long matchId) { Match match = await OpenDotaHelper.GetMatch(matchId); JObject matchDetails = OpenDotaHelper.GetMatchDetails(match); return(Ok(JsonConvert.SerializeObject((matchDetails)))); }
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")); }
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(); }
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); }