Skip to content

Commit

Permalink
Merge pull request #31 from bobbahbrown/v1.3.1
Browse files Browse the repository at this point in the history
Version 1.3.1
  • Loading branch information
bobbah authored Dec 16, 2020
2 parents 0519ae4 + 11dbf74 commit b8dc500
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 24 deletions.
14 changes: 7 additions & 7 deletions CentCom.API/CentCom.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.3.0</Version>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<FileVersion>1.3.0.0</FileVersion>
<Version>1.3.1</Version>
<AssemblyVersion>1.3.1.0</AssemblyVersion>
<FileVersion>1.3.1.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -18,10 +18,10 @@
<ItemGroup>
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
<PackageReference Include="Enums.NET" Version="3.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Npgsql" Version="5.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.1" />
<PackageReference Include="Npgsql" Version="5.0.1.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="5.6.3" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="5.6.3" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUi" Version="5.6.3" />
Expand Down
14 changes: 7 additions & 7 deletions CentCom.Common/CentCom.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.3.0</Version>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<FileVersion>1.3.0.0</FileVersion>
<Version>1.3.1</Version>
<AssemblyVersion>1.3.1.0</AssemblyVersion>
<FileVersion>1.3.1.0</FileVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EFCore.NamingConventions" Version="5.0.0-rc1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="EFCore.NamingConventions" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Npgsql" Version="5.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.0" />
<PackageReference Include="Npgsql" Version="5.0.1.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.0-alpha.2" />
<PackageReference Include="Quartz" Version="3.2.3" />
</ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions CentCom.Server/CentCom.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<FileVersion>1.3.0.0</FileVersion>
<Version>1.3.0</Version>
<AssemblyVersion>1.3.1.0</AssemblyVersion>
<FileVersion>1.3.1.0</FileVersion>
<Version>1.3.1</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,18 +14,18 @@

<ItemGroup>
<PackageReference Include="AngleSharp" Version="0.14.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
<PackageReference Include="Npgsql" Version="5.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.0" />
<PackageReference Include="Npgsql" Version="5.0.1.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.1" />
<PackageReference Include="Quartz" Version="3.2.3" />
<PackageReference Include="RestSharp" Version="106.11.7" />
<PackageReference Include="Serilog" Version="2.10.0" />
Expand Down
3 changes: 2 additions & 1 deletion CentCom.Server/Services/BeeBanService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ public async Task<IEnumerable<Ban>> GetBansAsync(int page = 1)
var content = JsonSerializer.Deserialize<IEnumerable<Dictionary<string, JsonElement>>>(response.Content);
foreach (var b in content)
{
var expiryString = b["unban_date"].GetString() ?? b["expire_date"].GetString();
var toAdd = new Ban()
{
BannedOn = DateTime.Parse(b["ban_date"].GetString()).ToUniversalTime(),
BannedBy = b["banner"].GetString(),
BanType = ParseBanType(b["type"].GetString()),
Expires = b["unban_date"].GetString() == null ? (DateTime?)null : DateTime.Parse(b["unban_date"].GetString()).ToUniversalTime(),
Expires = expiryString == null ? (DateTime?)null : DateTime.Parse(expiryString).ToUniversalTime(),
CKey = b["user"].GetString(),
Reason = b["reason"].GetString(),
BanID = b["id"].GetInt32().ToString(),
Expand Down
8 changes: 7 additions & 1 deletion CentCom.Server/Services/FulpBanService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using CentCom.Server.Exceptions;
using CentCom.Server.Extensions;
using Extensions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using RestSharp;
using System;
Expand All @@ -22,10 +23,15 @@ public class FulpBanService
private readonly static BanSource _banSource = new BanSource() { Name = "fulp" };


public FulpBanService(ILogger<FulpBanService> logger)
public FulpBanService(ILogger<FulpBanService> logger, IConfiguration config)
{
_logger = logger;
_client = new RestClient(BASE_URL);

if (config.GetSection("sourceConfig").GetValue<bool>("allowFulpExpiredSSL"))
{
_client.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyError) => true;
}
}

public async Task<IEnumerable<Ban>> GetBansAsync(int page = 1)
Expand Down
5 changes: 5 additions & 0 deletions CentCom.Server/Services/TGMCBanService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Extensions.Logging;
using RestSharp;
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -120,6 +121,10 @@ await range.AsyncParallelForEach(async page =>
}
}, 12);


if (dirtyBans.IsEmpty)
return Enumerable.Empty<Ban>();

// We have to ensure that our jobs are correctly grouped due to possible errors with paging
var cleanBans = new List<Ban>(dirtyBans.Where(x => x.BanType == BanType.Server));
foreach (var group in dirtyBans.Where(x => x.BanType == BanType.Job).GroupBy(x => new { x.BannedOn, x.CKey, x.Reason }))
Expand Down
3 changes: 3 additions & 0 deletions CentCom.Server/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"dbConfig": {
"connectionString": "connection_string_goes_here",
"dbType": "db_type_goes_here"
},
"sourceConfig": {
"allowFulpExpiredSSL": true
}
}

0 comments on commit b8dc500

Please sign in to comment.