Skip to content

Commit

Permalink
feat: add esportal source detection
Browse files Browse the repository at this point in the history
  • Loading branch information
akiver committed Apr 1, 2022
1 parent ccdc551 commit 309ea89
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
<Compile Include="Models\Serialization\SideToStringConverter.cs" />
<Compile Include="Models\Side.cs" />
<Compile Include="Models\Source\Esl.cs" />
<Compile Include="Models\Source\Esportal.cs" />
<Compile Include="Models\Source\Wanmei.cs" />
<Compile Include="Models\Steam\VanityUrlResponse.cs" />
<Compile Include="Models\Stuff.cs" />
Expand Down Expand Up @@ -309,6 +310,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="Resources\Images\Logos\esl.png" />
<Content Include="Resources\Images\Logos\esportal.png" />
<Content Include="Resources\Images\Logos\wanmei.png" />
</ItemGroup>
<ItemGroup>
Expand Down
13 changes: 13 additions & 0 deletions Core/Models/Source/Esportal.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Core.Models.Source
{
public class Esportal : Source
{
public const string NAME = "esportal";

public Esportal()
{
Name = NAME;
Label = "Esportal";
}
}
}
5 changes: 5 additions & 0 deletions Core/Models/Source/Source.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public Image Logo
return Properties.Resources.popflash;
case Wanmei.NAME:
return Properties.Resources.wanmei;
case Esportal.NAME:
return Properties.Resources.esportal;
default:
return Properties.Resources.valve;
}
Expand Down Expand Up @@ -59,6 +61,8 @@ public static Source Factory(string name)
return new Esl();
case Wanmei.NAME:
return new Wanmei();
case Esportal.NAME:
return new Esportal();
default:
return null;
}
Expand All @@ -74,6 +78,7 @@ public static Source Factory(string name)
new PopFlash(),
new Valve(),
new Wanmei(),
new Esportal(),
new Pov(),
};
}
Expand Down
12 changes: 11 additions & 1 deletion Core/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Core/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@
<data name="esl" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Images\Logos\esl.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="esportal" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Images\Logos\esportal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="faceit" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Images\Logos\faceit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down
Binary file added Core/Resources/Images/Logos/esportal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Manager/Resources/DataGrids.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource MahApps.Colors.Highlight}" Opacity="0.7" />
<SolidColorBrush Color="{DynamicResource MahApps.Colors.BackgroundColor}" />
</Setter.Value>
</Setter>
</Style>
Expand Down
6 changes: 6 additions & 0 deletions Services/Concrete/Analyzer/DemoAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public static DemoAnalyzer Factory(Demo demo)
return new EseaAnalyzer(demo);
case Ebot.NAME:
case Faceit.NAME:
case Esportal.NAME:
case Esl.NAME:
return new EbotAnalyzer(demo);
case Cevo.NAME:
Expand Down Expand Up @@ -307,6 +308,11 @@ private static Source DetermineDemoSource(Demo demo, DemoHeader header)
return Source.Factory(Ebot.NAME);
}

if (demo.Hostname.Contains(Esportal.NAME, StringComparison.OrdinalIgnoreCase))
{
return Source.Factory(Esportal.NAME);
}

// Check for esea demos, appart filename or hostname, there is no magic to detect it
if (demo.Name.Contains(Esea.NAME, StringComparison.OrdinalIgnoreCase)
|| demo.Hostname.Contains(Esea.NAME, StringComparison.OrdinalIgnoreCase))
Expand Down

0 comments on commit 309ea89

Please sign in to comment.