2018-07-13 03:57:29 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.Linq;
|
2018-08-12 01:21:12 +02:00
|
|
|
|
using System.IO;
|
2018-07-13 03:57:29 +02:00
|
|
|
|
|
|
|
|
|
namespace OWTrack
|
|
|
|
|
{
|
|
|
|
|
class Tracker
|
|
|
|
|
{
|
2018-08-15 10:32:42 +02:00
|
|
|
|
public int wins, losses, startSR, newSR = 0;
|
2018-08-31 19:17:26 +02:00
|
|
|
|
public string gamePath;
|
2018-07-13 03:57:29 +02:00
|
|
|
|
|
2018-08-15 10:32:42 +02:00
|
|
|
|
public void Track() { }
|
2018-08-15 10:46:05 +02:00
|
|
|
|
public void reset() { wins = 0; losses = 0; startSR = 0; newSR = 0; }
|
2018-08-15 10:32:42 +02:00
|
|
|
|
public void addWin() { wins++; }
|
|
|
|
|
public void addLoss() { losses++; }
|
|
|
|
|
public void reduceWin() { wins--; }
|
|
|
|
|
public void rediceLoss() { losses--; }
|
|
|
|
|
public int GetWins() { return wins; }
|
|
|
|
|
public int GetLosses() { return losses; }
|
|
|
|
|
public void setNewSR(int SR) { newSR = SR; }
|
|
|
|
|
public int srDiff() { return newSR - startSR; }
|
2018-08-12 01:21:12 +02:00
|
|
|
|
|
2018-08-31 19:17:26 +02:00
|
|
|
|
|
2018-07-13 03:57:29 +02:00
|
|
|
|
public bool owRunning()
|
2018-07-15 21:22:02 +02:00
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
bool isRunning = Process.GetProcessesByName("Overwatch")
|
2018-08-31 19:17:26 +02:00
|
|
|
|
.FirstOrDefault(p => p.MainModule.FileName.StartsWith(gamePath)) != default(Process);
|
2018-07-15 21:22:02 +02:00
|
|
|
|
return isRunning;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
Exception ex = new Exception("Error in tracking Overwatch.exe");
|
|
|
|
|
throw ex;
|
|
|
|
|
}
|
2018-08-15 10:32:42 +02:00
|
|
|
|
}
|
2018-07-13 03:57:29 +02:00
|
|
|
|
}
|
|
|
|
|
}
|