Skip to content

Commit

Permalink
Merge pull request #25 from bobbahbrown/v1.2.3
Browse files Browse the repository at this point in the history
Version 1.2.3 Release
  • Loading branch information
bobbah authored Oct 19, 2020
2 parents 7c4cd72 + 5444830 commit 7c06245
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
6 changes: 3 additions & 3 deletions CentCom.API/CentCom.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.2.2</Version>
<AssemblyVersion>1.2.2.0</AssemblyVersion>
<FileVersion>1.2.2.0</FileVersion>
<Version>1.2.3</Version>
<AssemblyVersion>1.2.3.0</AssemblyVersion>
<FileVersion>1.2.3.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
6 changes: 3 additions & 3 deletions CentCom.Common/CentCom.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.2.2</Version>
<AssemblyVersion>1.2.2.0</AssemblyVersion>
<FileVersion>1.2.2.0</FileVersion>
<Version>1.2.3</Version>
<AssemblyVersion>1.2.3.0</AssemblyVersion>
<FileVersion>1.2.3.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 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>netcoreapp3.1</TargetFramework>
<AssemblyVersion>1.2.2.0</AssemblyVersion>
<FileVersion>1.2.2.0</FileVersion>
<Version>1.2.2</Version>
<AssemblyVersion>1.2.3.0</AssemblyVersion>
<FileVersion>1.2.3.0</FileVersion>
<Version>1.2.3</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
13 changes: 11 additions & 2 deletions CentCom.Server/Services/TGMCBanService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,24 @@ public async Task<IEnumerable<Ban>> GetBansAsync(int page = 1)
{
var ban = bh.Value;

// Ban expiration could be based on the expiration time field or the existance of the unbanned datetime
// field, so we have to check both.
var expiration = ban.GetProperty("unbanned_datetime").GetString() == null ? (DateTime?)null
: DateTime.Parse(ban.GetProperty("unbanned_datetime").GetString());
if (!expiration.HasValue)
{
expiration = ban.GetProperty("expiration_time").GetString() == null ? (DateTime?)null
: DateTime.Parse(ban.GetProperty("expiration_time").GetString());
}

// Get ban
var toAdd = new Ban()
{
BanID = bh.Name,
BannedBy = ban.GetProperty("admin").GetString(),
BannedOn = DateTime.Parse(ban.GetProperty("bantime").ToString()),
CKey = ban.GetProperty("ckey").GetString(),
Expires = ban.GetProperty("expiration_time").GetString() == null ? (DateTime?)null
: DateTime.Parse(ban.GetProperty("expiration_time").GetString()),
Expires = expiration,
Reason = ban.GetProperty("reason").ToString(),
BanType = ban.GetProperty("role").GetString().ToLower() == "server" ? BanType.Server : BanType.Job,
SourceNavigation = _banSource
Expand Down

0 comments on commit 7c06245

Please sign in to comment.