@@ -21,7 +21,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
[ForeignKey("User")]
|
[ForeignKey("User")]
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
public virtual User User { get; set; }
|
public User User { get; set; }
|
||||||
|
|
||||||
public string Reason { get; set; }
|
public string Reason { get; set; }
|
||||||
public string BannedBy { get; set; }
|
public string BannedBy { get; set; }
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
[ForeignKey("User")]
|
[ForeignKey("User")]
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
public virtual User User { get; set; }
|
public User User { get; set; }
|
||||||
|
|
||||||
public bool Gender { get; set; }
|
public bool Gender { get; set; }
|
||||||
public byte Father { get; set; }
|
public byte Father { get; set; }
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
[ForeignKey("User")]
|
[ForeignKey("User")]
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
public virtual User User { get; set; }
|
public User User { get; set; }
|
||||||
|
|
||||||
public bool Duty { get; set; }
|
public bool Duty { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,6 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
[ForeignKey("FactionId")]
|
[ForeignKey("FactionId")]
|
||||||
public int? FactionId { get; set; }
|
public int? FactionId { get; set; }
|
||||||
public virtual Faction Faction { get; set; }
|
public Faction Faction { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
[ForeignKey("Faction")]
|
[ForeignKey("Faction")]
|
||||||
public int FactionId { get; set; }
|
public int FactionId { get; set; }
|
||||||
public virtual Faction Faction { get; set; }
|
public Faction Faction { get; set; }
|
||||||
|
|
||||||
public bool Gender { get; set; }
|
public bool Gender { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[ForeignKey("Faction")]
|
[ForeignKey("Faction")]
|
||||||
public int FactionId { get; set; }
|
public int FactionId { get; set; }
|
||||||
public virtual Faction Faction { get; set; }
|
public Faction Faction { get; set; }
|
||||||
[StringLength(12)]
|
[StringLength(12)]
|
||||||
public string Bic { get; set; }
|
public string Bic { get; set; }
|
||||||
[StringLength(32)]
|
[StringLength(32)]
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
|
|
||||||
public int FactionId { get; set; }
|
public int FactionId { get; set; }
|
||||||
public virtual Faction Faction { get; set; }
|
public Faction Faction { get; set; }
|
||||||
|
|
||||||
public Faction GetFaction()
|
public Faction GetFaction()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
{
|
{
|
||||||
[ForeignKey("Faction")]
|
[ForeignKey("Faction")]
|
||||||
public int? FactionId { get; set; }
|
public int? FactionId { get; set; }
|
||||||
public virtual Faction Faction { get; set; }
|
public Faction Faction { get; set; }
|
||||||
|
|
||||||
public Faction GetFaction()
|
public Faction GetFaction()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
public virtual Group Group { get; set; }
|
public Group Group { get; set; }
|
||||||
|
|
||||||
public int Balance { get; set; }
|
public int Balance { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
{
|
{
|
||||||
public class GroupVehicle : ServerVehicle
|
public class GroupVehicle : ServerVehicle
|
||||||
{
|
{
|
||||||
public virtual Group Group { get; set; }
|
public Group Group { get; set; }
|
||||||
|
|
||||||
[ForeignKey("Group")]
|
[ForeignKey("Group")]
|
||||||
public int? GroupId { get; set; }
|
public int? GroupId { get; set; }
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ namespace ReallifeGamemode.Server.Entities.Logs
|
|||||||
|
|
||||||
[ForeignKey("Victim")]
|
[ForeignKey("Victim")]
|
||||||
public int VictimId { get; set; }
|
public int VictimId { get; set; }
|
||||||
public virtual User Victim { get; set; }
|
public User Victim { get; set; }
|
||||||
|
|
||||||
[ForeignKey("Killer")]
|
[ForeignKey("Killer")]
|
||||||
public int? KillerId { get; set; }
|
public int? KillerId { get; set; }
|
||||||
public virtual User Killer { get; set; }
|
public User Killer { get; set; }
|
||||||
|
|
||||||
public float VictimPositionX { get; set; }
|
public float VictimPositionX { get; set; }
|
||||||
public float VictimPositionY { get; set; }
|
public float VictimPositionY { get; set; }
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
[ForeignKey("User")]
|
[ForeignKey("User")]
|
||||||
public int? UserId { get; set; }
|
public int? UserId { get; set; }
|
||||||
public virtual User User { get; set; }
|
public User User { get; set; }
|
||||||
|
|
||||||
public string Caption { get; set; }
|
public string Caption { get; set; }
|
||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
public class ShopVehicle : ServerVehicle
|
public class ShopVehicle : ServerVehicle
|
||||||
{
|
{
|
||||||
[ForeignKey("Shop")]
|
[ForeignKey("Shop")]
|
||||||
|
public int? ShopId { get; set; }
|
||||||
public int BusinessId { get; set; }
|
public int BusinessId { get; set; }
|
||||||
public int Price { get; set; }
|
public int Price { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -44,26 +44,24 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
[ForeignKey("Character")]
|
[ForeignKey("Character")]
|
||||||
public int? CharacterId { get; set; }
|
public int? CharacterId { get; set; }
|
||||||
public virtual Character Character { get; set; }
|
public Character Character { get; set; }
|
||||||
|
|
||||||
[ForeignKey("Ban")]
|
[ForeignKey("Ban")]
|
||||||
public int? BanId { get; set; }
|
public int? BanId { get; set; }
|
||||||
public virtual Ban Ban { get; set; }
|
public Ban Ban { get; set; }
|
||||||
|
|
||||||
public int? FactionId { get; set; }
|
public int? FactionId { get; set; }
|
||||||
public virtual Faction Faction { get; set; }
|
public Faction Faction { get; set; }
|
||||||
|
|
||||||
public bool FactionLeader { get; set; }
|
public bool FactionLeader { get; set; }
|
||||||
|
|
||||||
public int? FactionRankId { get; set; }
|
public int? FactionRankId { get; set; }
|
||||||
public virtual FactionRank FactionRank { get; set; }
|
public FactionRank FactionRank { get; set; }
|
||||||
|
|
||||||
public virtual Group Group { get; set; }
|
public Group Group { get; set; }
|
||||||
|
|
||||||
public GroupRank GroupRank { get; set; }
|
public GroupRank GroupRank { get; set; }
|
||||||
|
|
||||||
public virtual Job Job { get; set; }
|
|
||||||
|
|
||||||
public FactionRank GetFactionRank()
|
public FactionRank GetFactionRank()
|
||||||
{
|
{
|
||||||
using (var dbContext = new DatabaseContext())
|
using (var dbContext = new DatabaseContext())
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[ForeignKey("User")]
|
[ForeignKey("User")]
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
public virtual User User { get; set; }
|
public User User { get; set; }
|
||||||
[StringLength(12)]
|
[StringLength(12)]
|
||||||
public string Bic { get; set; }
|
public string Bic { get; set; }
|
||||||
[StringLength(32)]
|
[StringLength(32)]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
[ForeignKey("User")]
|
[ForeignKey("User")]
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
public virtual User User { get; set; }
|
public User User { get; set; }
|
||||||
|
|
||||||
public int Amount { get; set; }
|
public int Amount { get; set; }
|
||||||
public int Slot { get; set; }
|
public int Slot { get; set; }
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
{
|
{
|
||||||
[ForeignKey("User")]
|
[ForeignKey("User")]
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
public virtual User User { get; set; }
|
public User User { get; set; }
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace ReallifeGamemode.Server.Entities
|
|||||||
|
|
||||||
[ForeignKey("Vehicle")]
|
[ForeignKey("Vehicle")]
|
||||||
public int ServerVehicleId { get; set; }
|
public int ServerVehicleId { get; set; }
|
||||||
public virtual ServerVehicle Vehicle { get; set; }
|
public ServerVehicle Vehicle { get; set; }
|
||||||
|
|
||||||
public int Slot { get; set; }
|
public int Slot { get; set; }
|
||||||
public int ModId { get; set; }
|
public int ModId { get; set; }
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,90 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace ReallifeGamemode.Migrations
|
|
||||||
{
|
|
||||||
public partial class Jobs : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "JobId",
|
|
||||||
table: "Users",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "JobId",
|
|
||||||
table: "ServerVehicles",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Jobs",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(nullable: false)
|
|
||||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
||||||
Name = table.Column<string>(nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Jobs", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Users_JobId",
|
|
||||||
table: "Users",
|
|
||||||
column: "JobId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_ServerVehicles_JobId",
|
|
||||||
table: "ServerVehicles",
|
|
||||||
column: "JobId");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_ServerVehicles_Jobs_JobId",
|
|
||||||
table: "ServerVehicles",
|
|
||||||
column: "JobId",
|
|
||||||
principalTable: "Jobs",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Users_Jobs_JobId",
|
|
||||||
table: "Users",
|
|
||||||
column: "JobId",
|
|
||||||
principalTable: "Jobs",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Restrict);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_ServerVehicles_Jobs_JobId",
|
|
||||||
table: "ServerVehicles");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Users_Jobs_JobId",
|
|
||||||
table: "Users");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Jobs");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_Users_JobId",
|
|
||||||
table: "Users");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_ServerVehicles_JobId",
|
|
||||||
table: "ServerVehicles");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "JobId",
|
|
||||||
table: "Users");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "JobId",
|
|
||||||
table: "ServerVehicles");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -420,18 +420,6 @@ namespace ReallifeGamemode.Migrations
|
|||||||
b.ToTable("Interiors");
|
b.ToTable("Interiors");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Job", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd();
|
|
||||||
|
|
||||||
b.Property<string>("Name");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Jobs");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Logs.BankAccountTransactionHistory", b =>
|
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Logs.BankAccountTransactionHistory", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@@ -790,8 +778,6 @@ namespace ReallifeGamemode.Migrations
|
|||||||
|
|
||||||
b.Property<int>("Handmoney");
|
b.Property<int>("Handmoney");
|
||||||
|
|
||||||
b.Property<int?>("JobId");
|
|
||||||
|
|
||||||
b.Property<int>("LogUserId");
|
b.Property<int>("LogUserId");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
@@ -827,8 +813,6 @@ namespace ReallifeGamemode.Migrations
|
|||||||
|
|
||||||
b.HasIndex("GroupId");
|
b.HasIndex("GroupId");
|
||||||
|
|
||||||
b.HasIndex("JobId");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
b.ToTable("Users");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -931,17 +915,6 @@ namespace ReallifeGamemode.Migrations
|
|||||||
b.HasDiscriminator().HasValue("GroupVehicle");
|
b.HasDiscriminator().HasValue("GroupVehicle");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.JobVehicle", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("ReallifeGamemode.Server.Entities.ServerVehicle");
|
|
||||||
|
|
||||||
b.Property<int?>("JobId");
|
|
||||||
|
|
||||||
b.HasIndex("JobId");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("JobVehicle");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Saves.SavedVehicle", b =>
|
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Saves.SavedVehicle", b =>
|
||||||
{
|
{
|
||||||
b.HasBaseType("ReallifeGamemode.Server.Entities.ServerVehicle");
|
b.HasBaseType("ReallifeGamemode.Server.Entities.ServerVehicle");
|
||||||
@@ -1077,10 +1050,6 @@ namespace ReallifeGamemode.Migrations
|
|||||||
b.HasOne("ReallifeGamemode.Server.Entities.Group", "Group")
|
b.HasOne("ReallifeGamemode.Server.Entities.Group", "Group")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("GroupId");
|
.HasForeignKey("GroupId");
|
||||||
|
|
||||||
b.HasOne("ReallifeGamemode.Server.Entities.Job", "Job")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("JobId");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserBankAccount", b =>
|
modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserBankAccount", b =>
|
||||||
@@ -1121,13 +1090,6 @@ namespace ReallifeGamemode.Migrations
|
|||||||
.HasForeignKey("GroupId");
|
.HasForeignKey("GroupId");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.JobVehicle", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("ReallifeGamemode.Server.Entities.Job", "Job")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("JobId");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserVehicle", b =>
|
modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserVehicle", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("ReallifeGamemode.Server.Entities.User", "User")
|
b.HasOne("ReallifeGamemode.Server.Entities.User", "User")
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ namespace ReallifeGamemode.Server.Models
|
|||||||
{
|
{
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
optionsBuilder
|
base.OnConfiguring(optionsBuilder);
|
||||||
.UseMySql("Host=localhost;Port=3306;Database=gtav-devdb;Username=gtav-dev;Password=Test123")
|
optionsBuilder.UseMySql("Host=localhost;Port=3306;Database=gtav-devdb;Username=gtav-dev;Password=Test123");
|
||||||
.UseLazyLoadingProxies();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
@@ -100,9 +99,5 @@ namespace ReallifeGamemode.Server.Models
|
|||||||
public DbSet<Entities.Group> Groups { get; set; }
|
public DbSet<Entities.Group> Groups { get; set; }
|
||||||
public DbSet<Entities.GroupBankAccount> GroupBankAccounts { get; set; }
|
public DbSet<Entities.GroupBankAccount> GroupBankAccounts { get; set; }
|
||||||
public DbSet<Entities.GroupVehicle> GroupVehicles { get; set; }
|
public DbSet<Entities.GroupVehicle> GroupVehicles { get; set; }
|
||||||
|
|
||||||
// Jobs
|
|
||||||
public DbSet<Entities.Job> Jobs { get; set; }
|
|
||||||
public DbSet<Entities.JobVehicle> JobVehicles { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,13 +15,12 @@
|
|||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="2.2.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.0">
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.4">
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.1.4" />
|
||||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.2" />
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Condition="'$(ConfigurationName)' != 'ServerBuild'">
|
<ItemGroup Condition="'$(ConfigurationName)' != 'ServerBuild'">
|
||||||
|
|||||||
Reference in New Issue
Block a user