diff --git a/ReallifeGamemode.Client/Player/criminalrelease.ts b/ReallifeGamemode.Client/Player/criminalrelease.ts new file mode 100644 index 00000000..7a069326 --- /dev/null +++ b/ReallifeGamemode.Client/Player/criminalrelease.ts @@ -0,0 +1,71 @@ +import * as NativeUI from 'NativeUI'; + +const Menu = NativeUI.Menu; +const UIMenuItem = NativeUI.UIMenuItem; +const UIMenuListItem = NativeUI.UIMenuListItem; +const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem; +const BadgeStyle = NativeUI.BadgeStyle; +const Point = NativeUI.Point; +const ItemsCollection = NativeUI.ItemsCollection; +const Color = NativeUI.Color; + +let screenRes = mp.game.graphics.getScreenResolution(0, 0); +let saveItem = new UIMenuItem("Entlassen", "Setze den Gefangenen auf freiem Fuß"); +saveItem.BackColor = new Color(13, 71, 161); +saveItem.HighlightedBackColor = new Color(25, 118, 210); + +let cancelItem = new UIMenuItem("Abbrechen", ""); +cancelItem.BackColor = new Color(213, 0, 0); +cancelItem.HighlightedBackColor = new Color(229, 57, 53); + +export default function jailList(globalData: GlobalData) { + + var jailMenu: NativeUI.Menu; + + var prisoners; + + var prisoner = ""; + + + //Weapon Menu + + mp.events.add('showJailMenu', (prisonersArr) => { + if (!globalData.InMenu) { + + globalData.InMenu = true; + + prisoners = prisonersArr; + + jailMenu = new Menu("Gefängnis PC", "", new Point(50, 50), null, null); + + jailMenu.AddItem(new UIMenuListItem("Gefangener", "", new ItemsCollection(prisoners))); + + jailMenu.AddItem(saveItem); + jailMenu.AddItem(cancelItem); + jailMenu.Visible = true; + + jailMenu.ListChange.on((item, index) => { + switch (item.Text) { + case "Gefangener": + prisoner = String(item.SelectedItem.DisplayText); + break; + } + }); + + jailMenu.ItemSelect.on((item) => { + if (item.Text === "Entlassen") { + mp.events.callRemote("setPrisonerFree", prisoner); + jailMenu.Close(); + globalData.InMenu = false; + } else if (item.Text === "Abbrechen") { + jailMenu.Close(); + globalData.InMenu = false; + } + }); + + jailMenu.MenuClose.on(() => { + globalData.InMenu = false; + }); + } + }); +} \ No newline at end of file diff --git a/ReallifeGamemode.Client/Player/weaponlist.ts b/ReallifeGamemode.Client/Player/weaponlist.ts new file mode 100644 index 00000000..8b432c41 --- /dev/null +++ b/ReallifeGamemode.Client/Player/weaponlist.ts @@ -0,0 +1,111 @@ +import * as NativeUI from 'NativeUI'; + +const Menu = NativeUI.Menu; +const UIMenuItem = NativeUI.UIMenuItem; +const UIMenuListItem = NativeUI.UIMenuListItem; +const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem; +const BadgeStyle = NativeUI.BadgeStyle; +const Point = NativeUI.Point; +const ItemsCollection = NativeUI.ItemsCollection; +const Color = NativeUI.Color; + +let screenRes = mp.game.graphics.getScreenResolution(0, 0); +let saveItem = new UIMenuItem("Waffen Nehmen", ""); +saveItem.BackColor = new Color(13, 71, 161); +saveItem.HighlightedBackColor = new Color(25, 118, 210); + +let cancelItem = new UIMenuItem("Abbrechen", ""); +cancelItem.BackColor = new Color(213, 0, 0); +cancelItem.HighlightedBackColor = new Color(229, 57, 53); + +export default function weaponList(globalData: GlobalData) { + + var weaponMenu: NativeUI.Menu; + + var primaries; + var secondaries; + var melees; + var specialsWep; + + + var primary = ""; + var secondary = ""; + var melee = ""; + var specialWep = ""; + + //Weapon Menu + + mp.events.add('showWeaponMenu', (primariesArr, secondariesArr, meleesArr, specialsArr) => { + if (!globalData.InMenu) { + + globalData.InMenu = true; + + primaries = primariesArr; + secondaries = secondariesArr; + melees = meleesArr; + specialsWep = specialsArr; + + weaponMenu = new Menu("Waffenschrank", "Stelle deine Waffen Ausrüstung zusammen", new Point(50, 50), null, null); + + weaponMenu.AddItem(new UIMenuListItem("Primäre", "", new ItemsCollection(primaries))); + weaponMenu.AddItem(new UIMenuListItem("Sekundäre", "", new ItemsCollection(secondaries))); + weaponMenu.AddItem(new UIMenuListItem("Nahkampf", "", new ItemsCollection(melees))); + weaponMenu.AddItem(new UIMenuListItem("Spezial", "", new ItemsCollection(specialsWep))); + weaponMenu.AddItem(saveItem); + weaponMenu.AddItem(cancelItem); + weaponMenu.Visible = true; + + weaponMenu.ListChange.on((item, index) => { + switch (item.Text) { + case "Primäre": + if (item.SelectedItem.DisplayText === "Keine") { + primary = ""; + } else { + primary = String(item.SelectedItem.DisplayText); + mp.events.callRemote("updateWeaponSelection", primary, 1); + } + break; + case "Sekundäre": + if (item.SelectedItem.DisplayText === "Keine") { + secondary = ""; + } else { + secondary = String(item.SelectedItem.DisplayText); + mp.events.callRemote("updateWeaponSelection", secondary, 2); + } + break; + case "Nahkampf": + if (item.SelectedItem.DisplayText === "Keine") { + melee = ""; + } else { + melee = String(item.SelectedItem.DisplayText); + mp.events.callRemote("updateWeaponSelection", melee, 3); + } + break; + case "Spezial": + if (item.SelectedItem.DisplayText === "Keine") { + specialWep = ""; + } else { + specialWep = String(item.SelectedItem.DisplayText); + mp.events.callRemote("updateWeaponSelection", specialWep, 4); + } + break; + } + }); + + weaponMenu.ItemSelect.on((item) => { + if (item.Text === "Waffen Nehmen") { + mp.events.callRemote("saveWeaponSelection", primary, secondary, melee, specialWep); + weaponMenu.Close(); + globalData.InMenu = false; + } else if (item.Text === "Abbrechen") { + weaponMenu.Close(); + globalData.InMenu = false; + } + }); + + weaponMenu.MenuClose.on(() => { + globalData.InMenu = false; + }); + } + }); +} \ No newline at end of file diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index f22c8004..2d775249 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -106,6 +106,12 @@ Login(globalData); import dutyCloth from './Player/dutycloth'; dutyCloth(globalData); +import weaponList from './Player/weaponlist'; +weaponList(globalData); + +import jailList from './Player/criminalrelease'; +jailList(globalData); + import keys from './Player/keys'; keys(globalData); @@ -140,4 +146,4 @@ import smoothThrottle from './vehiclesync/smoothtrottle'; smoothThrottle(); import vehicleIndicators from './vehiclesync/vehicleindicators'; -vehicleIndicators(); \ No newline at end of file +vehicleIndicators(); \ No newline at end of file diff --git a/ReallifeGamemode.Client/tsconfig.json b/ReallifeGamemode.Client/tsconfig.json index 606292d8..421892f4 100644 --- a/ReallifeGamemode.Client/tsconfig.json +++ b/ReallifeGamemode.Client/tsconfig.json @@ -13,7 +13,7 @@ }, "include": [ "**/*", - "node_modules/NativeUI/index.ts" + "node_modules/NativeUI/index.ts", "../ReallifeGamemode.Server/Entities/FactionWeapon.cs" ], "files": [ "node_modules/NativeUI/index.ts" diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index 4fceee41..76ff36a5 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -254,51 +254,7 @@ namespace ReallifeGamemode.Server.Commands } } - [Command("release", "~m~Benutzung: ~s~/release [Name / ID] [Grund]", GreedyArg = true)] - public void CmdFactionJailRelease(Client player, string nameOrId, string reason) - { - User user = player.GetUser(); - if (user == null || (user.FactionId != 1 && user.FactionId != 3)) - { - ChatService.NotAuthorized(player); - return; - } - - Client target = ClientService.GetClientByNameOrId(nameOrId); - if (target == null || !target.IsLoggedIn()) - { - ChatService.PlayerNotFound(player); - return; - } - - User targetCop = target.GetUser(); - if (targetCop.FactionId == 1 || targetCop.FactionId == 3) - { - ChatService.ErrorMessage(player, "Diese Person sollte sich nicht im Knast befinden"); - return; - } - if (target.Position.DistanceTo(player.Position) < 6) - { - User targetUser = target.GetUser(); - if (targetUser.JailTime > 0) - { - Jail.Release_Jail(target, reason); - ChatService.SendMessage(target, "~r~Du wurdest von " + player.Name + " aus dem Knast befreit"); - - ChatService.BroadcastFaction("~r~HQ: " + user.Name + " wurde von " + player.Name + " aus dem Knast entlassen. Grund: " + reason + ".", new List() { 1, 3 }); - } - else - { - ChatService.ErrorMessage(player, "Diese Person befindet sich nicht im Knast"); - return; - } - } - else - { - ChatService.ErrorMessage(player, "Du bist zu weit entfernt"); - return; - } - } + #endregion diff --git a/ReallifeGamemode.Server/Entities/FactionWeapon.cs b/ReallifeGamemode.Server/Entities/FactionWeapon.cs new file mode 100644 index 00000000..ad8e4141 --- /dev/null +++ b/ReallifeGamemode.Server/Entities/FactionWeapon.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; +using GTANetworkAPI; + +namespace ReallifeGamemode.Server.Entities +{ + public class FactionWeapon + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + + [ForeignKey("Faction")] + public int FactionId { get; set; } + public Faction Faction { get; set; } + + public int WeaponHash { get; set; } + public string WeaponModel { get; set; } + public int SlotID { get; set; } + public int Rank { get; set; } + } +} diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 2002dedd..d29b36e8 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -131,66 +131,166 @@ namespace ReallifeGamemode.Server.Events var user = player.GetUser(); if (user?.FactionId != null) { - DutyPoint nearest = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5 && d.FactionId == user.FactionId); - if (nearest == null) return; - var nameTagColor = new Color(0, 0, 0); - var factionId = user.FactionId; - - if (user.GetData("duty") == false) + DutyPoint nearestDuty = PositionManager.DutyPoints.Find(d => d.Position.DistanceTo(player.Position) <= 1.5 && d.FactionId == user.FactionId); + WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId); + JailReleasePoint nearestJailReleasePoint = PositionManager.JailReleasePoints.Find(j => j.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 3) && user.GetData("duty")); + if (nearestDuty != null)// Duty Point { - user.SetData("duty", true); - player.SendNotification("Du bist nun ~g~im Dienst."); - if (player.GetUser().FactionId == 2) //Fire Department - { - int medicCount = 0; - foreach (Client c in NAPI.Pools.GetAllPlayers()) - { - if ((c.GetUser()?.Faction.Id ?? 0) == 2) - { - medicCount++; - } - } - NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", medicCount); - } - switch (factionId) - { - //LSPD - case 1: - nameTagColor = new Color(28, 134, 238); - break; - } - player.NametagColor = nameTagColor; - using (var context = new DatabaseContext()) - { - List clothes = context.CharacterClothes.Where(u => u.UserId == user.Id && u.Duty == true).ToList(); + var nameTagColor = new Color(0, 0, 0); + var factionId = user.FactionId; - foreach (var cloth in clothes) + if (user.GetData("duty") == false) + { + user.SetData("duty", true); + player.SendNotification("Du bist nun ~g~im Dienst."); + if (player.GetUser().FactionId == 2) //Fire Department { - if (cloth.SlotType == 0) + int medicCount = 0; + foreach (Client c in NAPI.Pools.GetAllPlayers()) { - player.SetClothes(cloth.SlotId, cloth.ClothId, 0); - } - else - { - if (cloth.ClothId != -1) + if ((c.GetUser()?.Faction.Id ?? 0) == 2) { - player.SetAccessories(cloth.SlotId, cloth.ClothId, 0); + medicCount++; + } + } + NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", medicCount); + } + switch (factionId) + { + //LSPD + case 1: + nameTagColor = new Color(28, 134, 238); + player.SetSharedData("blipColor", 38); + break; + + //Medic + case 2: + nameTagColor = new Color(255, 0, 0); + player.SetSharedData("blipColor", 79); + break; + + //FBI + case 3: + nameTagColor = new Color(173, 0, 118); + player.SetSharedData("blipColor", 83); + break; + } + player.NametagColor = nameTagColor; + using (var context = new DatabaseContext()) + { + List clothes = context.CharacterClothes.Where(u => u.UserId == user.Id && u.Duty == true).ToList(); + + foreach (var cloth in clothes) + { + if (cloth.SlotType == 0) + { + player.SetClothes(cloth.SlotId, cloth.ClothId, 0); } else { - player.ClearAccessory(cloth.SlotId); + if (cloth.ClothId != -1) + { + player.SetAccessories(cloth.SlotId, cloth.ClothId, 0); + } + else + { + player.ClearAccessory(cloth.SlotId); + } } } } } + else + { + user.SetData("duty", false); + player.SendNotification("Du bist nun ~r~außer Dienst."); + NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", false); + player.NametagColor = new Color(255, 255, 255); + UpdateCharacterCloth.LoadCharacterDefaults(player); + } } - else + if (nearestWeapon != null) // Weapon Point { - user.SetData("duty", false); - player.SendNotification("Du bist nun ~r~außer Dienst."); - NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", false); - player.NametagColor = new Color(255, 255, 255); - UpdateCharacterCloth.LoadCharacterDefaults(player); + + List primarys = new List(); + List secondarys = new List(); + List melees = new List(); + List specials = new List(); + using (var context = new DatabaseContext()) + { + List weapons = context.FactionWeapons.ToList().FindAll(w => w.FactionId == user.FactionId); + foreach (var weapon in weapons) + { + + + switch (weapon.SlotID) + { + case 1: + if (weapon.WeaponHash != -1) + { + if (user.FactionRank.Order >= weapon.Rank) + primarys.Add(weapon.WeaponModel.ToString()); + } + else + { + primarys.Add("Keine"); + } + break; + case 2: + if (weapon.WeaponHash != -1) + { + if (user.FactionRank.Order >= weapon.Rank) + secondarys.Add(weapon.WeaponModel.ToString()); + } + else + { + secondarys.Add("Keine"); + } + break; + case 3: + if (weapon.WeaponHash != -1) + { + if (user.FactionRank.Order >= weapon.Rank) + melees.Add(weapon.WeaponModel.ToString()); + } + else + { + melees.Add("Keine"); + } + break; + case 4: + if (weapon.WeaponHash != -1) + { + if (user.FactionRank.Order >= weapon.Rank) + specials.Add(weapon.WeaponModel.ToString()); + } + else + { + specials.Add("Keine"); + specials.Add("Schutzweste"); + } + break; + } + } + } + + player.TriggerEvent("showWeaponMenu", primarys.ToArray(), secondarys.ToArray(), melees.ToArray(), specials.ToArray()); + } + if(nearestJailReleasePoint != null) + { + List criminals = new List(); + foreach (Client target in NAPI.Pools.GetAllPlayers()) + { + User c = target.GetUser(); + + { + if (c.JailTime > 0) + { + criminals.Add(c.Name.ToString()); + } + } + } + player.TriggerEvent("showJailMenu", criminals.ToArray()); } } } diff --git a/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs b/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs new file mode 100644 index 00000000..6ffae3f6 --- /dev/null +++ b/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using GTANetworkAPI; +using Newtonsoft.Json; +using ReallifeGamemode.Server.Entities; +using ReallifeGamemode.Server.Extensions; +using ReallifeGamemode.Server.Models; + +namespace ReallifeGamemode.Server.Events +{ + public class UpdateCharacterWeapon : Script + { + + + + [RemoteEvent("updateWeaponSelection")] + public void UpdateWeaponSelection(Client client, string weaponModel, int slot) + { + if(weaponModel == "Schutzweste") + { + client.Armor = 100; + return; + } + + WeaponHash weaponHash = NAPI.Util.WeaponNameToModel(weaponModel); + + if (slot == 1) + { + client.RemoveAllWeapons(); + client.GiveWeapon(weaponHash, 0); + + } + if (slot == 2) + { + client.RemoveAllWeapons(); + client.GiveWeapon(weaponHash, 0); + } + if (slot == 3) + { + client.RemoveAllWeapons(); + client.GiveWeapon(weaponHash, 0); + } + if (slot == 4) + { + client.RemoveAllWeapons(); + client.GiveWeapon(weaponHash, 0); + client.Armor = 0; + } + } + + [RemoteEvent("cancelWeaponSelection")] + public void CancelWeaponSelection(Client client) + { + client.RemoveAllWeapons(); + } + + + [RemoteEvent("saveWeaponSelection")] + public void SaveWeaponSelection(Client client, string primaryModel, string secondaryModel, string meleeModel, string specialModel) + { + client.RemoveAllWeapons(); + WeaponHash primary = NAPI.Util.WeaponNameToModel(primaryModel); + WeaponHash secondary = NAPI.Util.WeaponNameToModel(secondaryModel); + WeaponHash melee = NAPI.Util.WeaponNameToModel(meleeModel); + + + client.GiveWeapon(primary, 150); + client.GiveWeapon(secondary, 600); + client.GiveWeapon(melee, 1); + if(specialModel != "Schutzweste") + { + WeaponHash special = NAPI.Util.WeaponNameToModel(specialModel); + client.GiveWeapon(special, 50); + } + } + } +} diff --git a/ReallifeGamemode.Server/Managers/PositionManager.cs b/ReallifeGamemode.Server/Managers/PositionManager.cs index 77b7b0e4..87569e45 100644 --- a/ReallifeGamemode.Server/Managers/PositionManager.cs +++ b/ReallifeGamemode.Server/Managers/PositionManager.cs @@ -11,9 +11,17 @@ namespace ReallifeGamemode.Server.Managers public static List DutyPoints = new List(); public static List DutyColShapes = new List(); + public static List WeaponPoints = new List(); + public static List WeaponColShapes = new List(); + + public static List JailReleasePoints = new List(); + public static List JailReleaseColShapes = new List(); + [ServerEvent(Event.ResourceStart)] public void OnResourceStart() { + #region DutyPoints + DutyPoint dutyPointLSPD = new DutyPoint() { Position = new Vector3(458.24, -990.86, 30.68), @@ -28,6 +36,39 @@ namespace ReallifeGamemode.Server.Managers new Vector3(0, 0, 0), 3, new Color(255, 255, 255, 50), false, 0); NAPI.TextLabel.CreateTextLabel("Stempeluhr - Dr\u00fccke ~y~E\n~s~Dienstkleidung - Dr\u00fccke ~y~K", d.Position, 7, 1, 0, new Color(255, 255, 255), false, 0); } + #endregion + #region WeaponPoints + WeaponPoint weaponPointLSPD = new WeaponPoint() + { + Position = new Vector3(460.3162,-981.0168,30.68959), + FactionId = 1 + }; + + WeaponPoints.Add(weaponPointLSPD); + + foreach(WeaponPoint w in WeaponPoints) + { + NAPI.Marker.CreateMarker(1, new Vector3(w.Position.X, w.Position.Y, w.Position.Z - 2), new Vector3(w.Position.X, w.Position.Y, w.Position.Z + 1), + new Vector3(0, 0, 0), 2, new Color(255, 255, 255, 50), false, 0); + NAPI.TextLabel.CreateTextLabel("Waffenspind - Dr\u00fccke ~y~E", w.Position, 7, 1, 0, new Color(255, 255, 255), false, 0); + } + #endregion + #region JailReleasePoint + JailReleasePoint jailPointLSPD = new JailReleasePoint() + { + Position = new Vector3(459.5327, -988.8435, 24.91487) + }; + + JailReleasePoints.Add(jailPointLSPD); + + foreach(JailReleasePoint j in JailReleasePoints) + { + NAPI.Marker.CreateMarker(1, new Vector3(j.Position.X, j.Position.Y, j.Position.Z - 2), new Vector3(j.Position.X, j.Position.Y, j.Position.Z + 1), + new Vector3(0, 0, 0), 1.5f, new Color(255, 255, 255, 50), false, 0); + NAPI.TextLabel.CreateTextLabel("Gefängnis PC - Dr\u00fccke ~y~E", j.Position, 7, 1, 0, new Color(255, 255, 255), false, 0); + } + #endregion + } } @@ -37,5 +78,16 @@ namespace ReallifeGamemode.Server.Managers public int FactionId { get; set; } } + public class WeaponPoint + { + public Vector3 Position { get; set; } + public int FactionId { get; set; } + } + + public class JailReleasePoint + { + public Vector3 Position { get; set; } + } + } diff --git a/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.Designer.cs b/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.Designer.cs new file mode 100644 index 00000000..3bd190be --- /dev/null +++ b/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.Designer.cs @@ -0,0 +1,1236 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using ReallifeGamemode.Server.Models; + +namespace ReallifeGamemode.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20190721144830_FactionWeapons")] + partial class FactionWeapons + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.0-rtm-35687") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.ATM", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Balance"); + + b.Property("Faulty"); + + b.Property("X"); + + b.Property("Y"); + + b.Property("Z"); + + b.HasKey("Id"); + + b.ToTable("ATMs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Ban", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Applied"); + + b.Property("BannedBy"); + + b.Property("Reason"); + + b.Property("UntilDateTime"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Bans"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.BusRoute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description"); + + b.HasKey("Id"); + + b.ToTable("BusRoutes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.BusRoutePoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BusRouteId"); + + b.Property("Description"); + + b.Property("X"); + + b.Property("Y"); + + b.Property("Z"); + + b.HasKey("Id"); + + b.HasIndex("BusRouteId"); + + b.ToTable("BusRoutesPoints"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.BusinessBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Balance"); + + b.Property("BusinessId"); + + b.HasKey("Id"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.ToTable("BusinessBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Character", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Ageing"); + + b.Property("AgeingOpacity"); + + b.Property("BeardColor"); + + b.Property("Blemishes"); + + b.Property("BlemishesOpacity"); + + b.Property("Blush"); + + b.Property("BlushColor"); + + b.Property("BlushOpacity"); + + b.Property("BrowDepth"); + + b.Property("BrowHeight"); + + b.Property("CheekDepth"); + + b.Property("CheekboneHeight"); + + b.Property("CheekboneWidth"); + + b.Property("ChestHair"); + + b.Property("ChestHairColor"); + + b.Property("ChestHairOpacity"); + + b.Property("ChinDepth"); + + b.Property("ChinHeight"); + + b.Property("ChinIndent"); + + b.Property("ChinWidth"); + + b.Property("Complexion"); + + b.Property("ComplexionOpacity"); + + b.Property("EyeColor"); + + b.Property("EyeSize"); + + b.Property("EyebrowColor"); + + b.Property("Eyebrows"); + + b.Property("EyebrowsOpacity"); + + b.Property("FacialHair"); + + b.Property("FacialHairOpacity"); + + b.Property("Father"); + + b.Property("Freckles"); + + b.Property("FrecklesOpacity"); + + b.Property("Gender"); + + b.Property("Hair"); + + b.Property("HairColor"); + + b.Property("HairHighlightColor"); + + b.Property("JawShape"); + + b.Property("JawWidth"); + + b.Property("LipThickness"); + + b.Property("Lipstick"); + + b.Property("LipstickColor"); + + b.Property("LipstickOpacity"); + + b.Property("Makeup"); + + b.Property("MakeupOpacity"); + + b.Property("Mother"); + + b.Property("NeckWidth"); + + b.Property("NoseBottomHeight"); + + b.Property("NoseBridgeDepth"); + + b.Property("NoseBroken"); + + b.Property("NoseTipHeight"); + + b.Property("NoseTipLength"); + + b.Property("NoseWidth"); + + b.Property("Similarity"); + + b.Property("SkinSimilarity"); + + b.Property("SunDamage"); + + b.Property("SunDamageOpacity"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Characters"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.CharacterCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClothId"); + + b.Property("Duty"); + + b.Property("SlotId"); + + b.Property("SlotType"); + + b.Property("Texture"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("CharacterClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.ClothCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Gender"); + + b.Property("Top"); + + b.Property("Torso"); + + b.Property("Undershirt"); + + b.HasKey("Id"); + + b.ToTable("ClothCombinations"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Door", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Category"); + + b.Property("FactionId"); + + b.Property("Locked"); + + b.Property("Model"); + + b.Property("Name"); + + b.Property("Radius"); + + b.Property("X"); + + b.Property("Y"); + + b.Property("Z"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("Doors"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.DutyCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClothId"); + + b.Property("FactionId"); + + b.Property("Gender"); + + b.Property("SlotId"); + + b.Property("SlotType"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("DutyClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Faction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .HasMaxLength(32); + + b.Property("StateOwned"); + + b.HasKey("Id"); + + b.ToTable("Factions"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.FactionBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Balance"); + + b.Property("Bic") + .HasMaxLength(12); + + b.Property("FactionId"); + + b.Property("Iban") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.FactionRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("FactionId"); + + b.Property("Order"); + + b.Property("RankName"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionRanks"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.FactionWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("FactionId"); + + b.Property("Rank"); + + b.Property("slotID"); + + b.Property("weaponHash"); + + b.Property("weaponModel"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionWeapons"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.GotoPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Description") + .HasMaxLength(32); + + b.Property("X"); + + b.Property("Y"); + + b.Property("Z"); + + b.HasKey("Id"); + + b.ToTable("GotoPoints"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Group", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Groups"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.GroupBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Balance"); + + b.Property("GroupId"); + + b.HasKey("Id"); + + b.HasIndex("GroupId"); + + b.ToTable("GroupBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.House", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("OwnerId"); + + b.Property("Price"); + + b.Property("Type"); + + b.Property("X"); + + b.Property("Y"); + + b.Property("Z"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("Houses"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Interior", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EnterPositionStr") + .HasColumnName("EnterPosition"); + + b.Property("ExitPositionStr") + .HasColumnName("ExitPosition"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Interiors"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Logs.BankAccountTransactionHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Fee"); + + b.Property("MoneySent"); + + b.Property("NewReceiverBalance"); + + b.Property("NewSenderBalance"); + + b.Property("Origin") + .HasMaxLength(32); + + b.Property("Receiver") + .HasMaxLength(32); + + b.Property("ReceiverBalance"); + + b.Property("Sender") + .HasMaxLength(32); + + b.Property("SenderBalance"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd(); + + b.HasKey("Id"); + + b.ToTable("BankAccountTransactionLogs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Logs.Death", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CauseOfDeath") + .HasMaxLength(64); + + b.Property("KillerHeading"); + + b.Property("KillerId"); + + b.Property("KillerPositionX"); + + b.Property("KillerPositionY"); + + b.Property("KillerPositionZ"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd(); + + b.Property("VictimHeading"); + + b.Property("VictimId"); + + b.Property("VictimPositionX"); + + b.Property("VictimPositionY"); + + b.Property("VictimPositionZ"); + + b.HasKey("Id"); + + b.HasIndex("KillerId"); + + b.HasIndex("VictimId"); + + b.ToTable("DeathLogs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Caption"); + + b.Property("Content"); + + b.Property("Timestamp"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("News"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Saves.SavedBlip", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Alpha"); + + b.Property("Color"); + + b.Property("Dimension"); + + b.Property("DrawDistance"); + + b.Property("Name"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("Rotation"); + + b.Property("Scale"); + + b.Property("ShortRange"); + + b.Property("Sprite"); + + b.HasKey("Id"); + + b.ToTable("Blips"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Saves.SavedMarker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("ColorA"); + + b.Property("ColorB"); + + b.Property("ColorG"); + + b.Property("ColorR"); + + b.Property("Dimension"); + + b.Property("DirectionX"); + + b.Property("DirectionY"); + + b.Property("DirectionZ"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("RotationX"); + + b.Property("RotationY"); + + b.Property("RotationZ"); + + b.Property("Scale"); + + b.Property("Type"); + + b.Property("Visible"); + + b.HasKey("Id"); + + b.ToTable("Markers"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Saves.SavedPed", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Dimension"); + + b.Property("HashModel"); + + b.Property("Heading"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.HasKey("Id"); + + b.ToTable("Peds"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Saves.SavedPickup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Dimension"); + + b.Property("PositionX") + .HasMaxLength(128); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("RespawnTime"); + + b.Property("RotationX"); + + b.Property("RotationY"); + + b.Property("RotationZ"); + + b.Property("Vehicle"); + + b.HasKey("Id"); + + b.ToTable("Pickups"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Saves.SavedTextLabel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("ColorA"); + + b.Property("ColorB"); + + b.Property("ColorG"); + + b.Property("ColorR"); + + b.Property("Dimension"); + + b.Property("DrawDistance"); + + b.Property("Font"); + + b.Property("LOS"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("Text") + .IsRequired(); + + b.HasKey("Id"); + + b.ToTable("TextLabels"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.ServerVehicle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active") + .ValueGeneratedOnAdd() + .HasDefaultValue(true); + + b.Property("Discriminator") + .IsRequired(); + + b.Property("DistanceDriven"); + + b.Property("Heading"); + + b.Property("Locked"); + + b.Property("Model"); + + b.Property("NumberPlate") + .HasMaxLength(8); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("PrimaryColor"); + + b.Property("SecondaryColor"); + + b.Property("TankAmount"); + + b.HasKey("Id"); + + b.ToTable("ServerVehicles"); + + b.HasDiscriminator("Discriminator").HasValue("ServerVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.TuningGarage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("X"); + + b.Property("Y"); + + b.Property("Z"); + + b.HasKey("Id"); + + b.ToTable("TuningGarages"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AdminLevel"); + + b.Property("BanId"); + + b.Property("BusinessId"); + + b.Property("CharacterId"); + + b.Property("Dead"); + + b.Property("Email") + .HasMaxLength(64); + + b.Property("FactionId"); + + b.Property("FactionLeader"); + + b.Property("FactionRankId"); + + b.Property("GroupId"); + + b.Property("GroupRank"); + + b.Property("Handmoney"); + + b.Property("HouseId"); + + b.Property("JailTime"); + + b.Property("JobId"); + + b.Property("LogUserId"); + + b.Property("Name") + .HasMaxLength(32); + + b.Property("Password") + .HasMaxLength(64); + + b.Property("PaydayTimer"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("RegistrationDate") + .ValueGeneratedOnAdd(); + + b.Property("SocialClubName") + .HasMaxLength(32); + + b.Property("Wage"); + + b.Property("Wanteds"); + + b.HasKey("Id"); + + b.HasIndex("BanId"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.HasIndex("CharacterId"); + + b.HasIndex("FactionId"); + + b.HasIndex("FactionRankId"); + + b.HasIndex("GroupId"); + + b.HasIndex("HouseId"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Balance"); + + b.Property("Bic") + .HasMaxLength(12); + + b.Property("Iban") + .HasMaxLength(32); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Amount"); + + b.Property("ItemId"); + + b.Property("Slot"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserItems"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.VehicleMod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ModId"); + + b.Property("ServerVehicleId"); + + b.Property("Slot"); + + b.HasKey("Id"); + + b.HasIndex("ServerVehicleId", "Slot") + .IsUnique(); + + b.ToTable("VehicleMods"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Whitelist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("SocialClubName"); + + b.HasKey("Id"); + + b.ToTable("WhitelistEntries"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.FactionVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Server.Entities.ServerVehicle"); + + b.Property("FactionId"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionVehicles"); + + b.HasDiscriminator().HasValue("FactionVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.GroupVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Server.Entities.ServerVehicle"); + + b.Property("GroupId"); + + b.HasIndex("GroupId"); + + b.HasDiscriminator().HasValue("GroupVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.JobVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Server.Entities.ServerVehicle"); + + b.Property("JobId"); + + b.HasDiscriminator().HasValue("JobVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Saves.SavedVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Server.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("SavedVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.ShopVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Server.Entities.ServerVehicle"); + + b.Property("BusinessId"); + + b.Property("Price"); + + b.ToTable("ShopVehicles"); + + b.HasDiscriminator().HasValue("ShopVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Server.Entities.ServerVehicle"); + + b.Property("UserId"); + + b.HasIndex("UserId"); + + b.ToTable("UserVehicles"); + + b.HasDiscriminator().HasValue("UserVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Ban", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.BusRoutePoint", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.BusRoute", "BusRoute") + .WithMany("RoutePoints") + .HasForeignKey("BusRouteId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Character", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.CharacterCloth", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Door", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.DutyCloth", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.FactionBankAccount", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.FactionRank", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.FactionWeapon", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.GroupBankAccount", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.Group", "Group") + .WithMany() + .HasForeignKey("GroupId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.House", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.User", "Owner") + .WithMany() + .HasForeignKey("OwnerId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.Logs.Death", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.User", "Killer") + .WithMany() + .HasForeignKey("KillerId"); + + b.HasOne("ReallifeGamemode.Server.Entities.User", "Victim") + .WithMany() + .HasForeignKey("VictimId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.News", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.User", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.Ban", "Ban") + .WithMany() + .HasForeignKey("BanId"); + + b.HasOne("ReallifeGamemode.Server.Entities.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId"); + + b.HasOne("ReallifeGamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + + b.HasOne("ReallifeGamemode.Server.Entities.FactionRank", "FactionRank") + .WithMany() + .HasForeignKey("FactionRankId"); + + b.HasOne("ReallifeGamemode.Server.Entities.Group", "Group") + .WithMany() + .HasForeignKey("GroupId"); + + b.HasOne("ReallifeGamemode.Server.Entities.House", "House") + .WithMany() + .HasForeignKey("HouseId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserBankAccount", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserItem", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.VehicleMod", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.ServerVehicle", "Vehicle") + .WithMany() + .HasForeignKey("ServerVehicleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.FactionVehicle", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.GroupVehicle", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.Group", "Group") + .WithMany() + .HasForeignKey("GroupId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserVehicle", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs b/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs new file mode 100644 index 00000000..18f1fef3 --- /dev/null +++ b/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs @@ -0,0 +1,45 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace ReallifeGamemode.Migrations +{ + public partial class FactionWeapons : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "FactionWeapons", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + FactionId = table.Column(nullable: false), + WeaponHash = table.Column(nullable: false), + WeaponModel = table.Column(nullable: true), + SlotID = table.Column(nullable: false), + Rank = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FactionWeapons", x => x.Id); + table.ForeignKey( + name: "FK_FactionWeapons_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_FactionWeapons_FactionId", + table: "FactionWeapons", + column: "FactionId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "FactionWeapons"); + } + } +} diff --git a/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs b/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs index f23d7ec4..8e6e138e 100644 --- a/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs +++ b/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs @@ -389,6 +389,28 @@ namespace ReallifeGamemode.Migrations b.ToTable("FactionRanks"); }); + modelBuilder.Entity("ReallifeGamemode.Server.Entities.FactionWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("FactionId"); + + b.Property("Rank"); + + b.Property("SlotID"); + + b.Property("WeaponHash"); + + b.Property("WeaponModel"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionWeapons"); + }); + modelBuilder.Entity("ReallifeGamemode.Server.Entities.GotoPoint", b => { b.Property("Id") @@ -851,7 +873,7 @@ namespace ReallifeGamemode.Migrations b.Property("Password") .HasMaxLength(64); - + b.Property("PaydayTimer"); b.Property("PositionX"); @@ -1093,6 +1115,14 @@ namespace ReallifeGamemode.Migrations .OnDelete(DeleteBehavior.Cascade); }); + modelBuilder.Entity("ReallifeGamemode.Server.Entities.FactionWeapon", b => + { + b.HasOne("ReallifeGamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + modelBuilder.Entity("ReallifeGamemode.Server.Entities.GroupBankAccount", b => { b.HasOne("ReallifeGamemode.Server.Entities.Group", "Group") diff --git a/ReallifeGamemode.Server/Models/DatabaseContext.cs b/ReallifeGamemode.Server/Models/DatabaseContext.cs index a146e9ea..290ef78d 100644 --- a/ReallifeGamemode.Server/Models/DatabaseContext.cs +++ b/ReallifeGamemode.Server/Models/DatabaseContext.cs @@ -41,6 +41,7 @@ namespace ReallifeGamemode.Server.Models public DbSet Characters { get; set; } public DbSet CharacterClothes { get; set; } public DbSet DutyClothes { get; set; } + public DbSet FactionWeapons { get; set; } public DbSet ClothCombinations { get; set; } public DbSet Users { get; set; } public DbSet UserVehicles { get; set; } diff --git a/ReallifeGamemode.Server/Wanted/Jail.cs b/ReallifeGamemode.Server/Wanted/Jail.cs index a51feeb9..45cfbf65 100644 --- a/ReallifeGamemode.Server/Wanted/Jail.cs +++ b/ReallifeGamemode.Server/Wanted/Jail.cs @@ -11,7 +11,7 @@ using ReallifeGamemode.Server.Services; namespace ReallifeGamemode.Server.Wanted { - public class Jail + public class Jail : Script { private static Dictionary Jailtime { get; set; } = new Dictionary(); //time in seconds @@ -172,8 +172,15 @@ namespace ReallifeGamemode.Server.Wanted } } - public static void Release_Jail(Client player, string reason) + + + [RemoteEvent("setPrisonerFree")] + public void Release_Jail(Client cop, string client) { + Client player = ClientService.GetClientByNameOrId(client); + if (player == null) + return; + User user = player.GetUser(); if (Jailtime.ContainsKey(user.Id)) { @@ -191,7 +198,7 @@ namespace ReallifeGamemode.Server.Wanted User copUser = copPlayer.GetUser(); if ((copUser.FactionId == 1 || copUser.FactionId == 3)) { - ChatService.SendMessage(copPlayer, "~r~HQ: Beamter " + copPlayer.Name + " hat " + user.Name + " aus dem Knast entlassen. Grund: " + reason + "."); + ChatService.SendMessage(copPlayer, "~r~HQ: Beamter " + cop.Name + " hat " + user.Name + " aus dem Knast entlassen."); } }