Add Wanted propert to user entity
This commit is contained in:
@@ -66,6 +66,8 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
public int? JobId { get; set; }
|
public int? JobId { get; set; }
|
||||||
|
|
||||||
|
public int Wanteds { get; set; }
|
||||||
|
|
||||||
public FactionRank GetFactionRank()
|
public FactionRank GetFactionRank()
|
||||||
{
|
{
|
||||||
using (var dbContext = new DatabaseContext())
|
using (var dbContext = new DatabaseContext())
|
||||||
@@ -177,5 +179,14 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
key += "data_";
|
key += "data_";
|
||||||
Client.SetData(key, JsonConvert.SerializeObject(value));
|
Client.SetData(key, JsonConvert.SerializeObject(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void GiveWanteds(Client cop, int amount, string reason)
|
||||||
|
{
|
||||||
|
if(this.Wanteds + amount > 40)
|
||||||
|
using (var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1120
ReallifeGamemode.Server/Migrations/20190625202943_ClientWanteds.Designer.cs
generated
Normal file
1120
ReallifeGamemode.Server/Migrations/20190625202943_ClientWanteds.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace ReallifeGamemode.Migrations
|
||||||
|
{
|
||||||
|
public partial class ClientWanteds : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "Wanteds",
|
||||||
|
table: "Users",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Wanteds",
|
||||||
|
table: "Users");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -802,6 +802,8 @@ namespace ReallifeGamemode.Migrations
|
|||||||
b.Property<string>("SocialClubName")
|
b.Property<string>("SocialClubName")
|
||||||
.HasMaxLength(32);
|
.HasMaxLength(32);
|
||||||
|
|
||||||
|
b.Property<int>("Wanteds");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("BanId");
|
b.HasIndex("BanId");
|
||||||
|
|||||||
Reference in New Issue
Block a user