From bbcb56c492c96c287029ab09ead2d7d8e5bc2e16 Mon Sep 17 00:00:00 2001 From: Lukas Moungos Date: Sun, 21 Jul 2019 21:01:14 +0200 Subject: [PATCH] [+] Add Command for Admin /setweaponrack , /rmweaponrack and for Leader /setweaponrank + Add blip alpha channel for Players (set to 125) + Add blip color for Player with Wanted - Removed WeaponHash from DB entry FactionWeapons (Deprecated) --- ReallifeGamemode.Client/Gui/blips.ts | 2 +- .../Commands/AdminCommands.cs | 135 +- .../Commands/FactionCommands.cs | 43 +- .../Entities/FactionWeapon.cs | 1 - ReallifeGamemode.Server/Events/Key.cs | 63 +- .../Events/UpdateCharacterWeapon.cs | 48 +- .../Extensions/ClientExtension.cs | 2 +- .../20190721144830_FactionWeapons.Designer.cs | 2 - .../20190721144830_FactionWeapons.cs | 1 - ...4931_FactionWeaponsRemovedHash.Designer.cs | 1234 +++++++++++++++++ ...0190721184931_FactionWeaponsRemovedHash.cs | 23 + .../DatabaseContextModelSnapshot.cs | 2 - ReallifeGamemode.Server/Wanted/Jail.cs | 1 + 13 files changed, 1489 insertions(+), 68 deletions(-) create mode 100644 ReallifeGamemode.Server/Migrations/20190721184931_FactionWeaponsRemovedHash.Designer.cs create mode 100644 ReallifeGamemode.Server/Migrations/20190721184931_FactionWeaponsRemovedHash.cs diff --git a/ReallifeGamemode.Client/Gui/blips.ts b/ReallifeGamemode.Client/Gui/blips.ts index f852b2e1..18b42ce0 100644 --- a/ReallifeGamemode.Client/Gui/blips.ts +++ b/ReallifeGamemode.Client/Gui/blips.ts @@ -10,7 +10,7 @@ export default function playerBlips() { if (entity.type === "player") { let color = parseInt(entity.getVariable("blipColor")); if (entity.blip == 0) entity.createBlip(1); - + entity.blip.alpha = 125; entity.setBlipColor(isNaN(color) ? 0 : color); mp.game.invoke(Natives.SET_BLIP_CATEGORY, entity.blip, 7); mp.game.invoke(Natives.SHOW_HEADING_INDICATOR_ON_BLIP, entity.blip, true); diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index fc5ec97e..efccf455 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -2600,9 +2600,142 @@ namespace ReallifeGamemode.Server.Commands } } + [Command("setweaponrack", "~m~Benutzung: ~s~/setweaponrack [Fraktion ID] [Waffen Model] [SlotID (1-4)]")] + public void CmdAdminSetWeaponrack(Client player, int factionID,string weaponModel,int slotId) + { + if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true) + { + ChatService.NotAuthorized(player); + return; + } + + using (var dbContext = new DatabaseContext()) + { + Entities.Faction f = dbContext.Factions.FirstOrDefault(x => x.Id == factionID); + if (f == null) + { + ChatService.ErrorMessage(player, "Diese Fraktion existiert nicht (Liste: ~m~/factionlist~s~)"); + return; + } + if (weaponModel != "Schutzweste") + { + if (!uint.TryParse(weaponModel, out uint weapon)) + { + if (weaponModel.Contains("mk2") && !weaponModel.Contains("_mk2")) weaponModel = weaponModel.Replace("mk2", "_mk2"); + weapon = NAPI.Util.GetHashKey($"weapon_{weaponModel}"); + } + + if (!WeaponManager.IsValidHash(weapon)) + { + ChatService.ErrorMessage(player, "Diese Waffe existiert nicht"); + return; + } + + Entities.FactionWeapon fw = dbContext.FactionWeapons.FirstOrDefault(w => w.FactionId == factionID && w.WeaponModel == weaponModel); + if (fw == null) + { + var newWeapon = new Entities.FactionWeapon + { + WeaponModel = weaponModel, + SlotID = slotId, + Rank = 12, + FactionId = factionID + }; + dbContext.FactionWeapons.Add(newWeapon); + dbContext.SaveChanges(); + ChatService.SendMessage(player, "Neuer Waffeneintrag für die Fraktion " + f.Name + ": " + weaponModel + ", SlotId: " + slotId); + return; + } + + fw.SlotID = slotId; + dbContext.SaveChanges(); + ChatService.SendMessage(player, "Waffeneintrag bearbeitet für die Fraktion " + f.Name + ": " + weaponModel + ", SlotId: " + slotId); + return; + + } + + Entities.FactionWeapon fw2 = dbContext.FactionWeapons.FirstOrDefault(w => w.FactionId == factionID && w.WeaponModel == weaponModel); + if (fw2 == null) + { + var schutzweste = new Entities.FactionWeapon + { + WeaponModel = weaponModel, + SlotID = slotId, + Rank = 12, + FactionId = factionID + }; + dbContext.FactionWeapons.Add(schutzweste); + dbContext.SaveChanges(); + ChatService.SendMessage(player, "Neuer Waffeneintrag für die Fraktion " + f.Name + ": " + weaponModel + ", SlotId: " + slotId); + return; + } + + fw2.SlotID = slotId; + dbContext.SaveChanges(); + ChatService.SendMessage(player, "Waffeneintrag bearbeitet für die Fraktion " + f.Name + ": " + weaponModel + ", SlotId: " + slotId); + return; + } + } + + + [Command("rmweaponrack", "~m~Benutzung: ~s~/rmweaponrack [Fraktion ID] [Waffen Model]")] + public void CmdAdminRmWeaponrack(Client player, int factionID, string weaponModel) + { + if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true) + { + ChatService.NotAuthorized(player); + return; + } + + using (var dbContext = new DatabaseContext()) + { + Entities.Faction f = dbContext.Factions.FirstOrDefault(x => x.Id == factionID); + if (f == null) + { + ChatService.ErrorMessage(player, "Diese Fraktion existiert nicht (Liste: ~m~/factionlist~s~)"); + return; + } + if (weaponModel != "Schutzweste") + { + if (!uint.TryParse(weaponModel, out uint weapon)) + { + if (weaponModel.Contains("mk2") && !weaponModel.Contains("_mk2")) weaponModel = weaponModel.Replace("mk2", "_mk2"); + weapon = NAPI.Util.GetHashKey($"weapon_{weaponModel}"); + } + + if (!WeaponManager.IsValidHash(weapon)) + { + ChatService.ErrorMessage(player, "Diese Waffe existiert nicht"); + return; + } + + Entities.FactionWeapon fw = dbContext.FactionWeapons.FirstOrDefault(w => w.FactionId == factionID && w.WeaponModel == weaponModel); + if (fw != null) + { + dbContext.FactionWeapons.Remove(fw); + ChatService.SendMessage(player, "Waffe entsorgt für die Fraktion " + f.Name + ": " + weaponModel); + dbContext.SaveChanges(); + return; + } + ChatService.ErrorMessage(player, "Diese Waffe befindet sich nicht im Waffenlager"); + return; + } + Entities.FactionWeapon fw2 = dbContext.FactionWeapons.FirstOrDefault(w => w.FactionId == factionID && w.WeaponModel == weaponModel); + if (fw2 != null) + { + dbContext.FactionWeapons.Remove(fw2); + ChatService.SendMessage(player, "Schutzweste entsorgt für die Fraktion " + f.Name + ": " + weaponModel); + dbContext.SaveChanges(); + return; + } + ChatService.ErrorMessage(player, "Es befindet sich keine Schutzweste im Waffenlager"); + } + } + + #endregion - #region ALevel1338 + #region ALevel1338 [Command("whitelist", "~m~Benutzung: ~s~/whitelist [Add / Remove] [Socialclub Name]")] public void CmdAdminWhitelist(Client player, string option, string scName) { diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index 76ff36a5..78bed14c 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -2,6 +2,7 @@ using ReallifeGamemode.Server.Entities; using ReallifeGamemode.Server.Extensions; using ReallifeGamemode.Server.Factions.Medic; +using ReallifeGamemode.Server.Managers; using ReallifeGamemode.Server.Models; using ReallifeGamemode.Server.Services; using ReallifeGamemode.Server.Wanted; @@ -131,8 +132,48 @@ namespace ReallifeGamemode.Server.Commands if (p.GetUser()?.FactionLeader ?? false) ChatService.SendMessage(p, broadcastMsg); }); } + + [Command("setweaponrank", "~m~Benutzung: ~s~/setweaponrank [Waffen Name] [Rank]")] + public void CmdFactionWeaponRank(Client player, string weaponModel, int rank) + { + if (player.GetUser()?.FactionId == null || player.GetUser().FactionLeader == false) + { + ChatService.NotAuthorized(player); + return; + } + if (rank > 12 || rank < 1) + { + ChatService.ErrorMessage(player, "Gebe einen gültigen Rang ein"); + return; + } + + User user = player.GetUser(); + WeaponPoint nearestWeapon = PositionManager.WeaponPoints.Find(w => w.Position.DistanceTo(player.Position) <= 1.5 && w.FactionId == user.FactionId); + if (nearestWeapon == null) + { + ChatService.ErrorMessage(player, "Du bist nicht in der nähe vom Waffenspind"); + return; + } + + using (var context = new DatabaseContext()) + { + Entities.FactionWeapon fw2 = context.FactionWeapons.FirstOrDefault(w => w.FactionId == user.FactionId && w.WeaponModel == weaponModel); + + if (fw2 != null) + { + fw2.Rank = rank; + context.SaveChanges(); + ChatService.SendMessage(player, "Du hast die " + weaponModel + " als Rang " + rank + " Waffe eingestellt."); + return; + } + ChatService.ErrorMessage(player, "Diese Waffe ist nicht im Waffenlager"); + return; + } + } + + #endregion - #region Sanitäter Commands + #region Sanitäter Commands [Command("revive", "~m~Benutzung: ~s~/revive")] public void CmdFactionMedicRevive(Client player) diff --git a/ReallifeGamemode.Server/Entities/FactionWeapon.cs b/ReallifeGamemode.Server/Entities/FactionWeapon.cs index ad8e4141..fde28229 100644 --- a/ReallifeGamemode.Server/Entities/FactionWeapon.cs +++ b/ReallifeGamemode.Server/Entities/FactionWeapon.cs @@ -17,7 +17,6 @@ namespace ReallifeGamemode.Server.Entities 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 dcfed08d..ffdb33ab 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -206,6 +206,7 @@ namespace ReallifeGamemode.Server.Events player.SendNotification("Du bist nun ~r~außer Dienst."); NAPI.ClientEvent.TriggerClientEventForAll("updateDutyMedics", false); player.NametagColor = new Color(255, 255, 255); + player.SetSharedData("blipColor", 4); UpdateCharacterCloth.LoadCharacterDefaults(player); } } @@ -216,59 +217,34 @@ namespace ReallifeGamemode.Server.Events List secondarys = new List(); List melees = new List(); List specials = new List(); + primarys.Add("Keine"); + secondarys.Add("Keine"); + melees.Add("Keine"); + specials.Add("Keine"); 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"); - } + if (user.FactionRank.Order >= weapon.Rank) + primarys.Add(weapon.WeaponModel.ToString()); break; case 2: - if (weapon.WeaponHash != -1) - { - if (user.FactionRank.Order >= weapon.Rank) - secondarys.Add(weapon.WeaponModel.ToString()); - } - else - { - secondarys.Add("Keine"); - } + if (user.FactionRank.Order >= weapon.Rank) + secondarys.Add(weapon.WeaponModel.ToString()); break; case 3: - if (weapon.WeaponHash != -1) - { - if (user.FactionRank.Order >= weapon.Rank) - melees.Add(weapon.WeaponModel.ToString()); - } - else - { - melees.Add("Keine"); - } + if (user.FactionRank.Order >= weapon.Rank) + melees.Add(weapon.WeaponModel.ToString()); 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"); - } + if (user.FactionRank.Order >= weapon.Rank) + specials.Add(weapon.WeaponModel.ToString()); break; } } @@ -276,19 +252,18 @@ namespace ReallifeGamemode.Server.Events player.TriggerEvent("showWeaponMenu", primarys.ToArray(), secondarys.ToArray(), melees.ToArray(), specials.ToArray()); } - if(nearestJailReleasePoint != null) + if (nearestJailReleasePoint != null) { List criminals = new List(); + criminals.Add("Keiner"); foreach (Client target in NAPI.Pools.GetAllPlayers()) { User c = target.GetUser(); + if (c.JailTime > 0) { - if (c.JailTime > 0) - { - criminals.Add(c.Name.ToString()); - } - } + criminals.Add(c.Name); + } } player.TriggerEvent("showJailMenu", JsonConvert.SerializeObject(criminals.ToArray())); } diff --git a/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs b/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs index 6ffae3f6..45984261 100644 --- a/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs +++ b/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs @@ -6,7 +6,9 @@ using GTANetworkAPI; using Newtonsoft.Json; using ReallifeGamemode.Server.Entities; using ReallifeGamemode.Server.Extensions; +using ReallifeGamemode.Server.Managers; using ReallifeGamemode.Server.Models; +using ReallifeGamemode.Server.Services; namespace ReallifeGamemode.Server.Events { @@ -18,9 +20,9 @@ namespace ReallifeGamemode.Server.Events [RemoteEvent("updateWeaponSelection")] public void UpdateWeaponSelection(Client client, string weaponModel, int slot) { - if(weaponModel == "Schutzweste") + if(weaponModel == "Keine") { - client.Armor = 100; + client.RemoveAllWeapons(); return; } @@ -45,8 +47,7 @@ namespace ReallifeGamemode.Server.Events if (slot == 4) { client.RemoveAllWeapons(); - client.GiveWeapon(weaponHash, 0); - client.Armor = 0; + client.GiveWeapon(weaponHash, 0); } } @@ -61,19 +62,38 @@ namespace ReallifeGamemode.Server.Events 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); - + if (!uint.TryParse(primaryModel, out uint primary)) + { + if (primaryModel.Contains("mk2") && !primaryModel.Contains("_mk2")) primaryModel = primaryModel.Replace("mk2", "_mk2"); + primary = NAPI.Util.GetHashKey($"weapon_{primaryModel}"); + } + if (!uint.TryParse(secondaryModel, out uint secondary)) + { + if (secondaryModel.Contains("mk2") && !secondaryModel.Contains("_mk2")) secondaryModel = secondaryModel.Replace("mk2", "_mk2"); + secondary = NAPI.Util.GetHashKey($"weapon_{secondaryModel}"); + } + if (!uint.TryParse(meleeModel, out uint melee)) + { + if (meleeModel.Contains("mk2") && !meleeModel.Contains("_mk2")) meleeModel = meleeModel.Replace("mk2", "_mk2"); + melee = NAPI.Util.GetHashKey($"weapon_{meleeModel}"); + } - client.GiveWeapon(primary, 150); - client.GiveWeapon(secondary, 600); - client.GiveWeapon(melee, 1); + + client.GiveWeapon((WeaponHash)primary, 150); + client.GiveWeapon((WeaponHash)secondary, 600); + client.GiveWeapon((WeaponHash)melee, 1); if(specialModel != "Schutzweste") { - WeaponHash special = NAPI.Util.WeaponNameToModel(specialModel); - client.GiveWeapon(special, 50); - } + client.Armor = 0; + if (!uint.TryParse(specialModel, out uint special)) + { + if (specialModel.Contains("mk2") && !specialModel.Contains("_mk2")) specialModel = specialModel.Replace("mk2", "_mk2"); + special = NAPI.Util.GetHashKey($"weapon_{specialModel}"); + } + client.GiveWeapon((WeaponHash)special, 50); + return; + } + client.Armor = 100; } } } diff --git a/ReallifeGamemode.Server/Extensions/ClientExtension.cs b/ReallifeGamemode.Server/Extensions/ClientExtension.cs index b1138273..0fff19ab 100644 --- a/ReallifeGamemode.Server/Extensions/ClientExtension.cs +++ b/ReallifeGamemode.Server/Extensions/ClientExtension.cs @@ -104,7 +104,7 @@ namespace ReallifeGamemode.Server.Extensions dbUser.Wanteds = newWanteds; dbContext.SaveChanges(); } - + user.Client.SetSharedData("blipColor", 64); ChatService.SendMessage(user.Client, "Du hast ein Verbrechen begangen: " + reason + "." + (cop != null ? " Gemeldet von: " + cop.Name + "." : "")); ChatService.SendMessage(user.Client, "Fahnundgslevel: " + newWanteds); diff --git a/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.Designer.cs b/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.Designer.cs index 3bd190be..5e7efa31 100644 --- a/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.Designer.cs +++ b/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.Designer.cs @@ -402,8 +402,6 @@ namespace ReallifeGamemode.Migrations b.Property("slotID"); - b.Property("weaponHash"); - b.Property("weaponModel"); b.HasKey("Id"); diff --git a/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs b/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs index 18f1fef3..7e02d487 100644 --- a/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs +++ b/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs @@ -14,7 +14,6 @@ namespace ReallifeGamemode.Migrations 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) diff --git a/ReallifeGamemode.Server/Migrations/20190721184931_FactionWeaponsRemovedHash.Designer.cs b/ReallifeGamemode.Server/Migrations/20190721184931_FactionWeaponsRemovedHash.Designer.cs new file mode 100644 index 00000000..764f7d26 --- /dev/null +++ b/ReallifeGamemode.Server/Migrations/20190721184931_FactionWeaponsRemovedHash.Designer.cs @@ -0,0 +1,1234 @@ +// +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("20190721184931_FactionWeaponsRemovedHash")] + partial class FactionWeaponsRemovedHash + { + 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("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/20190721184931_FactionWeaponsRemovedHash.cs b/ReallifeGamemode.Server/Migrations/20190721184931_FactionWeaponsRemovedHash.cs new file mode 100644 index 00000000..c814f362 --- /dev/null +++ b/ReallifeGamemode.Server/Migrations/20190721184931_FactionWeaponsRemovedHash.cs @@ -0,0 +1,23 @@ +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( + name: "WeaponHash", + table: "FactionWeapons", + nullable: false, + defaultValue: 0); + } + } +} diff --git a/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs b/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs index 8e6e138e..936fcdcf 100644 --- a/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs +++ b/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs @@ -400,8 +400,6 @@ namespace ReallifeGamemode.Migrations b.Property("SlotID"); - b.Property("WeaponHash"); - b.Property("WeaponModel"); b.HasKey("Id"); diff --git a/ReallifeGamemode.Server/Wanted/Jail.cs b/ReallifeGamemode.Server/Wanted/Jail.cs index 45cfbf65..cacacdcb 100644 --- a/ReallifeGamemode.Server/Wanted/Jail.cs +++ b/ReallifeGamemode.Server/Wanted/Jail.cs @@ -21,6 +21,7 @@ namespace ReallifeGamemode.Server.Wanted User user = client.GetUser(); if (user.JailTime > 0) { + client.SetSharedData("blipColor", 4); client.RemoveAllWeapons(); client.Health = 100; client.Armor = 0;