Added many things I can't recall but it has to do with inventory system and some minor fixes .. it's cool

This commit is contained in:
Lukas Moungos
2019-09-04 20:28:51 +02:00
parent 672702eef5
commit 068f3e2d91
34 changed files with 1057 additions and 269 deletions

View File

@@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Migrations
{
public partial class FactionWeaponsRemovedHash : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "WeaponHash",
table: "FactionWeapons");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "WeaponHash",
table: "FactionWeapons",
nullable: false,
defaultValue: 0);
}
}
}

View File

@@ -9,8 +9,8 @@ using ReallifeGamemode.Server.Models;
namespace ReallifeGamemode.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20190721184931_FactionWeaponsRemovedHash")]
partial class FactionWeaponsRemovedHash
[Migration("20190805184145_VehicleItems")]
partial class VehicleItems
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
@@ -396,7 +396,7 @@ namespace ReallifeGamemode.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("FactionId");
b.Property<int?>("FactionId");
b.Property<int>("Rank");
@@ -465,10 +465,14 @@ namespace ReallifeGamemode.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<bool>("CanRentIn");
b.Property<int?>("OwnerId");
b.Property<int>("Price");
b.Property<int>("RentalFee");
b.Property<string>("Type");
b.Property<float>("X");
@@ -484,6 +488,24 @@ namespace ReallifeGamemode.Migrations
b.ToTable("Houses");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.HouseRental", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("HouseId");
b.Property<int?>("UserId");
b.HasKey("Id");
b.HasIndex("HouseId");
b.HasIndex("UserId");
b.ToTable("HouseRentals");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Interior", b =>
{
b.Property<int>("Id")
@@ -788,6 +810,8 @@ namespace ReallifeGamemode.Migrations
b.Property<float>("Heading");
b.Property<int>("Livery");
b.Property<bool>("Locked");
b.Property<uint>("Model");
@@ -956,6 +980,26 @@ namespace ReallifeGamemode.Migrations
b.ToTable("UserItems");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.VehicleItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("Amount");
b.Property<int>("ItemId");
b.Property<int>("Slot");
b.Property<int>("VehicleId");
b.HasKey("Id");
b.HasIndex("VehicleId");
b.ToTable("VehicleItems");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.VehicleMod", b =>
{
b.Property<int>("Id")
@@ -1119,8 +1163,7 @@ namespace ReallifeGamemode.Migrations
{
b.HasOne("ReallifeGamemode.Server.Entities.Faction", "Faction")
.WithMany()
.HasForeignKey("FactionId")
.OnDelete(DeleteBehavior.Cascade);
.HasForeignKey("FactionId");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.GroupBankAccount", b =>
@@ -1137,6 +1180,17 @@ namespace ReallifeGamemode.Migrations
.HasForeignKey("OwnerId");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.HouseRental", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.House", "House")
.WithMany()
.HasForeignKey("HouseId");
b.HasOne("ReallifeGamemode.Server.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Logs.Death", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.User", "Killer")
@@ -1199,6 +1253,14 @@ namespace ReallifeGamemode.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.VehicleItem", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.ServerVehicle", "Vehicle")
.WithMany()
.HasForeignKey("VehicleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.VehicleMod", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.ServerVehicle", "Vehicle")

View File

@@ -0,0 +1,50 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Migrations
{
public partial class VehicleItems : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "VehicleItems",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ItemId = table.Column<int>(nullable: false),
VehicleId = table.Column<int>(nullable: false),
Amount = table.Column<int>(nullable: false),
Slot = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_VehicleItems", x => x.Id);
table.ForeignKey(
name: "FK_VehicleItems_ServerVehicles_VehicleId",
column: x => x.VehicleId,
principalTable: "ServerVehicles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_VehicleItems_VehicleId",
table: "VehicleItems",
column: "VehicleId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "VehicleItems");
}
}
}

View File

@@ -394,7 +394,7 @@ namespace ReallifeGamemode.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("FactionId");
b.Property<int?>("FactionId");
b.Property<int>("Rank");
@@ -486,7 +486,7 @@ namespace ReallifeGamemode.Migrations
b.ToTable("Houses");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.HouseRentals", b =>
modelBuilder.Entity("ReallifeGamemode.Server.Entities.HouseRental", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
@@ -978,6 +978,26 @@ namespace ReallifeGamemode.Migrations
b.ToTable("UserItems");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.VehicleItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("Amount");
b.Property<int>("ItemId");
b.Property<int>("Slot");
b.Property<int>("VehicleId");
b.HasKey("Id");
b.HasIndex("VehicleId");
b.ToTable("VehicleItems");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.VehicleMod", b =>
{
b.Property<int>("Id")
@@ -1141,8 +1161,7 @@ namespace ReallifeGamemode.Migrations
{
b.HasOne("ReallifeGamemode.Server.Entities.Faction", "Faction")
.WithMany()
.HasForeignKey("FactionId")
.OnDelete(DeleteBehavior.Cascade);
.HasForeignKey("FactionId");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.GroupBankAccount", b =>
@@ -1159,7 +1178,7 @@ namespace ReallifeGamemode.Migrations
.HasForeignKey("OwnerId");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.HouseRentals", b =>
modelBuilder.Entity("ReallifeGamemode.Server.Entities.HouseRental", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.House", "House")
.WithMany()
@@ -1232,6 +1251,14 @@ namespace ReallifeGamemode.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.VehicleItem", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.ServerVehicle", "Vehicle")
.WithMany()
.HasForeignKey("VehicleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.VehicleMod", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.ServerVehicle", "Vehicle")