[Feat] Респект и уважуха (#476)
* db * wd comment * manager & commands * system & round end results * raise ban event * client manager & cached values * role pick tweak * tweak last commit * more fixes * weights fix * Fix for short rounds * tweak in cached dictionary * reva pick system * fix last commit * cult role pick * nukeops role picking * fix cache in async & show command * ooc msg show value * move pick method to manager & traitor pick fix
This commit is contained in:
1424
Content.Server.Database/Migrations/Postgres/20231006121631_PlayerReputation.Designer.cs
generated
Normal file
1424
Content.Server.Database/Migrations/Postgres/20231006121631_PlayerReputation.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class PlayerReputation : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "player_reputations",
|
||||
columns: table => new
|
||||
{
|
||||
player_reputations_id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
user_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
reputation = table.Column<float>(type: "real", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_player_reputations", x => x.player_reputations_id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "player_reputations");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -689,6 +689,29 @@ namespace Content.Server.Database.Migrations.Postgres
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.PlayerReputation", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("player_reputations_id");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<float>("Reputation")
|
||||
.HasColumnType("real")
|
||||
.HasColumnName("reputation");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK_player_reputations");
|
||||
|
||||
b.ToTable("player_reputations", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Preference", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
||||
1354
Content.Server.Database/Migrations/Sqlite/20231006121608_PlayerReputation.Designer.cs
generated
Normal file
1354
Content.Server.Database/Migrations/Sqlite/20231006121608_PlayerReputation.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Content.Server.Database.Migrations.Sqlite
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class PlayerReputation : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "player_reputations",
|
||||
columns: table => new
|
||||
{
|
||||
player_reputations_id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
user_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
reputation = table.Column<float>(type: "REAL", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_player_reputations", x => x.player_reputations_id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "player_reputations");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -647,6 +647,27 @@ namespace Content.Server.Database.Migrations.Sqlite
|
||||
b.ToTable("player", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.PlayerReputation", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("player_reputations_id");
|
||||
|
||||
b.Property<float>("Reputation")
|
||||
.HasColumnType("REAL")
|
||||
.HasColumnName("reputation");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("user_id");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("PK_player_reputations");
|
||||
|
||||
b.ToTable("player_reputations", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Content.Server.Database.Preference", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace Content.Server.Database
|
||||
public DbSet<AdminNote> AdminNotes { get; set; } = null!;
|
||||
public DbSet<AdminWatchlist> AdminWatchlists { get; set; } = null!;
|
||||
public DbSet<AdminMessage> AdminMessages { get; set; } = null!;
|
||||
public DbSet<PlayerReputation> PlayerReputations { get; set; } = default!; // WD edit
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -301,6 +302,15 @@ namespace Content.Server.Database
|
||||
public abstract int CountAdminLogs();
|
||||
}
|
||||
|
||||
// WD start
|
||||
public class PlayerReputation
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public float Reputation { get; set; }
|
||||
}
|
||||
// WD end
|
||||
|
||||
public class Preference
|
||||
{
|
||||
// NOTE: on postgres there SHOULD be an FK ensuring that the selected character slot always exists.
|
||||
|
||||
Reference in New Issue
Block a user