Skip to content

Commit

Permalink
haul logo and countrycode from ctf.json to scoreboard.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Trolldemorted committed Apr 16, 2021
1 parent 5da0a4d commit fef06d1
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<CodeAnalysisRuleSet>../ENOWARS.ruleset</CodeAnalysisRuleSet>
<AssemblyVersion>0.1.1.0</AssemblyVersion>
<FileVersion>0.1.1.0</FileVersion>
<Version>0.1.1</Version>
<AssemblyVersion>0.1.2.0</AssemblyVersion>
<FileVersion>0.1.2.0</FileVersion>
<Version>0.1.2</Version>
</PropertyGroup>
</Project>
2 changes: 2 additions & 0 deletions EnoCore/Models/Team.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class Team
#pragma warning disable SA1516 // Elements should be separated by blank line
public long Id { get; set; }
public string Name { get; set; }
public string? LogoUrl { get; set; }
public string? CountryCode { get; set; }
public byte[] TeamSubnet { get; set; }
public double TotalPoints { get; set; }
public double AttackPoints { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions EnoCore/Scoreboard/Scoreboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public record ScoreboardFirstBlood(
public record ScoreboardTeam(
string Name,
long TeamId,
string? LogoUrl,
string? CountryCode,
double TotalPoints,
double AttackPoints,
double LostDefensePoints,
Expand Down
2 changes: 2 additions & 0 deletions EnoDatabase/EnoDatabase.Scoring.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ public async Task<Scoreboard> GetCurrentScoreboard(long roundId)
scoreboardTeams.Add(new ScoreboardTeam(
team.Name,
team.Id,
team.LogoUrl,
team.CountryCode,
team.TotalPoints,
team.AttackPoints,
team.DefensePoints,
Expand Down
2 changes: 2 additions & 0 deletions EnoDatabase/EnoDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public void ApplyConfig(Configuration config)
{
TeamSubnet = team.TeamSubnet,
Name = team.Name,
LogoUrl = team.LogoUrl,
CountryCode = team.CountryFlagUrl,
Id = team.Id,
Active = team.Active,
Address = team.Address,
Expand Down

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <auto-generated />
using System;
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

Expand Down Expand Up @@ -113,6 +112,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
LogoUrl = table.Column<string>(type: "text", nullable: true),
CountryCode = table.Column<string>(type: "text", nullable: true),
TeamSubnet = table.Column<byte[]>(type: "bytea", nullable: false),
TotalPoints = table.Column<double>(type: "double precision", nullable: false),
AttackPoints = table.Column<double>(type: "double precision", nullable: false),
Expand Down
6 changes: 6 additions & 0 deletions EnoDatabase/Migrations/EnoDatabaseContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,15 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<double>("AttackPoints")
.HasColumnType("double precision");
b.Property<string>("CountryCode")
.HasColumnType("text");
b.Property<double>("DefensePoints")
.HasColumnType("double precision");
b.Property<string>("LogoUrl")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
Expand Down

0 comments on commit fef06d1

Please sign in to comment.