Skip to content

Commit

Permalink
v3.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
ipax77 committed Nov 16, 2022
1 parent b1cab42 commit 5c2d893
Show file tree
Hide file tree
Showing 9 changed files with 596 additions and 12 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

3.0.13

- protocol 89165

3.0.12

- protocol 88500 (patch 5.0.10)
Expand Down
2 changes: 1 addition & 1 deletion sc2dsstats.app/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class Program
{
public static string workdir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\sc2dsstats_desktop";
public static string myConfig = workdir + "\\config2.json";
public static Version Version = new Version(3, 0, 12);
public static Version Version = new Version(3, 0, 13);

public static void Main(string[] args)
{
Expand Down
7 changes: 7 additions & 0 deletions sc2dsstats.app/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
</a>
</div>
</div>
<div class="nav-item px-3">
<p class="text-warning">
This app has reached the end of its lifespan :( Please switch to the
<a href="https://github.com/ipax77/dsstats">new version</a>
thank you!
</p>
</div>
</nav>
</div>
<div class="ms-3">
Expand Down
2 changes: 1 addition & 1 deletion sc2dsstats.app/electron.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"appId": "com.sc2dsstats.app.app",
"productName": "sc2dsstats.app",
"copyright": "Copyright © 2022",
"buildVersion": "3.0.12",
"buildVersion": "3.0.13",
"compression": "maximum",
"directories": {
"output": "../../../bin/Desktop"
Expand Down
2 changes: 1 addition & 1 deletion sc2dsstats.app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sc2dsstats.app",
"version": "3.0.12",
"version": "3.0.13",
"description": "Direct Strike Statistics",
"repository": {
"type": "git",
Expand Down
64 changes: 56 additions & 8 deletions sc2dsstats.db/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static void Main(string[] args)
var connectionString = config.GetProperty("WSLConnectionString2").GetString();
var serverVersion = new MySqlServerVersion(new System.Version(5, 0, 34));

bool dbToggle = true;
bool dbToggle = false;

if (dbToggle)
{
Expand Down Expand Up @@ -75,15 +75,63 @@ static void Main(string[] args)
Stopwatch sw = new Stopwatch();
sw.Start();

logger.LogInformation($"replays: {context.Dsreplays.Count()}");
int winMax = 0;
int losMax = 0;

var replays = context.Dsreplays
.Include(i => i.Dsplayers).ThenInclude(j => j.PlayerName)
.Where(x => x.DefaultFilter)
int wins = 0;
int loss = 0;

var ents = context.Dsreplays
.Include(i => i.Dsplayers)
.OrderBy(o => o.Gametime)
.AsNoTracking()
// .Take(40000)
.ToList();
.SelectMany(s => s.Dsplayers).Where(x => x.isPlayer)
.Select(s => s.Win)
.ToList()
;

bool current = true;
for (int i = 0; i < ents.Count; i++)
{
if (ents[i] == current)
{
if (current)
{
wins++;
}
else
{
loss++;
}
} else
{
if (current && wins > winMax)
{
winMax = wins;
}
else if (!current && loss > losMax)
{
losMax = loss;
}

wins = 0;
loss = 0;
}
current = ents[i];
}
Console.WriteLine($"Replays: {ents.Count}");
Console.WriteLine($"Winstreak max: {winMax}");
Console.WriteLine($"Loosesreak max: {losMax}");
Console.WriteLine($"Winrate: {Math.Round(ents.Count(c => c == true) * 100.0 / (double)ents.Count, 2)}");

// logger.LogInformation($"replays: {context.Dsreplays.Count()}");

// var replays = context.Dsreplays
// .Include(i => i.Dsplayers).ThenInclude(j => j.PlayerName)
// .Where(x => x.DefaultFilter)
// .OrderBy(o => o.Gametime)
// .AsNoTracking()
// // .Take(40000)
// .ToList();

//Dictionary<string, EloPlayer> eloPlayers = new Dictionary<string, EloPlayer>();
//foreach (var replay in replays)
Expand Down
2 changes: 1 addition & 1 deletion sc2dsstats.db/sc2dsstats.db.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!--<OutputType>Exe</OutputType>-->
<!-- <OutputType>Exe</OutputType> -->
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<!--<RuntimeIdentifier>win-x64</RuntimeIdentifier>-->
Expand Down
Loading

0 comments on commit 5c2d893

Please sign in to comment.