diff --git a/ReallifeGamemode.Client/Gui/blips.ts b/ReallifeGamemode.Client/Gui/blips.ts index 547b6a10..1c44de47 100644 --- a/ReallifeGamemode.Client/Gui/blips.ts +++ b/ReallifeGamemode.Client/Gui/blips.ts @@ -25,14 +25,15 @@ playerBlipMap.set(player, pBlip); } let pBlip = playerBlipMap.get(player); - let color = player.getVariable("blipColor"); - pBlip.setColour(isNaN(color) ? 0 : color); - pBlip.setPosition(player.position.x, player.position.y, player.position.z); if (player.isDead()) { pBlip.setSprite(303); } else { pBlip.setSprite(1); } + let color = player.getVariable("blipColor"); + pBlip.setColour(isNaN(color) ? 0 : color); + pBlip.setPosition(player.position.x, player.position.y, player.position.z); + }); }, 50); diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index 7fee2fc4..97fd1cc5 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -29,7 +29,7 @@ const colors = [ export default function customNametags() { mp.nametags.enabled = false; - mp.events.add('render', (nametags) => { + mp.events.add(RageEnums.EventKey.RENDER, (nametags) => { const graphics = mp.game.graphics; const screenRes = graphics.getScreenResolution(0, 0); @@ -51,7 +51,13 @@ export default function customNametags() { let color = colors.find(c => c.id === colorId).color; - mp.game.graphics.drawText(player.name + " (" + player.remoteId + ")", [x, y], + let nametagText = player.name + " (" + player.remoteId + ")"; + + if (player.getVariable("isAfk")) { + nametagText += " ~r~AFK"; + } + + mp.game.graphics.drawText(nametagText, [x, y], { font: 4, color: [color[0], color[1], color[2], color[3]], diff --git a/ReallifeGamemode.Client/Gui/policedepartment.ts b/ReallifeGamemode.Client/Gui/policedepartment.ts index df378604..4fd90f72 100644 --- a/ReallifeGamemode.Client/Gui/policedepartment.ts +++ b/ReallifeGamemode.Client/Gui/policedepartment.ts @@ -4,7 +4,7 @@ import { Menu, Point, UIMenuItem } from "../libs/NativeUI"; import { createMenuItem } from "../util"; import moneyformat from "../moneyformat"; var screenRes = mp.game.graphics.getScreenResolution(0, 0); -var menu: Menu = new Menu("Polizeirevier", "Die Hilfestelle der Polizei", new Point(0, screenRes.y / 3)); +var menu: Menu = new Menu("", "Hier kannst du den Waffenschein erwerben", new Point(0, screenRes.y / 3), "shopui_title_gunclub", "shopui_title_gunclub"); menu.AddItem(createMenuItem("Waffenschein kaufen", "Erwerbe einen Waffenschein", (item) => { item.SetRightLabel("$" + moneyformat(5000)); @@ -24,7 +24,7 @@ menu.MenuClose.on(() => { game.events.add("SERVER:PoliceDepartment_EnterColShape", () => { //game.ui.setHelpText("Drücke ~INPUT_CONTEXT~, um das Menü des Polizeireviers zu öffnen"); - mp.events.call("renderHelpTextOnScreen", "~s~Drücke ~g~E~s~ um das Menü des ~b~Polizeireviers ~s~zu öffnen") + //mp.events.call("renderHelpTextOnScreen", "~s~Drücke ~g~E~s~ um das Menü des ~b~Polizeireviers ~s~zu öffnen") game.events.bindKey(Key.E, false, keyPressHandler); }); diff --git a/ReallifeGamemode.Client/Gui/vehiclemenu/main.ts b/ReallifeGamemode.Client/Gui/vehiclemenu/main.ts index d5988b50..385eaacb 100644 --- a/ReallifeGamemode.Client/Gui/vehiclemenu/main.ts +++ b/ReallifeGamemode.Client/Gui/vehiclemenu/main.ts @@ -9,6 +9,44 @@ var screenRes = mp.game.graphics.getScreenResolution(0, 0); export default function vehicleMenu(globalData: IGlobalData) { let menuBrowser: BrowserMp = null; + var lastDriversBrowser: BrowserMp = null; + + var lastDrivers = null; + + mp.events.add('lookLastDrivers', (lastDriversParam) => { + lastDrivers = JSON.parse(lastDriversParam); + + if (lastDriversBrowser !== null) { + lastDriversBrowser.destroy(); + lastDriversBrowser = null; + globalData.InMenu = false; + mp.gui.cursor.show(false, false); + mp.gui.chat.activate(true); + } + else if (!globalData.InMenu) { + globalData.InMenu = true; + lastDriversBrowser = mp.browsers.new('package://assets/vehicle/lastPlayers.html'); + mp.gui.chat.activate(false); + mp.gui.cursor.show(true, true); + } + }); + + mp.events.add("CEF:VehicleLook_Loaded", () => { + lastDriversBrowser.execute(`setDrivers('${JSON.stringify(lastDrivers)}');`); + }); + + mp.events.add("removeLookMenu", () => { + if (lastDriversBrowser == null) { + return; + } + else if (globalData.InMenu) { + lastDriversBrowser.destroy(); + lastDriversBrowser = null; + globalData.InMenu = false; + mp.gui.cursor.show(false, false); + mp.gui.chat.activate(true); + } + }); mp.events.add('ToggleVehicleMenu', () => { if (menuBrowser !== null) { diff --git a/ReallifeGamemode.Client/Interaction/ammunation/ammunation.ts b/ReallifeGamemode.Client/Interaction/ammunation/ammunation.ts new file mode 100644 index 00000000..947c7797 --- /dev/null +++ b/ReallifeGamemode.Client/Interaction/ammunation/ammunation.ts @@ -0,0 +1,89 @@ +import * as NativeUI from '../../libs/NativeUI'; + +const Menu = NativeUI.Menu; +const MenuItem = NativeUI.UIMenuItem; +const MenuListItem = NativeUI.UIMenuListItem; +const MenuCheckboxItem = NativeUI.UIMenuCheckboxItem; +const BadgeStyle = NativeUI.BadgeStyle; +const Point = NativeUI.Point; +const ItemsCollection = NativeUI.ItemsCollection; +const Color = NativeUI.Color; + +export default function ammunation(globalData: IGlobalData) { + + var screenRes = mp.game.graphics.getScreenResolution(0, 0); + var weapons: Weapon[]; + + mp.events.add("AmmunationShop:LoadNativeUI", (weaponList: string) => { + + weapons = JSON.parse(weaponList); + var menu = getAmmunationMenu(); + + //Schaut nach ob mindestens eine Waffe in weapons existiert welche die CategoryId beinhaltet + for (var c = 1; c < 10; c++) { + switch (c) { + case 1: { //Meelee + + break; + } + + case 2: { //Pistolen + if (weapons.find(w => w.CategoryId == c)) { + var pistolItem = new MenuItem("Pistolen", "Das kleine Kaliber",); + menu.AddItem(pistolItem); + menu.BindMenuToItem(getWeaponsFromCategory(menu, c, "Pistolen"),pistolItem); + } + break; + } + /*case 9: { //Sonstiges (Armor / Fallschirm) + var otherItem = new MenuItem("Sonstiges", "Schutzwesten, Fallschirme...",); + menu.AddItem(otherItem); + menu.BindMenuToItem(getWeaponsFromCategory(menu, c, "Sonstiges"), otherItem); + break; + }*/ + } + } + menu.Open(); + mp.gui.chat.activate(false); + globalData.InMenu = true; + + menu.MenuClose.on(() => { + globalData.InMenu = false; + mp.gui.chat.show(true); + }) + }); + + function getAmmunationMenu(): NativeUI.Menu { + return new Menu("", "AMMU NATION - Waffenladen", new Point(0, screenRes.y / 3), "shopui_title_gunclub", "shopui_title_gunclub"); + } + + function getWeaponsFromCategory(parentMenu: NativeUI.Menu, category: number, categoryName: string): NativeUI.Menu { + var categoryMenu = new Menu("", categoryName, new Point(0, screenRes.y / 3), "shopui_title_gunclub", "shopui_title_gunclub"); + + categoryMenu.Visible = false; + + var cWeapons: Weapon[] = weapons.filter(w => w.CategoryId == category); + + if (category < 9) { //Weapons aus Datenbank + cWeapons.forEach(weapon => { + var weaponItem: NativeUI.UIMenuItem = new MenuItem(weapon.WeaponModel, "Du erhältst " + weapon.Ammo + " Munition", [weapon.WeaponModel, weapon.Ammo, weapon.Price]); + categoryMenu.AddItem(weaponItem); + weaponItem.SetRightLabel("~g~$" + weapon.Price.toString()); + }) + } else { //Sonstiges = Schutzwesten / Fallschirme + var armorItem = new MenuItem("Schutzweste", "Sch\u00fctzt dich","armor",); + categoryMenu.AddItem(armorItem); + armorItem.SetRightLabel("~g~$3000"); + + var parachuteItem = new MenuItem("Fallschirm", "Flieg damit wohin du willst"); + categoryMenu.AddItem(parachuteItem); + parachuteItem.SetRightLabel("~g~$500"); + } + + categoryMenu.ItemSelect.on((item: NativeUI.UIMenuItem, index: number) => { + mp.events.callRemote("CLIENT:Ammunation_BuyWeapon", item.Data[0], item.Data[1], item.Data[2]); //weaponmodel / ammo / price + }); + + return categoryMenu; + }; +}; \ No newline at end of file diff --git a/ReallifeGamemode.Client/Interaction/interactionmenu.ts b/ReallifeGamemode.Client/Interaction/interactionmenu.ts index 3864a46d..0eb1b053 100644 --- a/ReallifeGamemode.Client/Interaction/interactionmenu.ts +++ b/ReallifeGamemode.Client/Interaction/interactionmenu.ts @@ -464,6 +464,23 @@ export default function (globalData: IGlobalData) { wageItem.SetRightLabel("$" + jobdata.wage.toString()) } jobMenu.AddItem(wageItem); + + if (jobdata.isActive) { + var quitJobItem = new UIMenuItem("Job Beenden", "Beendet den Job und bringt dich zurück zur Base") + jobMenu.AddItem(quitJobItem); + quitJobItem.HighlightedBackColor = new Color(213, 0, 0); + quitJobItem.BackColor = new Color(229, 57, 53); + + jobMenu.ItemSelect.on((item, index) => { + if (item == quitJobItem) { + mp.events.callRemote("CLIENT:Job_StopJob"); + jobMenu.Close(true); + mp.gui.chat.activate(true); + globalData.InMenu = false; + } + }); + } + jobMenu.Visible = false; mp.gui.chat.show(false); return jobMenu; diff --git a/ReallifeGamemode.Client/admin/spectate.ts b/ReallifeGamemode.Client/admin/spectate.ts new file mode 100644 index 00000000..cf66bb43 --- /dev/null +++ b/ReallifeGamemode.Client/admin/spectate.ts @@ -0,0 +1,12 @@ +let cam: CameraMp = mp.cameras.new('spectateCam');; +mp.events.add("SERVER:ADMIN_SPECTATE", (targetPlayer) => { + cam.attachTo(targetPlayer.handle, 10.0, 0.0, 10.0, true); + cam.setActive(true); +}); + +mp.events.add("SERVER:ADMIN_STOP_SPECTATE", () => { + if (cam.isActive() == true) { + cam.setActive(false); + } +}); + \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/chat/index.html b/ReallifeGamemode.Client/assets/chat/index.html index 235d45c3..d4354663 100644 --- a/ReallifeGamemode.Client/assets/chat/index.html +++ b/ReallifeGamemode.Client/assets/chat/index.html @@ -9,6 +9,6 @@ - + \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/chat/js/main.js b/ReallifeGamemode.Client/assets/chat/js/main.js index 55576e9b..fe051878 100644 --- a/ReallifeGamemode.Client/assets/chat/js/main.js +++ b/ReallifeGamemode.Client/assets/chat/js/main.js @@ -1,6 +1,4 @@ -var neatoEmojiConverter = require('neato-emoji-converter') - -let chat = +let chat = { size: 0, history_limit: 50, @@ -40,14 +38,7 @@ var chatAPI = push: (text) => { let colorPositions = []; let colors = []; - let chatElement = "
  • " - - var converter = new neatoEmojiConverter([replacements]); - text = converter.replaceShortcodesWith(text, function (unicodeChar, shortcode, name, object) { - if (unicodeChar) { return unicodeChar } - else if (object.url) { return `${name}` } - else { return shortcode } - }); + let chatElement = "
  • "; for (let i = 0; i < text.length; i++) { let colorCheck = `${text[i]}${text[i + 1]}${text[i + 2]}`; diff --git a/ReallifeGamemode.Client/assets/chat/js/newMain.js b/ReallifeGamemode.Client/assets/chat/js/newMain.js index 290c53ac..c749059b 100644 --- a/ReallifeGamemode.Client/assets/chat/js/newMain.js +++ b/ReallifeGamemode.Client/assets/chat/js/newMain.js @@ -206,6 +206,10 @@ enableChatInput(false); } + + chatAPI.push("lol"); + + $("#chat").hide(); }); }); }, { "neato-emoji-converter": 2 }], 2: [function (require, module, exports) { diff --git a/ReallifeGamemode.Client/assets/html/vehiclemenu/script.js b/ReallifeGamemode.Client/assets/html/vehiclemenu/script.js new file mode 100644 index 00000000..82dbf11f --- /dev/null +++ b/ReallifeGamemode.Client/assets/html/vehiclemenu/script.js @@ -0,0 +1,16 @@ + + + +function ad_row(id, name, faction, ping) { + var table_id = "t1"; + var table = document.getElementById(table_id); + var rows = table.getElementsByTagName('tr').length; + var tr = table.insertRow(rows); + var td1 = document.createElement('td'); + var td2 = document.createElement('td'); + var td3 = document.createElement('td'); + var td4 = document.createElement('td'); + var test = faction; + td1.innerHTML = ''+driver; + tr.appendChild(td1); +} \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/html/vehiclemenu/style.css b/ReallifeGamemode.Client/assets/html/vehiclemenu/style.css new file mode 100644 index 00000000..aa5f9d4f --- /dev/null +++ b/ReallifeGamemode.Client/assets/html/vehiclemenu/style.css @@ -0,0 +1,67 @@ +/* style.css für Tabliste */ +.greyFont { + color: gray; + font-size: 14px; + width: 250px; +} +div { + user-select: none; +} + +body { + overflow: hidden; + font-family: 'Roboto', sans-serif; + font-weight: 500; + color: #222; + margin: 0; + padding: 0; +} + +h2 { + font-family: 'Roboto', sans-serif; + font-weight: 700; + font-size: 18px; + color: white; + margin:5px; + padding: 5px; + border: 1px solid #808080; + width: 20.75em; +} +.TabWrapper { + background: rgba(0,0,0,0.6); + height: 600px; + width: 600px; + display: block; + padding: 5px; + position: absolute; + left: 32%; + top: 10%; +} +th, td { + color: white; + font-size: 18px; + width:10%; + text-align: left; +} +.scroll { + height: 600px; + width: 600px; + font-size: 12px; + overflow: auto; +} +.force-overflow { + min-height: 600px; +} + +#style1::-webkit-scrollbar { + width: 10px; + background-color: #F5F5F5; +} + +#style1::-webkit-scrollbar-thumb { + background-color: #FF0040; +} + + + + diff --git a/ReallifeGamemode.Client/assets/vehicle/application.js b/ReallifeGamemode.Client/assets/vehicle/application.js new file mode 100644 index 00000000..024717a1 --- /dev/null +++ b/ReallifeGamemode.Client/assets/vehicle/application.js @@ -0,0 +1,26 @@ + +let close = document.getElementById('close'); + +$(document).ready(function () { + mp.trigger("CEF:VehicleLook_Loaded"); +}); + +function setDrivers(driversJson) { + var drivers = JSON.parse(driversJson); + var listTag = $("#drivers-list"); + drivers.forEach(driver => { + var name = driver.Name; + var dateTime = new Date(driver.Time); + + var date = `${dateTime.getDay()}.${dateTime.getMonth()}.${dateTime.getFullYear()}`; + var time = `${dateTime.getHours()}:${dateTime.getMinutes()}:${dateTime.getSeconds()}`; + + var infoLine = `${name} am ${date} um ${time} Uhr`; + var listItemTag = `
  • ${infoLine}
  • `; + listTag.append(listItemTag); + }); +} + +close.onclick = function closeWindow() { + mp.trigger('removeLookMenu'); +} \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/vehicle/lastPlayers.html b/ReallifeGamemode.Client/assets/vehicle/lastPlayers.html new file mode 100644 index 00000000..293f1c03 --- /dev/null +++ b/ReallifeGamemode.Client/assets/vehicle/lastPlayers.html @@ -0,0 +1,29 @@ + + + + + + Eingabe | Life of German + + + + + + + + +
    +
    +

    Letze Fahrer

    +
    +
    + +
    + +
    + + + + \ No newline at end of file diff --git a/ReallifeGamemode.Client/assets/vehicle/style.css b/ReallifeGamemode.Client/assets/vehicle/style.css new file mode 100644 index 00000000..aa5f9d4f --- /dev/null +++ b/ReallifeGamemode.Client/assets/vehicle/style.css @@ -0,0 +1,67 @@ +/* style.css für Tabliste */ +.greyFont { + color: gray; + font-size: 14px; + width: 250px; +} +div { + user-select: none; +} + +body { + overflow: hidden; + font-family: 'Roboto', sans-serif; + font-weight: 500; + color: #222; + margin: 0; + padding: 0; +} + +h2 { + font-family: 'Roboto', sans-serif; + font-weight: 700; + font-size: 18px; + color: white; + margin:5px; + padding: 5px; + border: 1px solid #808080; + width: 20.75em; +} +.TabWrapper { + background: rgba(0,0,0,0.6); + height: 600px; + width: 600px; + display: block; + padding: 5px; + position: absolute; + left: 32%; + top: 10%; +} +th, td { + color: white; + font-size: 18px; + width:10%; + text-align: left; +} +.scroll { + height: 600px; + width: 600px; + font-size: 12px; + overflow: auto; +} +.force-overflow { + min-height: 600px; +} + +#style1::-webkit-scrollbar { + width: 10px; + background-color: #F5F5F5; +} + +#style1::-webkit-scrollbar-thumb { + background-color: #FF0040; +} + + + + diff --git a/ReallifeGamemode.Client/dlcpacks/fbigarage/dlc.rpf b/ReallifeGamemode.Client/dlcpacks/fbigarage/dlc.rpf new file mode 100644 index 00000000..ca513b42 --- /dev/null +++ b/ReallifeGamemode.Client/dlcpacks/fbigarage/dlc.rpf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e40413c355d3721e2a483add948aaad408b17c3ed9a0db409b141aa6110dbb6 +size 35840 diff --git a/ReallifeGamemode.Client/global.d.ts b/ReallifeGamemode.Client/global.d.ts index 9dd783c1..dfd560c5 100644 --- a/ReallifeGamemode.Client/global.d.ts +++ b/ReallifeGamemode.Client/global.d.ts @@ -30,6 +30,7 @@ declare type JobData = { busskill: number; pilotskill: number; wage: number; + isActive: boolean; } declare type VehicleData = { @@ -75,4 +76,17 @@ declare type FactionMember = { declare type FactionRank = { +} + +declare type Weapon = { + WeaponModel: string; + CategoryId: number; + SlotID: number; + Ammo: number; + Price: number; +} + +declare type WeaponCategory = { + Category: number; + Weapons: Weapon[]; } \ No newline at end of file diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index 819e153d..89257c40 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -262,8 +262,12 @@ antiCheat(globalData); import antiAfk from './Player/antiafk'; antiAfk(globalData); +import ammunation from './Interaction/ammunation/ammunation'; +ammunation(globalData); + require('./Gui/policedepartment'); require('./Gui/helptext'); +require('./admin/spectate'); interface VehicleData { EngineState: boolean; diff --git a/ReallifeGamemode.Client/util/animationSync.ts b/ReallifeGamemode.Client/util/animationSync.ts index 169a070b..b56765a3 100644 --- a/ReallifeGamemode.Client/util/animationSync.ts +++ b/ReallifeGamemode.Client/util/animationSync.ts @@ -133,11 +133,13 @@ export default function animationSync() { mp.events.callRemote("CLIENT:ClearAnimationData", false); } + const blockInputControls = [12, 13, 14, 15, 22, 24, 25, 37, 261, 262]; + mp.events.add("render", () => { if (blockInput) { - mp.game.controls.disableControlAction(32, 25, true); - mp.game.controls.disableControlAction(32, 24, true); - mp.game.controls.disableControlAction(32, 22, true); + blockInputControls.forEach((ctrl) => { + mp.game.controls.disableControlAction(32, ctrl, true); + }); } }); diff --git a/ReallifeGamemode.Database/Entities/UserWeapon.cs b/ReallifeGamemode.Database/Entities/UserWeapon.cs new file mode 100644 index 00000000..d981f8b6 --- /dev/null +++ b/ReallifeGamemode.Database/Entities/UserWeapon.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; + +namespace ReallifeGamemode.Database.Entities +{ + public partial class UserWeapon + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + + [ForeignKey("User")] + public int UserId { get; set; } + public User User { get; set; } + + [ForeignKey("Weapon")] + public int WeaponId { get; set; } + public Weapon Weapon { get; set; } + + public int Ammo { get; set; } + } +} diff --git a/ReallifeGamemode.Database/Entities/Weapon.cs b/ReallifeGamemode.Database/Entities/Weapon.cs new file mode 100644 index 00000000..586a74ce --- /dev/null +++ b/ReallifeGamemode.Database/Entities/Weapon.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; +using GTANetworkAPI; + +namespace ReallifeGamemode.Database.Entities +{ + public partial class Weapon + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + public string WeaponModel { get; set; } + [ForeignKey("WeaponCategory")] + public int CategoryId { get; set; } + public WeaponCategory WeaponCategory { get; set; } + public int SlotID { get; set; } + public int Ammo { get; set; } + public float Price { get; set; } + + public bool Legal { get; set; } + public bool AmmunationActive { get; set; } + } +} diff --git a/ReallifeGamemode.Database/Entities/WeaponCategory.cs b/ReallifeGamemode.Database/Entities/WeaponCategory.cs new file mode 100644 index 00000000..342aee7a --- /dev/null +++ b/ReallifeGamemode.Database/Entities/WeaponCategory.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; + +namespace ReallifeGamemode.Database.Entities +{ + public partial class WeaponCategory + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + public string Category { get; set; } + + } +} diff --git a/ReallifeGamemode.Database/Migrations/20210413201146_Ammunations.Designer.cs b/ReallifeGamemode.Database/Migrations/20210413201146_Ammunations.Designer.cs new file mode 100644 index 00000000..88c55e55 --- /dev/null +++ b/ReallifeGamemode.Database/Migrations/20210413201146_Ammunations.Designer.cs @@ -0,0 +1,1975 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using ReallifeGamemode.Database.Models; + +namespace ReallifeGamemode.Database.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20210413201146_Ammunations")] + partial class Ammunations + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.3") + .HasAnnotation("PropertyAccessMode", PropertyAccessMode.PreferFieldDuringConstruction) + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ATM", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("Faulty") + .HasColumnType("tinyint(1)"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("ATMs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Ban", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Applied") + .HasColumnType("int"); + + b.Property("BannedBy") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Reason") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("UntilDateTime") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Bans"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusRoute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("BusRoutes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusRoutePoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BusRouteId") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("BusRouteId"); + + b.ToTable("BusRoutesPoints"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusinessBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.ToTable("BusinessBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusinessData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("BusinessData"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Character", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ageing") + .HasColumnType("tinyint unsigned"); + + b.Property("AgeingOpacity") + .HasColumnType("float"); + + b.Property("BeardColor") + .HasColumnType("tinyint unsigned"); + + b.Property("Blemishes") + .HasColumnType("tinyint unsigned"); + + b.Property("BlemishesOpacity") + .HasColumnType("float"); + + b.Property("Blush") + .HasColumnType("tinyint unsigned"); + + b.Property("BlushColor") + .HasColumnType("tinyint unsigned"); + + b.Property("BlushOpacity") + .HasColumnType("float"); + + b.Property("BrowDepth") + .HasColumnType("float"); + + b.Property("BrowHeight") + .HasColumnType("float"); + + b.Property("CheekDepth") + .HasColumnType("float"); + + b.Property("CheekboneHeight") + .HasColumnType("float"); + + b.Property("CheekboneWidth") + .HasColumnType("float"); + + b.Property("ChestHair") + .HasColumnType("tinyint unsigned"); + + b.Property("ChestHairColor") + .HasColumnType("tinyint unsigned"); + + b.Property("ChestHairOpacity") + .HasColumnType("float"); + + b.Property("ChinDepth") + .HasColumnType("float"); + + b.Property("ChinHeight") + .HasColumnType("float"); + + b.Property("ChinIndent") + .HasColumnType("float"); + + b.Property("ChinWidth") + .HasColumnType("float"); + + b.Property("Complexion") + .HasColumnType("tinyint unsigned"); + + b.Property("ComplexionOpacity") + .HasColumnType("float"); + + b.Property("EyeColor") + .HasColumnType("tinyint unsigned"); + + b.Property("EyeSize") + .HasColumnType("float"); + + b.Property("EyebrowColor") + .HasColumnType("tinyint unsigned"); + + b.Property("Eyebrows") + .HasColumnType("tinyint unsigned"); + + b.Property("EyebrowsOpacity") + .HasColumnType("float"); + + b.Property("FacialHair") + .HasColumnType("tinyint unsigned"); + + b.Property("FacialHairOpacity") + .HasColumnType("float"); + + b.Property("Father") + .HasColumnType("tinyint unsigned"); + + b.Property("Freckles") + .HasColumnType("tinyint unsigned"); + + b.Property("FrecklesOpacity") + .HasColumnType("float"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("Hair") + .HasColumnType("tinyint unsigned"); + + b.Property("HairColor") + .HasColumnType("tinyint unsigned"); + + b.Property("HairHighlightColor") + .HasColumnType("tinyint unsigned"); + + b.Property("JawShape") + .HasColumnType("float"); + + b.Property("JawWidth") + .HasColumnType("float"); + + b.Property("LipThickness") + .HasColumnType("float"); + + b.Property("Lipstick") + .HasColumnType("tinyint unsigned"); + + b.Property("LipstickColor") + .HasColumnType("tinyint unsigned"); + + b.Property("LipstickOpacity") + .HasColumnType("float"); + + b.Property("Makeup") + .HasColumnType("tinyint unsigned"); + + b.Property("MakeupOpacity") + .HasColumnType("float"); + + b.Property("Mother") + .HasColumnType("tinyint unsigned"); + + b.Property("NeckWidth") + .HasColumnType("float"); + + b.Property("NoseBottomHeight") + .HasColumnType("float"); + + b.Property("NoseBridgeDepth") + .HasColumnType("float"); + + b.Property("NoseBroken") + .HasColumnType("float"); + + b.Property("NoseTipHeight") + .HasColumnType("float"); + + b.Property("NoseTipLength") + .HasColumnType("float"); + + b.Property("NoseWidth") + .HasColumnType("float"); + + b.Property("Similarity") + .HasColumnType("float"); + + b.Property("SkinSimilarity") + .HasColumnType("float"); + + b.Property("SunDamage") + .HasColumnType("tinyint unsigned"); + + b.Property("SunDamageOpacity") + .HasColumnType("float"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Characters"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.CharacterCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClothId") + .HasColumnType("int"); + + b.Property("Duty") + .HasColumnType("tinyint(1)"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("SlotType") + .HasColumnType("tinyint unsigned"); + + b.Property("Texture") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("CharacterClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ClothCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("Top") + .HasColumnType("int"); + + b.Property("Torso") + .HasColumnType("int"); + + b.Property("Undershirt") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("ClothCombinations"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Door", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Locked") + .HasColumnType("tinyint(1)"); + + b.Property("Model") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Radius") + .HasColumnType("float"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("Doors"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.DutyCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClothId") + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("SlotType") + .HasColumnType("tinyint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("DutyClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Faction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("GangOwned") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("StateOwned") + .HasColumnType("tinyint(1)"); + + b.Property("WeaponDealTime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BankAccountId"); + + b.ToTable("Factions"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("Bic") + .HasColumnType("varchar(12) CHARACTER SET utf8mb4") + .HasMaxLength(12); + + b.Property("Iban") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.ToTable("FactionBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("RankName") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionRanks"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ammount") + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Rank") + .HasColumnType("int"); + + b.Property("SlotID") + .HasColumnType("int"); + + b.Property("WeaponModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionWeapons"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GotoPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Description") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("GotoPoints"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Group", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("BankAccountId"); + + b.ToTable("Groups"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Balance") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("GroupBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.House", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("CanRentIn") + .HasColumnType("tinyint(1)"); + + b.Property("LastRentSetTime") + .HasColumnType("datetime(6)"); + + b.Property("OwnerId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.Property("RentalFee") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("BankAccountId"); + + b.HasIndex("OwnerId"); + + b.ToTable("Houses"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.HouseBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Balance") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("HouseBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.HouseRental", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("HouseId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("HouseId"); + + b.HasIndex("UserId"); + + b.ToTable("HouseRentals"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Interior", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("EnterPositionStr") + .HasColumnName("EnterPosition") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ExitPositionStr") + .HasColumnName("ExitPosition") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("Interiors"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Heading") + .HasColumnType("double"); + + b.Property("X") + .HasColumnType("double"); + + b.Property("Y") + .HasColumnType("double"); + + b.Property("Z") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.ToTable("Locations"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.BankAccountTransactionHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Fee") + .HasColumnType("int"); + + b.Property("MoneySent") + .HasColumnType("int"); + + b.Property("NewReceiverBalance") + .HasColumnType("int"); + + b.Property("NewSenderBalance") + .HasColumnType("int"); + + b.Property("Origin") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("Receiver") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("ReceiverBalance") + .HasColumnType("int"); + + b.Property("Sender") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("SenderBalance") + .HasColumnType("int"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.ToTable("BankAccountTransactionLogs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.Death", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CauseOfDeath") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("KillerHeading") + .HasColumnType("float"); + + b.Property("KillerId") + .HasColumnType("int"); + + b.Property("KillerPositionX") + .HasColumnType("float"); + + b.Property("KillerPositionY") + .HasColumnType("float"); + + b.Property("KillerPositionZ") + .HasColumnType("float"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("VictimHeading") + .HasColumnType("float"); + + b.Property("VictimId") + .HasColumnType("int"); + + b.Property("VictimPositionX") + .HasColumnType("float"); + + b.Property("VictimPositionY") + .HasColumnType("float"); + + b.Property("VictimPositionZ") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("KillerId"); + + b.HasIndex("VictimId"); + + b.ToTable("DeathLogs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Caption") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Timestamp") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("News"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedBlip", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Alpha") + .HasColumnType("tinyint unsigned"); + + b.Property("Color") + .HasColumnType("tinyint unsigned"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("DrawDistance") + .HasColumnType("float"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("Rotation") + .HasColumnType("float"); + + b.Property("Scale") + .HasColumnType("float"); + + b.Property("ShortRange") + .HasColumnType("tinyint(1)"); + + b.Property("Sprite") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.ToTable("Blips"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedMarker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("ColorA") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorB") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorG") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorR") + .HasColumnType("tinyint unsigned"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("DirectionX") + .HasColumnType("float"); + + b.Property("DirectionY") + .HasColumnType("float"); + + b.Property("DirectionZ") + .HasColumnType("float"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("RotationX") + .HasColumnType("float"); + + b.Property("RotationY") + .HasColumnType("float"); + + b.Property("RotationZ") + .HasColumnType("float"); + + b.Property("Scale") + .HasColumnType("float"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("Visible") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("Markers"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedPed", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("HashModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Heading") + .HasColumnType("float"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Peds"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedPickup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("PositionX") + .HasColumnType("float") + .HasMaxLength(128); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("RespawnTime") + .HasColumnType("int"); + + b.Property("RotationX") + .HasColumnType("float"); + + b.Property("RotationY") + .HasColumnType("float"); + + b.Property("RotationZ") + .HasColumnType("float"); + + b.Property("Vehicle") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("Pickups"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedTextLabel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("ColorA") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorB") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorG") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorR") + .HasColumnType("tinyint unsigned"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("DrawDistance") + .HasColumnType("float"); + + b.Property("Font") + .HasColumnType("tinyint unsigned"); + + b.Property("LOS") + .HasColumnType("tinyint(1)"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("TextLabels"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ServerVariable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.Property("Variable") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("ServerVariables"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ServerVehicle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("DistanceDriven") + .HasColumnType("float"); + + b.Property("Heading") + .HasColumnType("float"); + + b.Property("Livery") + .HasColumnType("int"); + + b.Property("Locked") + .HasColumnType("tinyint(1)"); + + b.Property("Model") + .HasColumnType("int unsigned"); + + b.Property("NumberPlate") + .HasColumnType("varchar(8) CHARACTER SET utf8mb4") + .HasMaxLength(8); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("PrimaryColor") + .HasColumnType("int"); + + b.Property("SecondaryColor") + .HasColumnType("int"); + + b.Property("TankAmount") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("ServerVehicles"); + + b.HasDiscriminator("Discriminator").HasValue("ServerVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ShopClothe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("ClotheId") + .HasColumnType("int"); + + b.Property("ComponentId") + .HasColumnType("int"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("Price") + .HasColumnType("int"); + + b.Property("TypeId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("ShopClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ShopItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Amount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.Property("ShopId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("ShopItems"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.TuningGarage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("TuningGarages"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Turfs", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Color") + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("MaxValue") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Owner") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Range") + .HasColumnType("float"); + + b.Property("Rotation") + .HasColumnType("float"); + + b.Property("Surplus") + .HasColumnType("tinyint(1)"); + + b.Property("Value") + .HasColumnType("int"); + + b.Property("Vector") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("Turfs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AdminLevel") + .HasColumnType("int"); + + b.Property("BanId") + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("BusSkill") + .HasColumnType("int"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Dead") + .HasColumnType("tinyint(1)"); + + b.Property("DriverLicenseBike") + .HasColumnType("tinyint(1)"); + + b.Property("DriverLicenseVehicle") + .HasColumnType("tinyint(1)"); + + b.Property("Email") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("FactionLeader") + .HasColumnType("tinyint(1)"); + + b.Property("FactionRankId") + .HasColumnType("int"); + + b.Property("FlyingLicensePlane") + .HasColumnType("tinyint(1)"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("GroupRank") + .HasColumnType("int"); + + b.Property("Handmoney") + .HasColumnType("int"); + + b.Property("HouseId") + .HasColumnType("int"); + + b.Property("JailTime") + .HasColumnType("int"); + + b.Property("JobId") + .HasColumnType("int"); + + b.Property("LogUserId") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("Password") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("PaydayTimer") + .HasColumnType("int"); + + b.Property("PilotSkill") + .HasColumnType("int"); + + b.Property("PlayedMinutes") + .HasColumnType("int"); + + b.Property("Points") + .HasColumnType("int"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("RegistrationDate") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("SocialClubName") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("Wage") + .HasColumnType("int"); + + b.Property("Wanteds") + .HasColumnType("int"); + + b.Property("WeaponLicense") + .HasColumnType("tinyint(1)"); + + b.Property("failpoints") + .HasColumnType("int"); + + b.Property("otheramount") + .HasColumnType("int"); + + b.Property("trashcount") + .HasColumnType("int"); + + b.Property("warn") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BanId"); + + b.HasIndex("BankAccountId"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.HasIndex("CharacterId"); + + b.HasIndex("FactionId"); + + b.HasIndex("FactionRankId"); + + b.HasIndex("GroupId"); + + b.HasIndex("HouseId"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("Bic") + .HasColumnType("varchar(12) CHARACTER SET utf8mb4") + .HasMaxLength(12); + + b.Property("Iban") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.ToTable("UserBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Amount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("int"); + + b.Property("Slot") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserItems"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ammo") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.Property("WeaponId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("WeaponId"); + + b.ToTable("UserWeapons"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Amount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("int"); + + b.Property("Slot") + .HasColumnType("int"); + + b.Property("VehicleId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("VehicleId"); + + b.ToTable("VehicleItems"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleMod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ModId") + .HasColumnType("int"); + + b.Property("ServerVehicleId") + .HasColumnType("int"); + + b.Property("Slot") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ServerVehicleId", "Slot") + .IsUnique(); + + b.ToTable("VehicleMods"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Weapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ammo") + .HasColumnType("int"); + + b.Property("CategoryId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("float"); + + b.Property("SlotID") + .HasColumnType("int"); + + b.Property("WeaponModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("Weapons"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.WeaponCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("WeaponCategories"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Whitelist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("SocialClubName") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("WhitelistEntries"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("BuyPrice") + .HasColumnType("int"); + + b.Property("Owners") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.ToTable("FactionVehicles"); + + b.HasDiscriminator().HasValue("FactionVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.HasIndex("GroupId"); + + b.HasDiscriminator().HasValue("GroupVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.JobVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("JobId") + .HasColumnType("int"); + + b.HasDiscriminator().HasValue("JobVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.NoobSpawnVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("NoobSpawnVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.NoobVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("NoobVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("SavedVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.SchoolVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("SchoolId") + .HasColumnType("int"); + + b.HasDiscriminator().HasValue("SchoolVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ShopVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.ToTable("ShopVehicles"); + + b.HasDiscriminator().HasValue("ShopVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("Price") + .HasColumnName("UserVehicle_Price") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasIndex("UserId"); + + b.ToTable("UserVehicles"); + + b.HasDiscriminator().HasValue("UserVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Ban", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusRoutePoint", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.BusRoute", "BusRoute") + .WithMany("RoutePoints") + .HasForeignKey("BusRouteId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Character", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.CharacterCloth", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Door", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.DutyCloth", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Faction", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.FactionBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionRank", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionWeapon", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Group", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.GroupBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.House", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.HouseBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + + b.HasOne("ReallifeGamemode.Database.Entities.User", "Owner") + .WithMany() + .HasForeignKey("OwnerId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.HouseRental", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.House", "House") + .WithMany("Rentals") + .HasForeignKey("HouseId"); + + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.Death", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "Killer") + .WithMany() + .HasForeignKey("KillerId"); + + b.HasOne("ReallifeGamemode.Database.Entities.User", "Victim") + .WithMany() + .HasForeignKey("VictimId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.News", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.User", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Ban", "Ban") + .WithMany() + .HasForeignKey("BanId"); + + b.HasOne("ReallifeGamemode.Database.Entities.UserBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + + b.HasOne("ReallifeGamemode.Database.Entities.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId"); + + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + + b.HasOne("ReallifeGamemode.Database.Entities.FactionRank", "FactionRank") + .WithMany() + .HasForeignKey("FactionRankId"); + + b.HasOne("ReallifeGamemode.Database.Entities.Group", "Group") + .WithMany() + .HasForeignKey("GroupId"); + + b.HasOne("ReallifeGamemode.Database.Entities.House", "House") + .WithMany() + .HasForeignKey("HouseId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserItem", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserWeapon", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ReallifeGamemode.Database.Entities.Weapon", "Weapon") + .WithMany() + .HasForeignKey("WeaponId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleItem", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.ServerVehicle", "Vehicle") + .WithMany() + .HasForeignKey("VehicleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleMod", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.ServerVehicle", "Vehicle") + .WithMany() + .HasForeignKey("ServerVehicleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Weapon", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.WeaponCategory", "WeaponCategory") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupVehicle", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Group", "Group") + .WithMany() + .HasForeignKey("GroupId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserVehicle", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ReallifeGamemode.Database/Migrations/20210413201146_Ammunations.cs b/ReallifeGamemode.Database/Migrations/20210413201146_Ammunations.cs new file mode 100644 index 00000000..7891208c --- /dev/null +++ b/ReallifeGamemode.Database/Migrations/20210413201146_Ammunations.cs @@ -0,0 +1,101 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace ReallifeGamemode.Database.Migrations +{ + public partial class Ammunations : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "WeaponCategories", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Category = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_WeaponCategories", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Weapons", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + WeaponModel = table.Column(nullable: true), + CategoryId = table.Column(nullable: false), + SlotID = table.Column(nullable: false), + Ammo = table.Column(nullable: false), + Price = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Weapons", x => x.Id); + table.ForeignKey( + name: "FK_Weapons_WeaponCategories_CategoryId", + column: x => x.CategoryId, + principalTable: "WeaponCategories", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "UserWeapons", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: false), + WeaponId = table.Column(nullable: false), + Ammo = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UserWeapons", x => x.Id); + table.ForeignKey( + name: "FK_UserWeapons_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_UserWeapons_Weapons_WeaponId", + column: x => x.WeaponId, + principalTable: "Weapons", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_UserWeapons_UserId", + table: "UserWeapons", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_UserWeapons_WeaponId", + table: "UserWeapons", + column: "WeaponId"); + + migrationBuilder.CreateIndex( + name: "IX_Weapons_CategoryId", + table: "Weapons", + column: "CategoryId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "UserWeapons"); + + migrationBuilder.DropTable( + name: "Weapons"); + + migrationBuilder.DropTable( + name: "WeaponCategories"); + } + } +} diff --git a/ReallifeGamemode.Database/Migrations/20210416175726_Ammunations2.Designer.cs b/ReallifeGamemode.Database/Migrations/20210416175726_Ammunations2.Designer.cs new file mode 100644 index 00000000..44f31f9a --- /dev/null +++ b/ReallifeGamemode.Database/Migrations/20210416175726_Ammunations2.Designer.cs @@ -0,0 +1,1981 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using ReallifeGamemode.Database.Models; + +namespace ReallifeGamemode.Database.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20210416175726_Ammunations2")] + partial class Ammunations2 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.3") + .HasAnnotation("PropertyAccessMode", PropertyAccessMode.PreferFieldDuringConstruction) + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ATM", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("Faulty") + .HasColumnType("tinyint(1)"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("ATMs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Ban", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Applied") + .HasColumnType("int"); + + b.Property("BannedBy") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Reason") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("UntilDateTime") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Bans"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusRoute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("BusRoutes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusRoutePoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BusRouteId") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("BusRouteId"); + + b.ToTable("BusRoutesPoints"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusinessBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.ToTable("BusinessBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusinessData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("BusinessData"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Character", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ageing") + .HasColumnType("tinyint unsigned"); + + b.Property("AgeingOpacity") + .HasColumnType("float"); + + b.Property("BeardColor") + .HasColumnType("tinyint unsigned"); + + b.Property("Blemishes") + .HasColumnType("tinyint unsigned"); + + b.Property("BlemishesOpacity") + .HasColumnType("float"); + + b.Property("Blush") + .HasColumnType("tinyint unsigned"); + + b.Property("BlushColor") + .HasColumnType("tinyint unsigned"); + + b.Property("BlushOpacity") + .HasColumnType("float"); + + b.Property("BrowDepth") + .HasColumnType("float"); + + b.Property("BrowHeight") + .HasColumnType("float"); + + b.Property("CheekDepth") + .HasColumnType("float"); + + b.Property("CheekboneHeight") + .HasColumnType("float"); + + b.Property("CheekboneWidth") + .HasColumnType("float"); + + b.Property("ChestHair") + .HasColumnType("tinyint unsigned"); + + b.Property("ChestHairColor") + .HasColumnType("tinyint unsigned"); + + b.Property("ChestHairOpacity") + .HasColumnType("float"); + + b.Property("ChinDepth") + .HasColumnType("float"); + + b.Property("ChinHeight") + .HasColumnType("float"); + + b.Property("ChinIndent") + .HasColumnType("float"); + + b.Property("ChinWidth") + .HasColumnType("float"); + + b.Property("Complexion") + .HasColumnType("tinyint unsigned"); + + b.Property("ComplexionOpacity") + .HasColumnType("float"); + + b.Property("EyeColor") + .HasColumnType("tinyint unsigned"); + + b.Property("EyeSize") + .HasColumnType("float"); + + b.Property("EyebrowColor") + .HasColumnType("tinyint unsigned"); + + b.Property("Eyebrows") + .HasColumnType("tinyint unsigned"); + + b.Property("EyebrowsOpacity") + .HasColumnType("float"); + + b.Property("FacialHair") + .HasColumnType("tinyint unsigned"); + + b.Property("FacialHairOpacity") + .HasColumnType("float"); + + b.Property("Father") + .HasColumnType("tinyint unsigned"); + + b.Property("Freckles") + .HasColumnType("tinyint unsigned"); + + b.Property("FrecklesOpacity") + .HasColumnType("float"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("Hair") + .HasColumnType("tinyint unsigned"); + + b.Property("HairColor") + .HasColumnType("tinyint unsigned"); + + b.Property("HairHighlightColor") + .HasColumnType("tinyint unsigned"); + + b.Property("JawShape") + .HasColumnType("float"); + + b.Property("JawWidth") + .HasColumnType("float"); + + b.Property("LipThickness") + .HasColumnType("float"); + + b.Property("Lipstick") + .HasColumnType("tinyint unsigned"); + + b.Property("LipstickColor") + .HasColumnType("tinyint unsigned"); + + b.Property("LipstickOpacity") + .HasColumnType("float"); + + b.Property("Makeup") + .HasColumnType("tinyint unsigned"); + + b.Property("MakeupOpacity") + .HasColumnType("float"); + + b.Property("Mother") + .HasColumnType("tinyint unsigned"); + + b.Property("NeckWidth") + .HasColumnType("float"); + + b.Property("NoseBottomHeight") + .HasColumnType("float"); + + b.Property("NoseBridgeDepth") + .HasColumnType("float"); + + b.Property("NoseBroken") + .HasColumnType("float"); + + b.Property("NoseTipHeight") + .HasColumnType("float"); + + b.Property("NoseTipLength") + .HasColumnType("float"); + + b.Property("NoseWidth") + .HasColumnType("float"); + + b.Property("Similarity") + .HasColumnType("float"); + + b.Property("SkinSimilarity") + .HasColumnType("float"); + + b.Property("SunDamage") + .HasColumnType("tinyint unsigned"); + + b.Property("SunDamageOpacity") + .HasColumnType("float"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Characters"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.CharacterCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClothId") + .HasColumnType("int"); + + b.Property("Duty") + .HasColumnType("tinyint(1)"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("SlotType") + .HasColumnType("tinyint unsigned"); + + b.Property("Texture") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("CharacterClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ClothCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("Top") + .HasColumnType("int"); + + b.Property("Torso") + .HasColumnType("int"); + + b.Property("Undershirt") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("ClothCombinations"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Door", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Locked") + .HasColumnType("tinyint(1)"); + + b.Property("Model") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Radius") + .HasColumnType("float"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("Doors"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.DutyCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClothId") + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("SlotType") + .HasColumnType("tinyint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("DutyClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Faction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("GangOwned") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("StateOwned") + .HasColumnType("tinyint(1)"); + + b.Property("WeaponDealTime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BankAccountId"); + + b.ToTable("Factions"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("Bic") + .HasColumnType("varchar(12) CHARACTER SET utf8mb4") + .HasMaxLength(12); + + b.Property("Iban") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.ToTable("FactionBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("RankName") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionRanks"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ammount") + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Rank") + .HasColumnType("int"); + + b.Property("SlotID") + .HasColumnType("int"); + + b.Property("WeaponModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionWeapons"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GotoPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Description") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("GotoPoints"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Group", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("BankAccountId"); + + b.ToTable("Groups"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Balance") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("GroupBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.House", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("CanRentIn") + .HasColumnType("tinyint(1)"); + + b.Property("LastRentSetTime") + .HasColumnType("datetime(6)"); + + b.Property("OwnerId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.Property("RentalFee") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("BankAccountId"); + + b.HasIndex("OwnerId"); + + b.ToTable("Houses"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.HouseBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Balance") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("HouseBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.HouseRental", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("HouseId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("HouseId"); + + b.HasIndex("UserId"); + + b.ToTable("HouseRentals"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Interior", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("EnterPositionStr") + .HasColumnName("EnterPosition") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ExitPositionStr") + .HasColumnName("ExitPosition") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("Interiors"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Heading") + .HasColumnType("double"); + + b.Property("X") + .HasColumnType("double"); + + b.Property("Y") + .HasColumnType("double"); + + b.Property("Z") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.ToTable("Locations"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.BankAccountTransactionHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Fee") + .HasColumnType("int"); + + b.Property("MoneySent") + .HasColumnType("int"); + + b.Property("NewReceiverBalance") + .HasColumnType("int"); + + b.Property("NewSenderBalance") + .HasColumnType("int"); + + b.Property("Origin") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("Receiver") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("ReceiverBalance") + .HasColumnType("int"); + + b.Property("Sender") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("SenderBalance") + .HasColumnType("int"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.ToTable("BankAccountTransactionLogs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.Death", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CauseOfDeath") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("KillerHeading") + .HasColumnType("float"); + + b.Property("KillerId") + .HasColumnType("int"); + + b.Property("KillerPositionX") + .HasColumnType("float"); + + b.Property("KillerPositionY") + .HasColumnType("float"); + + b.Property("KillerPositionZ") + .HasColumnType("float"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("VictimHeading") + .HasColumnType("float"); + + b.Property("VictimId") + .HasColumnType("int"); + + b.Property("VictimPositionX") + .HasColumnType("float"); + + b.Property("VictimPositionY") + .HasColumnType("float"); + + b.Property("VictimPositionZ") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("KillerId"); + + b.HasIndex("VictimId"); + + b.ToTable("DeathLogs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Caption") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Timestamp") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("News"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedBlip", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Alpha") + .HasColumnType("tinyint unsigned"); + + b.Property("Color") + .HasColumnType("tinyint unsigned"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("DrawDistance") + .HasColumnType("float"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("Rotation") + .HasColumnType("float"); + + b.Property("Scale") + .HasColumnType("float"); + + b.Property("ShortRange") + .HasColumnType("tinyint(1)"); + + b.Property("Sprite") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.ToTable("Blips"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedMarker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("ColorA") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorB") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorG") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorR") + .HasColumnType("tinyint unsigned"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("DirectionX") + .HasColumnType("float"); + + b.Property("DirectionY") + .HasColumnType("float"); + + b.Property("DirectionZ") + .HasColumnType("float"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("RotationX") + .HasColumnType("float"); + + b.Property("RotationY") + .HasColumnType("float"); + + b.Property("RotationZ") + .HasColumnType("float"); + + b.Property("Scale") + .HasColumnType("float"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("Visible") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("Markers"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedPed", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("HashModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Heading") + .HasColumnType("float"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Peds"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedPickup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("PositionX") + .HasColumnType("float") + .HasMaxLength(128); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("RespawnTime") + .HasColumnType("int"); + + b.Property("RotationX") + .HasColumnType("float"); + + b.Property("RotationY") + .HasColumnType("float"); + + b.Property("RotationZ") + .HasColumnType("float"); + + b.Property("Vehicle") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("Pickups"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedTextLabel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("ColorA") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorB") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorG") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorR") + .HasColumnType("tinyint unsigned"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("DrawDistance") + .HasColumnType("float"); + + b.Property("Font") + .HasColumnType("tinyint unsigned"); + + b.Property("LOS") + .HasColumnType("tinyint(1)"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("TextLabels"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ServerVariable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.Property("Variable") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("ServerVariables"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ServerVehicle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("DistanceDriven") + .HasColumnType("float"); + + b.Property("Heading") + .HasColumnType("float"); + + b.Property("Livery") + .HasColumnType("int"); + + b.Property("Locked") + .HasColumnType("tinyint(1)"); + + b.Property("Model") + .HasColumnType("int unsigned"); + + b.Property("NumberPlate") + .HasColumnType("varchar(8) CHARACTER SET utf8mb4") + .HasMaxLength(8); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("PrimaryColor") + .HasColumnType("int"); + + b.Property("SecondaryColor") + .HasColumnType("int"); + + b.Property("TankAmount") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("ServerVehicles"); + + b.HasDiscriminator("Discriminator").HasValue("ServerVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ShopClothe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("ClotheId") + .HasColumnType("int"); + + b.Property("ComponentId") + .HasColumnType("int"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("Price") + .HasColumnType("int"); + + b.Property("TypeId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("ShopClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ShopItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Amount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.Property("ShopId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("ShopItems"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.TuningGarage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("TuningGarages"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Turfs", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Color") + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("MaxValue") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Owner") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Range") + .HasColumnType("float"); + + b.Property("Rotation") + .HasColumnType("float"); + + b.Property("Surplus") + .HasColumnType("tinyint(1)"); + + b.Property("Value") + .HasColumnType("int"); + + b.Property("Vector") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("Turfs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AdminLevel") + .HasColumnType("int"); + + b.Property("BanId") + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("BusSkill") + .HasColumnType("int"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Dead") + .HasColumnType("tinyint(1)"); + + b.Property("DriverLicenseBike") + .HasColumnType("tinyint(1)"); + + b.Property("DriverLicenseVehicle") + .HasColumnType("tinyint(1)"); + + b.Property("Email") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("FactionLeader") + .HasColumnType("tinyint(1)"); + + b.Property("FactionRankId") + .HasColumnType("int"); + + b.Property("FlyingLicensePlane") + .HasColumnType("tinyint(1)"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("GroupRank") + .HasColumnType("int"); + + b.Property("Handmoney") + .HasColumnType("int"); + + b.Property("HouseId") + .HasColumnType("int"); + + b.Property("JailTime") + .HasColumnType("int"); + + b.Property("JobId") + .HasColumnType("int"); + + b.Property("LogUserId") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("Password") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("PaydayTimer") + .HasColumnType("int"); + + b.Property("PilotSkill") + .HasColumnType("int"); + + b.Property("PlayedMinutes") + .HasColumnType("int"); + + b.Property("Points") + .HasColumnType("int"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("RegistrationDate") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("SocialClubName") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("Wage") + .HasColumnType("int"); + + b.Property("Wanteds") + .HasColumnType("int"); + + b.Property("WeaponLicense") + .HasColumnType("tinyint(1)"); + + b.Property("failpoints") + .HasColumnType("int"); + + b.Property("otheramount") + .HasColumnType("int"); + + b.Property("trashcount") + .HasColumnType("int"); + + b.Property("warn") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BanId"); + + b.HasIndex("BankAccountId"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.HasIndex("CharacterId"); + + b.HasIndex("FactionId"); + + b.HasIndex("FactionRankId"); + + b.HasIndex("GroupId"); + + b.HasIndex("HouseId"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("Bic") + .HasColumnType("varchar(12) CHARACTER SET utf8mb4") + .HasMaxLength(12); + + b.Property("Iban") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.ToTable("UserBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Amount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("int"); + + b.Property("Slot") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserItems"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ammo") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.Property("WeaponId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("WeaponId"); + + b.ToTable("UserWeapons"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Amount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("int"); + + b.Property("Slot") + .HasColumnType("int"); + + b.Property("VehicleId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("VehicleId"); + + b.ToTable("VehicleItems"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleMod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ModId") + .HasColumnType("int"); + + b.Property("ServerVehicleId") + .HasColumnType("int"); + + b.Property("Slot") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ServerVehicleId", "Slot") + .IsUnique(); + + b.ToTable("VehicleMods"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Weapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ammo") + .HasColumnType("int"); + + b.Property("AmmunationActive") + .HasColumnType("tinyint(1)"); + + b.Property("CategoryId") + .HasColumnType("int"); + + b.Property("Legal") + .HasColumnType("tinyint(1)"); + + b.Property("Price") + .HasColumnType("float"); + + b.Property("SlotID") + .HasColumnType("int"); + + b.Property("WeaponModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("Weapons"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.WeaponCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("WeaponCategories"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Whitelist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("SocialClubName") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("WhitelistEntries"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("BuyPrice") + .HasColumnType("int"); + + b.Property("Owners") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.ToTable("FactionVehicles"); + + b.HasDiscriminator().HasValue("FactionVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.HasIndex("GroupId"); + + b.HasDiscriminator().HasValue("GroupVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.JobVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("JobId") + .HasColumnType("int"); + + b.HasDiscriminator().HasValue("JobVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.NoobSpawnVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("NoobSpawnVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.NoobVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("NoobVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("SavedVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.SchoolVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("SchoolId") + .HasColumnType("int"); + + b.HasDiscriminator().HasValue("SchoolVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ShopVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.ToTable("ShopVehicles"); + + b.HasDiscriminator().HasValue("ShopVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("Price") + .HasColumnName("UserVehicle_Price") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasIndex("UserId"); + + b.ToTable("UserVehicles"); + + b.HasDiscriminator().HasValue("UserVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Ban", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusRoutePoint", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.BusRoute", "BusRoute") + .WithMany("RoutePoints") + .HasForeignKey("BusRouteId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Character", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.CharacterCloth", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Door", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.DutyCloth", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Faction", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.FactionBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionRank", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionWeapon", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Group", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.GroupBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.House", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.HouseBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + + b.HasOne("ReallifeGamemode.Database.Entities.User", "Owner") + .WithMany() + .HasForeignKey("OwnerId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.HouseRental", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.House", "House") + .WithMany("Rentals") + .HasForeignKey("HouseId"); + + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.Death", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "Killer") + .WithMany() + .HasForeignKey("KillerId"); + + b.HasOne("ReallifeGamemode.Database.Entities.User", "Victim") + .WithMany() + .HasForeignKey("VictimId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.News", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.User", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Ban", "Ban") + .WithMany() + .HasForeignKey("BanId"); + + b.HasOne("ReallifeGamemode.Database.Entities.UserBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + + b.HasOne("ReallifeGamemode.Database.Entities.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId"); + + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + + b.HasOne("ReallifeGamemode.Database.Entities.FactionRank", "FactionRank") + .WithMany() + .HasForeignKey("FactionRankId"); + + b.HasOne("ReallifeGamemode.Database.Entities.Group", "Group") + .WithMany() + .HasForeignKey("GroupId"); + + b.HasOne("ReallifeGamemode.Database.Entities.House", "House") + .WithMany() + .HasForeignKey("HouseId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserItem", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserWeapon", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ReallifeGamemode.Database.Entities.Weapon", "Weapon") + .WithMany() + .HasForeignKey("WeaponId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleItem", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.ServerVehicle", "Vehicle") + .WithMany() + .HasForeignKey("VehicleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleMod", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.ServerVehicle", "Vehicle") + .WithMany() + .HasForeignKey("ServerVehicleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Weapon", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.WeaponCategory", "WeaponCategory") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupVehicle", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Group", "Group") + .WithMany() + .HasForeignKey("GroupId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserVehicle", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ReallifeGamemode.Database/Migrations/20210416175726_Ammunations2.cs b/ReallifeGamemode.Database/Migrations/20210416175726_Ammunations2.cs new file mode 100644 index 00000000..2a99825d --- /dev/null +++ b/ReallifeGamemode.Database/Migrations/20210416175726_Ammunations2.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace ReallifeGamemode.Database.Migrations +{ + public partial class Ammunations2 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "AmmunationActive", + table: "Weapons", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "Legal", + table: "Weapons", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "AmmunationActive", + table: "Weapons"); + + migrationBuilder.DropColumn( + name: "Legal", + table: "Weapons"); + } + } +} diff --git a/ReallifeGamemode.Database/Migrations/DatabaseContextModelSnapshot.cs b/ReallifeGamemode.Database/Migrations/DatabaseContextModelSnapshot.cs index 1a9d86a2..d392d034 100644 --- a/ReallifeGamemode.Database/Migrations/DatabaseContextModelSnapshot.cs +++ b/ReallifeGamemode.Database/Migrations/DatabaseContextModelSnapshot.cs @@ -1519,6 +1519,30 @@ namespace ReallifeGamemode.Database.Migrations b.ToTable("UserItems"); }); + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ammo") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.Property("WeaponId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("WeaponId"); + + b.ToTable("UserWeapons"); + }); + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleItem", b => { b.Property("Id") @@ -1567,6 +1591,54 @@ namespace ReallifeGamemode.Database.Migrations b.ToTable("VehicleMods"); }); + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Weapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ammo") + .HasColumnType("int"); + + b.Property("AmmunationActive") + .HasColumnType("tinyint(1)"); + + b.Property("CategoryId") + .HasColumnType("int"); + + b.Property("Legal") + .HasColumnType("tinyint(1)"); + + b.Property("Price") + .HasColumnType("float"); + + b.Property("SlotID") + .HasColumnType("int"); + + b.Property("WeaponModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("Weapons"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.WeaponCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("WeaponCategories"); + }); + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Whitelist", b => { b.Property("Id") @@ -1844,6 +1916,21 @@ namespace ReallifeGamemode.Database.Migrations .IsRequired(); }); + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserWeapon", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ReallifeGamemode.Database.Entities.Weapon", "Weapon") + .WithMany() + .HasForeignKey("WeaponId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleItem", b => { b.HasOne("ReallifeGamemode.Database.Entities.ServerVehicle", "Vehicle") @@ -1862,6 +1949,15 @@ namespace ReallifeGamemode.Database.Migrations .IsRequired(); }); + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Weapon", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.WeaponCategory", "WeaponCategory") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupVehicle", b => { b.HasOne("ReallifeGamemode.Database.Entities.Group", "Group") diff --git a/ReallifeGamemode.Database/Models/DatabaseContext.cs b/ReallifeGamemode.Database/Models/DatabaseContext.cs index 63a65d63..890b0768 100644 --- a/ReallifeGamemode.Database/Models/DatabaseContext.cs +++ b/ReallifeGamemode.Database/Models/DatabaseContext.cs @@ -74,6 +74,8 @@ namespace ReallifeGamemode.Database.Models public DbSet UserVehicles { get; set; } public DbSet UserBankAccounts { get; set; } + public DbSet UserWeapons { get; set; } + //Inventar public DbSet UserItems { get; set; } @@ -85,8 +87,13 @@ namespace ReallifeGamemode.Database.Models public DbSet FactionVehicles { get; set; } //Shops + public DbSet ShopClothes { get; set; } + public DbSet ShopItems { get; set; } + public DbSet Weapons { get; set; } + public DbSet WeaponCategories { get; set; } //Logs + //public DbSet BanLogs { get; set; } public DbSet BankAccountTransactionLogs { get; set; } public DbSet DeathLogs { get; set; } @@ -155,12 +162,6 @@ namespace ReallifeGamemode.Database.Models //Gangwar public DbSet Turfs { get; set; } - //ClothesShop - public DbSet ShopClothes { get; set; } - - //ItemShop - public DbSet ShopItems { get; set; } - //Server Variablen public DbSet ServerVariables { get; set; } } diff --git a/ReallifeGamemode.Database/Windows PowerShell.lnk b/ReallifeGamemode.Database/Windows PowerShell.lnk index 14902e1b..07b77a2d 100644 Binary files a/ReallifeGamemode.Database/Windows PowerShell.lnk and b/ReallifeGamemode.Database/Windows PowerShell.lnk differ diff --git a/ReallifeGamemode.Database/sql b/ReallifeGamemode.Database/sql new file mode 100644 index 00000000..72d9528e --- /dev/null +++ b/ReallifeGamemode.Database/sql @@ -0,0 +1,43 @@ +CREATE TABLE `WeaponCategories` ( + `Id` int NOT NULL AUTO_INCREMENT, + `Category` longtext CHARACTER SET utf8mb4 NULL, + CONSTRAINT `PK_WeaponCategories` PRIMARY KEY (`Id`) +); + +CREATE TABLE `Weapons` ( + `Id` int NOT NULL AUTO_INCREMENT, + `WeaponModel` longtext CHARACTER SET utf8mb4 NULL, + `CategoryId` int NOT NULL, + `SlotID` int NOT NULL, + `Ammo` int NOT NULL, + `Price` float NOT NULL, + CONSTRAINT `PK_Weapons` PRIMARY KEY (`Id`), + CONSTRAINT `FK_Weapons_WeaponCategories_CategoryId` FOREIGN KEY (`CategoryId`) REFERENCES `WeaponCategories` (`Id`) ON DELETE CASCADE +); + +CREATE TABLE `UserWeapons` ( + `Id` int NOT NULL AUTO_INCREMENT, + `UserId` int NOT NULL, + `WeaponId` int NOT NULL, + `Ammo` int NOT NULL, + CONSTRAINT `PK_UserWeapons` PRIMARY KEY (`Id`), + CONSTRAINT `FK_UserWeapons_Users_UserId` FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE, + CONSTRAINT `FK_UserWeapons_Weapons_WeaponId` FOREIGN KEY (`WeaponId`) REFERENCES `Weapons` (`Id`) ON DELETE CASCADE +); + +CREATE INDEX `IX_UserWeapons_UserId` ON `UserWeapons` (`UserId`); + +CREATE INDEX `IX_UserWeapons_WeaponId` ON `UserWeapons` (`WeaponId`); + +CREATE INDEX `IX_Weapons_CategoryId` ON `Weapons` (`CategoryId`); + +INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`) +VALUES ('20210413201146_Ammunations', '3.1.3'); + +ALTER TABLE `Weapons` ADD `AmmunationActive` tinyint(1) NOT NULL DEFAULT FALSE; + +ALTER TABLE `Weapons` ADD `Legal` tinyint(1) NOT NULL DEFAULT FALSE; + +INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`) +VALUES ('20210416175726_Ammunations2', '3.1.3'); + diff --git a/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs b/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs index 65aa993f..f4e9c3ef 100644 --- a/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs +++ b/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs @@ -61,9 +61,9 @@ namespace ReallifeGamemode.Server.Core.Menus private void CreateVisuals() { - Position pos = new Position(440.869, -981.045, 30.689); + Position pos = new Position(12.7499, -1105.1168, 29.797); - Api.TextLabel.CreateTextLabel("Polizeirevier\n\nDrücke ~y~E~s~, um das Menü zu öffnen", pos, 20f, 1.3f, Font.ChaletLondon, Color.White); + Api.TextLabel.CreateTextLabel("Waffenschein kaufen\n\nDrücke ~y~E~s~, um das Menü zu öffnen", pos, 20f, 1.3f, Font.ChaletLondon, Color.White); Api.Marker.CreateMarker(MarkerType.VerticalCylinder, pos.Subtract(new Position(0, 0, 1.7)), new Position(), new Position(), 1f, Color.White); IColShape colShape = Api.ColShape.CreateSphere(pos, 2f); diff --git a/ReallifeGamemode.Server/Business/BikeDealerBusiness.cs b/ReallifeGamemode.Server/Business/BikeDealerBusiness.cs index 48fff290..e1757a1d 100644 --- a/ReallifeGamemode.Server/Business/BikeDealerBusiness.cs +++ b/ReallifeGamemode.Server/Business/BikeDealerBusiness.cs @@ -6,7 +6,7 @@ namespace ReallifeGamemode.Server.Business { public override int Id => 8; - public override string Name => "Motorrad Shop"; + public override string Name => "Bike Shop"; public override Vector3 Position => new Vector3(1180.997, -394.9542, 68.01635); diff --git a/ReallifeGamemode.Server/Business/ClassicAndLuxuryCarshop.cs b/ReallifeGamemode.Server/Business/ClassicAndLuxuryCarshop.cs new file mode 100644 index 00000000..7ddd03ca --- /dev/null +++ b/ReallifeGamemode.Server/Business/ClassicAndLuxuryCarshop.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using GTANetworkAPI; + +namespace ReallifeGamemode.Server.Business +{ + class ClassicAndLuxuryCarshop : CarDealerBusinessBase + { + public override int Id => 13; + + public override string Name => "Classic & Luxury Carshop"; + + public override Vector3 Position => new Vector3(-1274.3439, 315.1384, 65.51176); + + public override Vector3 CarSpawnPositon => new Vector3(-1351.2072, 244.88942, 60.357693); + + public override float CarSpawnHeading => 3.62f; + + public override void Load() + { + + } + } +} diff --git a/ReallifeGamemode.Server/Business/OldschoolCarshop.cs b/ReallifeGamemode.Server/Business/OldschoolCarshop.cs new file mode 100644 index 00000000..d469c9c8 --- /dev/null +++ b/ReallifeGamemode.Server/Business/OldschoolCarshop.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using GTANetworkAPI; + +namespace ReallifeGamemode.Server.Business +{ + class OldschoolCarshop : CarDealerBusinessBase + { + public override int Id => 14; + + public override string Name => "Oldschool Carshop"; + + public override Vector3 Position => new Vector3(-1888.1119, 2049.722, 140.9831); + + public override Vector3 CarSpawnPositon => new Vector3(-1883.5817, 2029.6252, 140.55038); + + public override float CarSpawnHeading => 163.73f; + + public override void Load() + { + + } + } +} diff --git a/ReallifeGamemode.Server/Business/VapidCarDealerBusiness.cs b/ReallifeGamemode.Server/Business/VapidCarDealerBusiness.cs index 923aa527..4e0edfb0 100644 --- a/ReallifeGamemode.Server/Business/VapidCarDealerBusiness.cs +++ b/ReallifeGamemode.Server/Business/VapidCarDealerBusiness.cs @@ -6,7 +6,7 @@ namespace ReallifeGamemode.Server.Business { public override int Id => 3; - public override string Name => "Vapid Autohaus"; + public override string Name => "Vapid Carshop"; public override Vector3 Position => new Vector3(-177, -1156, 23); diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 8fcad633..60ba7593 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1402,6 +1402,13 @@ namespace ReallifeGamemode.Server.Commands } target.TriggerEvent("onPlayerRevived"); target.SendNotification("Du wurdest von Admin ~y~" + player.Name + "~s~ wiederbelebt."); + + MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == player.Name); + if (task != null) + { + ChatService.BroadcastFaction("~y~[MEDIC] ~w~Der Auftrag von " + target.Name + " wurde entfernt (Administrativ wiederbelebt)", new List() { 2 }); + } + target.SetData("isDead", false); using (var dbContext = new DatabaseContext()) { @@ -1686,6 +1693,32 @@ namespace ReallifeGamemode.Server.Commands NAPI.Vehicle.SetVehicleTyreSmokeColor(veh, new Color(r, g, b)); } + [Command("spectate", "~m~Benutzung: ~s~/spectate [NAME/ID]", Alias = "spec")] + public void CmdAdminSpectate(Player player, string targetname = null) + { + if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) + { + ChatService.NotAuthorized(player); + return; + } + Player target; + if (targetname != null) + { + target = PlayerService.GetPlayerByNameOrId(targetname); + if (target == null || !target.IsLoggedIn()) + { + ChatService.PlayerNotFound(player); + return; + } + player.TriggerEvent("SERVER:ADMIN_SPECTATE", target); + } + else + { + player.TriggerEvent("SERVER:ADMIN_STOP_SPECTATE"); + } + } + + #endregion Admin #region ALevel1337 @@ -1976,7 +2009,7 @@ namespace ReallifeGamemode.Server.Commands foreach (var managedPlayer in peopleInRange) { - if (!managedPlayer.IsLoggedIn() || managedPlayer.GetData("isDead")) return; + if (!managedPlayer.IsLoggedIn() || managedPlayer.GetData("isDead")) continue; managedPlayer.SafeSetHealth(hp); ChatService.SendMessage(managedPlayer, "~b~Admin " + player.Name + " hat im Radius von " + radius + " die HP auf " + hp + " gesetzt."); } @@ -2059,6 +2092,7 @@ namespace ReallifeGamemode.Server.Commands return; } + [Command("showtuningmenu", "~m~Benutzung: ~s~/showtuningmenu", Alias = "stm")] public void CmdAdminShowtuningmenu(Player player) { diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index 9dc24c1e..2383b2fe 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -356,15 +356,15 @@ namespace ReallifeGamemode.Server.Commands public void CmdFactionMedicHealive(Player player, string receiver, int price = 10) { Player target = PlayerService.GetPlayerByNameOrId(receiver); - if (player.GetUser()?.FactionId != 2) + if(target == null || !target.IsLoggedIn()) { - ChatService.NotAuthorized(player); + ChatService.PlayerNotFound(player); return; } - if (player.Position.DistanceTo(target.Position) > 5) + if (player.GetUser()?.FactionId != 2) { - ChatService.ErrorMessage(player, "Der Patient ist zu weit entfernt"); + ChatService.NotAuthorized(player); return; } @@ -391,6 +391,12 @@ namespace ReallifeGamemode.Server.Commands return; } + if (player.Position.DistanceTo(target.Position) > 5) + { + ChatService.ErrorMessage(player, "Der Patient ist zu weit entfernt"); + return; + } + if (target.Health == 100) { ChatService.ErrorMessage(player, "Der Spieler ist bereits voll geheilt"); @@ -408,6 +414,31 @@ namespace ReallifeGamemode.Server.Commands #region Staatsfraktionen (LSPD / FBI) Commands + [Command("m", "~m~Benutzung: ~s~/m [Message]", GreedyArg = true)] + public void CmdFactionMegaphone(Player player, string message) + { + User user = player.GetUser(); + if (user == null || (user.FactionId != 1 && user.FactionId != 3)) + { + ChatService.NotAuthorized(player); + return; + } + + if (!player.IsDuty()) + { + ChatService.ErrorMessage(player, "Du bist nicht im Dienst"); + return; + } + + if (!player.IsInVehicle) + { + ChatService.ErrorMessage(player, "Du bist nicht in einem Fahrzeug"); + return; + } + + ChatService.SendInRange(player.Position, 50, "!{#FFFF00}[" + player.GetUser().Faction.Name + " " + player.Name + ": !{#FFFF00}" + message + "]"); + } + [Command("cuff", "~m~Benutzung: ~s~/cuff")] public void CmdFactionCuff(Player player) { diff --git a/ReallifeGamemode.Server/Commands/UserCommands.cs b/ReallifeGamemode.Server/Commands/UserCommands.cs index 3c2bf091..15d159a7 100644 --- a/ReallifeGamemode.Server/Commands/UserCommands.cs +++ b/ReallifeGamemode.Server/Commands/UserCommands.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using GTANetworkAPI; +using Newtonsoft.Json; using ReallifeGamemode.Database.Entities; using ReallifeGamemode.Database.Models; using ReallifeGamemode.Server.Extensions; @@ -16,6 +17,42 @@ namespace ReallifeGamemode.Server.Commands { internal class UserCommands : Script { + [Command("look", "~m~look")] + public void CmdUserLook(Player player) + { + if (!player.IsLoggedIn()) return; + + Vehicle veh = NAPI.Pools.GetAllVehicles() + .Where(v => v.Position.DistanceTo(player.Position) <= 5) + .OrderBy(v => v.Position.DistanceTo(player.Position)) + .FirstOrDefault(); + + if (veh == null) + { + return; + } + + var lastDriverDic = new Dictionary(); + + if(VehicleManager.lastDriversInVehicle.ContainsKey(veh)) + { + lastDriverDic = VehicleManager.lastDriversInVehicle[veh]; + } + else + { + player.SendNotification("~r~Mit diesem Fahrzeug ist noch niemand gefahren"); + return; + } + + var list = lastDriverDic.Select(v => new + { + Name = v.Key, + Time = v.Value + }).OrderByDescending(v => v.Time).ToList(); + + player.TriggerEvent("lookLastDrivers", JsonConvert.SerializeObject(list)); + } + [Command("id", "~m~Benutzung: ~s~/id [Name]")] public void CmdUserId(Player player, String targetname) { @@ -61,7 +98,7 @@ namespace ReallifeGamemode.Server.Commands } else { - pVeh = NAPI.Pools.GetAllVehicles().Where(v => v.Position.DistanceTo(player.Position) <= 5).FirstOrDefault(); + pVeh = NAPI.Pools.GetAllVehicles().Where(v => v.Position.DistanceTo(player.Position) <= 5).OrderBy(v => v.Position.DistanceTo(player.Position)).FirstOrDefault(); } if (pVeh == null) diff --git a/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs b/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs index 9163cc08..fe51c527 100644 --- a/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs +++ b/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs @@ -98,8 +98,18 @@ namespace ReallifeGamemode.Server.DrivingSchool private static void EntityEnterBusinessColShape(ColShape colShape, Player client) { + var user = client.GetUser(); if (client.IsInVehicle || !client.IsLoggedIn()) return; - + if (user.GetData("duty")) + { + client.SendNotification("~r~Im Dienst kannst du keinen Führerschein machen", false); + return; + } + if (user.Wanteds > 0) + { + client.SendNotification("~r~Mit Wanteds kannst du keinen Führerschein machen", false); + return; + } client.TriggerEvent("drivingSchoolMenu"); } @@ -112,11 +122,13 @@ namespace ReallifeGamemode.Server.DrivingSchool public void StartDrivingSchool(Player client) { User user = client.GetUser(); + if (user.DriverLicenseVehicle || client.HasData("ActiveSchool")) { client.SendChatMessage("~b~[INFO]~s~ Du besitzt schon einen Führerschein."); return; } + if (user.Handmoney < 2500) { client.SendNotification("~r~[FEHLER]~s~ Du hast nicht genug Geld auf der Hand($2.500)!", true); diff --git a/ReallifeGamemode.Server/Events/Chat.cs b/ReallifeGamemode.Server/Events/Chat.cs index e20a7499..47f1e8fa 100644 --- a/ReallifeGamemode.Server/Events/Chat.cs +++ b/ReallifeGamemode.Server/Events/Chat.cs @@ -11,7 +11,7 @@ namespace ReallifeGamemode.Server.Events { string serverMsg = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", ""); if (serverMsg.Trim().Length == 0) return; - NAPI.Player.GetPlayersInRadiusOfPlayer(10, player).ForEach(p => + NAPI.Player.GetPlayersInRadiusOfPlayer(25, player).ForEach(p => { ChatService.SendMessage(p, $"{player.Name} sagt: {serverMsg}"); }); diff --git a/ReallifeGamemode.Server/Events/Death.cs b/ReallifeGamemode.Server/Events/Death.cs index c810c4ff..e935582b 100644 --- a/ReallifeGamemode.Server/Events/Death.cs +++ b/ReallifeGamemode.Server/Events/Death.cs @@ -25,9 +25,19 @@ namespace ReallifeGamemode.Server.Events { public class Death : Script { + private readonly Dictionary lastPlayerDeathTime = new Dictionary(); + + [ServerEvent(Event.PlayerDeath)] public void OnPlayerDeath(Player player, Player killer, uint reason) { + if (lastPlayerDeathTime.TryGetValue(player, out DateTime lastDeathTime) && DateTime.Now - lastDeathTime < TimeSpan.FromSeconds(5)) + { + return; + } + + lastPlayerDeathTime[player] = DateTime.Now; + if (!player.IsLoggedIn()) { player.Kick(); @@ -51,18 +61,28 @@ namespace ReallifeGamemode.Server.Events float killerPosZ = -1; float killerHeading = -1; + NAPI.Util.ConsoleOutput($"OnPlayerDeath - Player {player.Name} died - Killer = {(killer != null ? killer.Name : "no killer found")}"); + if (killer.IsLoggedIn()) { + NAPI.Util.ConsoleOutput($"OnPlayerDeath - Player {player.Name} died - Killer is logged in"); + var killerUser = killer.GetUser(dbContext); if (killerUser != null) { + NAPI.Util.ConsoleOutput($"OnPlayerDeath - Player {player.Name} died - Killer GetUser is not null"); killerId = killerUser.Id; killerPosX = killer.Position.X; killerPosY = killer.Position.Y; killerPosZ = killer.Position.Z; killerHeading = killer.Heading; - if (player.HasData("inGangWar") && killer.HasData("inGangWar")) + + var playerInGangwar = player.HasData("inGangWar"); + var killerInGangwar = killer.HasData("inGangWar"); + NAPI.Util.ConsoleOutput($"OnPlayerDeath - Player {player.Name} died - PlayerInGangwar = {playerInGangwar}, KillerInGangwar = {killerInGangwar}"); + if (playerInGangwar && killerInGangwar) { + NAPI.Util.ConsoleOutput($"OnPlayerDeath - Player {player.Name} died - Both players in gangwar, setting kill"); Gangwar.Gangwar.GangwarKill(killer, player); } @@ -78,6 +98,22 @@ namespace ReallifeGamemode.Server.Events } } + var dead = new Database.Entities.Logs.Death + { + VictimId = player.GetUser().Id, + KillerId = killerId, + KillerPositionX = killerPosX, + KillerPositionY = killerPosY, + KillerPositionZ = killerPosZ, + KillerHeading = killerHeading, + VictimPositionX = player.Position.X, + VictimPositionY = player.Position.Y, + VictimPositionZ = player.Position.Z, + VictimHeading = player.Heading, + CauseOfDeath = reason.ToString() + }; + dbContext.DeathLogs.Add(dead); + bool copNearby = NAPI.Pools.GetAllPlayers().Any(u => u.IsDuty() && u.IsAlive() && u.Position.DistanceToSquared(player.Position) <= 200 * 200); if (user.Wanteds > 0) @@ -94,11 +130,13 @@ namespace ReallifeGamemode.Server.Events } } + Medic.delHealTask(player); + if (user.JailTime <= 0) { user.Dead = true; - if (!player.HasData("reviveSperre") && player.GetData("isDead") == false && !player.HasData("inGangWar") && player.GetData("SAdminduty") == false) + if (!player.HasData("reviveSperre") && player.GetData("isDead") == false && !player.HasData("inGangWar") && player.GetData("SAdminduty") == false) { //MEDIC AUFTRAG MedicTask reviveTask = new MedicTask() @@ -113,11 +151,10 @@ namespace ReallifeGamemode.Server.Events MedicName = "none" }; Medic.AddTaskToList(reviveTask); - Medic.delHealTask(player); ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " ist soeben verstorben.", new List() { 2 }); } - player.SetData("isDead", true); + player.SetData("isDead", true); if (player.GetUser().IsAdmin(AdminLevel.ADMIN) == true) { @@ -152,24 +189,10 @@ namespace ReallifeGamemode.Server.Events TextLabel grndTxtLbl = NAPI.TextLabel.CreateTextLabel(iItem.Name + " ~s~(~y~" + amount + "~s~)", textPos, 5, 0.5f, 4, new Color(255, 255, 255), false, 0); GroundItem.AddGroundItem(grndItem, grndObject, grndTxtLbl); + player.ClearAnimation(); + dbContext.Remove(item); } - - var dead = new Database.Entities.Logs.Death - { - VictimId = player.GetUser().Id, - KillerId = killerId, - KillerPositionX = killerPosX, - KillerPositionY = killerPosY, - KillerPositionZ = killerPosZ, - KillerHeading = killerHeading, - VictimPositionX = player.Position.X, - VictimPositionY = player.Position.Y, - VictimPositionZ = player.Position.Z, - VictimHeading = player.Heading, - CauseOfDeath = reason.ToString() - }; - dbContext.DeathLogs.Add(dead); } } Job.JobBase job = Managers.JobManager.GetJob(player.GetUser().JobId ?? -1); @@ -239,7 +262,7 @@ namespace ReallifeGamemode.Server.Events player.RemoveAllWeapons(); MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == player.Name); - if(task != null) + if (task != null) { Player medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName); Medic.RemoveTaskFromList(task); diff --git a/ReallifeGamemode.Server/Events/Disconnect.cs b/ReallifeGamemode.Server/Events/Disconnect.cs index ef442350..14d74fb3 100644 --- a/ReallifeGamemode.Server/Events/Disconnect.cs +++ b/ReallifeGamemode.Server/Events/Disconnect.cs @@ -62,6 +62,19 @@ namespace ReallifeGamemode.Server.Events { ChatService.BroadcastAdmin("!{#FFFF00}*** " + player.Name + " hat den Server verlassen", AdminLevel.MAPPING); } + + MedicTask task = Medic.ReviveTasks.FirstOrDefault(t => t.Victim == player.Name); + + if (task != null) + { + ChatService.BroadcastFaction("~y~[MEDIC] ~w~Info: Der Auftrag von " + player.Name + " wurde entfernt (Ausgeloggt)", new List() { 2 }); + } + + if (player.IsAdminDuty()) + { + ChatService.Broadcast("!{#ee4d2e}[SUPPORT] " + player.Name + " hat sich vom Support abgemeldet (Ausgeloggt)"); + } + /* TaxiDriverJob taxiJob = JobManager.GetJob(); TaxiContract taxiContract = taxiJob.TaxiContracts.Where(t => t.Name == player.Name).FirstOrDefault(); diff --git a/ReallifeGamemode.Server/Events/EnterVehicle.cs b/ReallifeGamemode.Server/Events/EnterVehicle.cs index e6bce887..0ac95d38 100644 --- a/ReallifeGamemode.Server/Events/EnterVehicle.cs +++ b/ReallifeGamemode.Server/Events/EnterVehicle.cs @@ -1,7 +1,9 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using GTANetworkAPI; using ReallifeGamemode.Database.Entities; using ReallifeGamemode.Server.Extensions; +using ReallifeGamemode.Server.Managers; using ReallifeGamemode.Server.Util; using ReallifeGamemode.Server.WeaponDeal; @@ -20,6 +22,13 @@ namespace ReallifeGamemode.Server.Events if (vehicle.HasMarkerBehind()) vehicle.RemoveMarkerBehind(); + if (!VehicleManager.lastDriversInVehicle.ContainsKey(vehicle)) + { + VehicleManager.lastDriversInVehicle.Add(vehicle, new Dictionary()); + } + + VehicleManager.lastDriversInVehicle[vehicle][client.Name] = DateTime.Now; + if (vehicle.GetServerVehicle() is FactionVehicle veh) { User u = client.GetUser(); diff --git a/ReallifeGamemode.Server/Events/EnterVehicleAttempt.cs b/ReallifeGamemode.Server/Events/EnterVehicleAttempt.cs index b63b7661..7573fb6a 100644 --- a/ReallifeGamemode.Server/Events/EnterVehicleAttempt.cs +++ b/ReallifeGamemode.Server/Events/EnterVehicleAttempt.cs @@ -9,6 +9,7 @@ using ReallifeGamemode.Server.Types; using ReallifeGamemode.Server.Util; using ReallifeGamemode.Server.WeaponDeal; using ReallifeGamemode.Server.Managers; +using ReallifeGamemode.Server.Job; namespace ReallifeGamemode.Server.Events { @@ -28,7 +29,7 @@ namespace ReallifeGamemode.Server.Events if (vehicle.GetServerVehicle() is FactionVehicle veh) { - if (!veh.GetOwners().Contains(player.GetUser().FactionId ?? 0) && !(u.IsAdmin(AdminLevel.HEADADMIN) && player.IsAdminDuty())) + if (!veh.GetOwners().Contains(player.GetUser().FactionId ?? 0) && !(u.IsAdmin(AdminLevel.HEADADMIN) && player.IsAdminDuty()) && !JobBase.GetPlayerInJob().Contains(player)) { if ((VehicleHash)vehicle.Model == VehicleHash.Burrito3) { diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 84f8acc2..d0372911 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -168,6 +168,7 @@ namespace ReallifeGamemode.Server.Events busskill = u.BusSkill, pilotskill = u.PilotSkill, wage = u.Wage, + isActive = JobBase.GetPlayerInJob().Contains(player), }; var memberList = dbContext.Users.Where(f => f.FactionId == u.FactionId && u.FactionId != 0).OrderByDescending(f => f.FactionRank.Order).ThenBy(f => f.Name).Select(m => new @@ -230,11 +231,12 @@ namespace ReallifeGamemode.Server.Events 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")); ElevatorPoint nearestElevatorPoint = PositionManager.ElevatorPoints.Find(e => e.Position.DistanceTo(player.Position) <= 1.5 && (user.FactionId == 1 || user.FactionId == 2 || user.FactionId == 3)); - ClotheshopPoint nearestClotheShopPoint = PositionManager.clotheshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData("duty"))); - FriseurPoint nearestFriseurPoint = PositionManager.friseurPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5 && (!user.GetData("duty"))); + ClotheshopPoint nearestClotheShopPoint = PositionManager.clotheshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5); + FriseurPoint nearestFriseurPoint = PositionManager.friseurPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5); ItemshopPoint nearestItemShopPoint = PositionManager.itemshopPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5); JobPoint nearestJobPoint = PositionManager.JobPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6); Player nearestCuffPlayer = PositionManager.cuffPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.6 && user.GetData("duty")); + AmmunationPoint nearestAmmunationPoint = PositionManager.AmmunationPoints.Find(s => s.Position.DistanceTo(player.Position) <= 1.5); if (user?.FactionId != null) { @@ -506,6 +508,16 @@ namespace ReallifeGamemode.Server.Events } if (nearestClotheShopPoint != null) { + if (user.GetData("duty")) + { + player.SendNotification("~r~Im Dienst kannst du keine Kleidung kaufen", false); + return; + } + if(JobBase.GetPlayerInJob().Contains(player)) + { + player.SendNotification("~r~Im aktiven Job kannst du keine Kleidung kaufen", false); + return; + } nearestClotheShopPoint.clotheShop.LoadShopNUI(player); } if (nearestItemShopPoint != null) @@ -514,8 +526,29 @@ namespace ReallifeGamemode.Server.Events } if (nearestFriseurPoint != null) { + if (user.GetData("duty")) + { + player.SendNotification("~r~Im Dienst wirst du nicht vom Friseur bedient", false); + return; + } + if (JobBase.GetPlayerInJob().Contains(player)) + { + player.SendNotification("~r~Im aktiven Job wirst du nicht vom Friseur bedient", false); + return; + } nearestFriseurPoint.friseurShop.LoadShopNUI(player); } + if (nearestAmmunationPoint != null) + { + if (!user.WeaponLicense) + { + player.SendNotification("~r~Du besitzt keinen Waffenschein"); + } + else + { + nearestAmmunationPoint.Ammunation.LoadShopNUI(player); + } + } if (user.FactionLeader) { player.TriggerEvent("CLIENT:StartGangwar"); @@ -535,6 +568,16 @@ namespace ReallifeGamemode.Server.Events } if (!job.GetUsersInJob().Contains(player)) { + if (user.GetData("duty")) + { + player.SendNotification("~r~Im Dienst kannst du keinen Job ausführen", false); + return; + } + if (user.Wanteds > 0) + { + player.SendNotification("~r~Mit Wanteds kannst du keinen Job starten", false); + return; + } if (player.GetUser().JobId == 3) { if (nearestJobPoint.Skill > user.PilotSkill) diff --git a/ReallifeGamemode.Server/Events/PlayerEvent.cs b/ReallifeGamemode.Server/Events/PlayerEvent.cs index ad8b51fc..886d25fe 100644 --- a/ReallifeGamemode.Server/Events/PlayerEvent.cs +++ b/ReallifeGamemode.Server/Events/PlayerEvent.cs @@ -17,7 +17,7 @@ namespace ReallifeGamemode.Server.Events [RemoteEvent("CLIENT:SetAfkStatus")] public void SetPlayerAfkStatus(Player player, bool status) { - player.SetServerData("isAfk", status); + player.SetSharedData("isAfk", status); if(status) { player.SendNotification("Du wurdest ~b~AFK~s~ gesetzt", true); diff --git a/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs b/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs index 00de3e94..ea213d7b 100644 --- a/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs +++ b/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs @@ -118,5 +118,24 @@ namespace ReallifeGamemode.Server.Events context.SaveChanges(); } } + + [RemoteEvent("CLIENT:Ammunation_BuyWeapon")] + public void AmmunationBuyWeapoon(Player player, string weaponmodel, int ammo, int price) + { + using (var dbContext = new DatabaseContext()) + { + User user = player.GetUser(dbContext); + + if (user.Handmoney < price) + { + player.SendNotification("Du hast nicht genügend Geld bei dir"); + return; + } + user.Handmoney -= price; + dbContext.SaveChanges(); + player.GiveWeapon(NAPI.Util.WeaponNameToModel(weaponmodel), ammo); + //client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney); + } + } } } diff --git a/ReallifeGamemode.Server/Extensions/ClientExtension.cs b/ReallifeGamemode.Server/Extensions/ClientExtension.cs index 9bba8fc6..7058cbae 100644 --- a/ReallifeGamemode.Server/Extensions/ClientExtension.cs +++ b/ReallifeGamemode.Server/Extensions/ClientExtension.cs @@ -138,7 +138,12 @@ namespace ReallifeGamemode.Server.Extensions public static bool IsAfk(this Player player) { - return player.GetServerData("isAfk", false); + if(!player.HasSharedData("isAfk")) + { + return false; + } + + return player.GetSharedData("isAfk"); } public static bool IsAlive(this Player player) @@ -438,6 +443,7 @@ namespace ReallifeGamemode.Server.Extensions return; player.SyncAnimation("hup"); + NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed); if (player.GetUser().Wanteds > 0) PositionManager.cuffPoints.Add(player); diff --git a/ReallifeGamemode.Server/Extensions/VehicleExtension.cs b/ReallifeGamemode.Server/Extensions/VehicleExtension.cs index f7493d9e..06af94bf 100644 --- a/ReallifeGamemode.Server/Extensions/VehicleExtension.cs +++ b/ReallifeGamemode.Server/Extensions/VehicleExtension.cs @@ -36,24 +36,23 @@ namespace ReallifeGamemode.Server.Extensions return 210 * 1000; case 4: - if ((VehicleHash)vehicle.HashCode == VehicleHash.Moonbeam - || (VehicleHash)vehicle.HashCode == VehicleHash.Moonbeam2 - || (VehicleHash)vehicle.HashCode == VehicleHash.Ratloader - || (VehicleHash)vehicle.HashCode == VehicleHash.Ratloader2 - || (VehicleHash)vehicle.HashCode == VehicleHash.Slamvan - || (VehicleHash)vehicle.HashCode == VehicleHash.Slamvan2 - || (VehicleHash)vehicle.HashCode == VehicleHash.Slamvan3 - || (VehicleHash)vehicle.HashCode == VehicleHash.Yosemite - || (VehicleHash)vehicle.HashCode == VehicleHash.Yosemite2 - || (VehicleHash)vehicle.HashCode == VehicleHash.Picador - || (VehicleHash)vehicle.HashCode == VehicleHash.Moonbeam) + if ((VehicleHash)vehicle.Model == VehicleHash.Moonbeam + || (VehicleHash)vehicle.Model == VehicleHash.Moonbeam2 + || (VehicleHash)vehicle.Model == VehicleHash.Ratloader + || (VehicleHash)vehicle.Model == VehicleHash.Ratloader2 + || (VehicleHash)vehicle.Model == VehicleHash.Slamvan + || (VehicleHash)vehicle.Model == VehicleHash.Slamvan2 + || (VehicleHash)vehicle.Model == VehicleHash.Slamvan3 + || (VehicleHash)vehicle.Model == VehicleHash.Yosemite + || (VehicleHash)vehicle.Model == VehicleHash.Yosemite2 + || (VehicleHash)vehicle.Model == VehicleHash.Picador) return 250 * 1000; else return 180 * 1000; case 5: - if ((VehicleHash)vehicle.HashCode == VehicleHash.Fagaloa - || (VehicleHash)vehicle.HashCode == VehicleHash.Cheburek) + if ((VehicleHash)vehicle.Model == VehicleHash.Fagaloa + || (VehicleHash)vehicle.Model == VehicleHash.Cheburek) return 200 * 1000; else return 110 * 1000; @@ -68,12 +67,12 @@ namespace ReallifeGamemode.Server.Extensions return 5 * 1000; case 9: - if ((VehicleHash)vehicle.HashCode == VehicleHash.Bifta - || (VehicleHash)vehicle.HashCode == VehicleHash.Blazer - || (VehicleHash)vehicle.HashCode == VehicleHash.Blazer2 - || (VehicleHash)vehicle.HashCode == VehicleHash.Blazer3 - || (VehicleHash)vehicle.HashCode == VehicleHash.Blazer4 - || (VehicleHash)vehicle.HashCode == VehicleHash.Blazer5) + if ((VehicleHash)vehicle.Model == VehicleHash.Bifta + || (VehicleHash)vehicle.Model == VehicleHash.Blazer + || (VehicleHash)vehicle.Model == VehicleHash.Blazer2 + || (VehicleHash)vehicle.Model == VehicleHash.Blazer3 + || (VehicleHash)vehicle.Model == VehicleHash.Blazer4 + || (VehicleHash)vehicle.Model == VehicleHash.Blazer5) return 30 * 1000; else return 300 * 1000; @@ -85,9 +84,9 @@ namespace ReallifeGamemode.Server.Extensions return 0; case 12: - if ((VehicleHash)vehicle.HashCode == VehicleHash.Minivan - || (VehicleHash)vehicle.HashCode == VehicleHash.Minivan2 - || (VehicleHash)vehicle.HashCode == VehicleHash.Bobcatxl) + if ((VehicleHash)vehicle.Model == VehicleHash.Minivan + || (VehicleHash)vehicle.Model == VehicleHash.Minivan2 + || (VehicleHash)vehicle.Model == VehicleHash.Bobcatxl) return 600 * 1000; else return 1000 * 1000; @@ -108,13 +107,13 @@ namespace ReallifeGamemode.Server.Extensions return 0; case 18: - if ((VehicleHash)vehicle.HashCode == VehicleHash.Policet) + if ((VehicleHash)vehicle.Model == VehicleHash.Policet) return 1000 * 1000; - else if ((VehicleHash)vehicle.HashCode == VehicleHash.Firetruk - || (VehicleHash)vehicle.HashCode == VehicleHash.Pbus - || (VehicleHash)vehicle.HashCode == VehicleHash.Policeb - || (VehicleHash)vehicle.HashCode == VehicleHash.Polmav - || (VehicleHash)vehicle.HashCode == VehicleHash.Predator) + else if ((VehicleHash)vehicle.Model == VehicleHash.Firetruk + || (VehicleHash)vehicle.Model == VehicleHash.Pbus + || (VehicleHash)vehicle.Model == VehicleHash.Policeb + || (VehicleHash)vehicle.Model == VehicleHash.Polmav + || (VehicleHash)vehicle.Model == VehicleHash.Predator) return 0; else return 150 * 1000; diff --git a/ReallifeGamemode.Server/Factions/Medic/Medic.cs b/ReallifeGamemode.Server/Factions/Medic/Medic.cs index 7bb2fd2d..f5c27650 100644 --- a/ReallifeGamemode.Server/Factions/Medic/Medic.cs +++ b/ReallifeGamemode.Server/Factions/Medic/Medic.cs @@ -263,7 +263,7 @@ namespace ReallifeGamemode.Server.Factions.Medic { player.SetData("healauftrag", false); var medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName); - if (task.MedicName != "none") + if (medicPlayer != null) { medicPlayer.TriggerEvent("destroyMedicTaskCheckpoint"); } diff --git a/ReallifeGamemode.Server/Gangwar/Gangwar.cs b/ReallifeGamemode.Server/Gangwar/Gangwar.cs index b2a3b9b3..376d5e77 100644 --- a/ReallifeGamemode.Server/Gangwar/Gangwar.cs +++ b/ReallifeGamemode.Server/Gangwar/Gangwar.cs @@ -49,13 +49,22 @@ namespace ReallifeGamemode.Server.Gangwar public static void GangwarKill(Player killer, Player victim) { - if (killer.HasData("GotInsideOfTurf") && victim.HasData("GotInsideOfTurf")) + var killerInsideTurf = killer.HasData("GotInsideOfTurf"); + var victimInsideTurf = victim.HasData("GotInsideOfTurf"); + + NAPI.Util.ConsoleOutput($"GangwarKill - Victim {victim.Name} - KillerInsideTurf = {killerInsideTurf}, VictimInsideTurf = {victimInsideTurf}"); + + if (killerInsideTurf && victimInsideTurf) { + NAPI.Util.ConsoleOutput($"GangwarKill - Victim {victim.Name} - Killer and Victim are in Turf area"); foreach (var turf in getTurfs()) { if (turf.getId() == victim.GetData("inGangWar")) { - turf.setKill(victim.GetUser().Faction.Name); + NAPI.Util.ConsoleOutput($"GangwarKill - Victim {victim.Name} - Killed in turf id {turf.getId()}"); + var victimFactionName = victim.GetUser().Faction.Name; + NAPI.Util.ConsoleOutput($"GangwarKill - Victim {victim.Name} - Faction Name = {victimFactionName}"); + turf.setKill(victimFactionName); return; } } diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index dfd08df8..809af885 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -203,11 +203,16 @@ namespace ReallifeGamemode.Server.Gangwar public void enter(Player client) { User user = client.GetUser(); + if(user == null || user.FactionId == null) + { + return; + } + if (this.status == "attack") { if (user.Faction.Name != getOwner() && user.Faction.Name != getAttacker()) return; - Player gPlayer = playerInGangwar.Where(c => c != null && !c.Handle.IsNull && c.IsLoggedIn() && c.GetUser()?.Id == user.Id).FirstOrDefault(); + Player gPlayer = playerInGangwar.Where(c => c != null && !c.Handle.IsNull && c.IsLoggedIn() && c.Handle.Value == client.Handle.Value).FirstOrDefault(); if (gPlayer == null) { using (var dbContext = new DatabaseContext()) @@ -366,10 +371,12 @@ namespace ReallifeGamemode.Server.Gangwar { if (getOwner() == FactionName) { + NAPI.Util.ConsoleOutput($"GangwarKill - Adding Point for Faction {getAttacker()}"); Att_Score += 1; } else if (getAttacker() == FactionName) { + NAPI.Util.ConsoleOutput($"GangwarKill - Adding Point for Faction {getOwner()}"); Def_Score += 1; } } diff --git a/ReallifeGamemode.Server/Inventory/Items/Döner.cs b/ReallifeGamemode.Server/Inventory/Items/Kebab.cs similarity index 96% rename from ReallifeGamemode.Server/Inventory/Items/Döner.cs rename to ReallifeGamemode.Server/Inventory/Items/Kebab.cs index 6f2f62ad..508e9c50 100644 --- a/ReallifeGamemode.Server/Inventory/Items/Döner.cs +++ b/ReallifeGamemode.Server/Inventory/Items/Kebab.cs @@ -8,7 +8,7 @@ using ReallifeGamemode.Server.Managers; namespace ReallifeGamemode.Server.Inventory.Items { - internal class Döner : ConsumableItem + internal class Kebab : ConsumableItem { public override int Id => 106; public override string Name => "Döner"; diff --git a/ReallifeGamemode.Server/Job/BusDriverJob.cs b/ReallifeGamemode.Server/Job/BusDriverJob.cs index 9060cd07..181b2436 100644 --- a/ReallifeGamemode.Server/Job/BusDriverJob.cs +++ b/ReallifeGamemode.Server/Job/BusDriverJob.cs @@ -33,9 +33,9 @@ namespace ReallifeGamemode.Server.Job public const uint VEHICLE_INTERMEDIATE = (uint)VehicleHash.Coach; public const uint VEHICLE_PROFESSIONAL = (uint)VehicleHash.Tourbus; - public const int WAGE_BEGINNER = 800; - public const int WAGE_INTERMEDIATE = 1200; - public const int WAGE_PROFESSIOAL = 1800; + public const int WAGE_BEGINNER = 400; + public const int WAGE_INTERMEDIATE = 600; + public const int WAGE_PROFESSIOAL = 900; public const string BEGINNER = "Anfänger"; public const string INTERMEDIATE = "Fortgeschrittener"; @@ -195,25 +195,16 @@ namespace ReallifeGamemode.Server.Job { 0, new List() { - //new Vector3(-601.733, -2049.285, 6.090), - //new Vector3(-598.849365234375, -2053.087646484375, 5.8428778648376465), - new Vector3(-229.679931640625, -2049.821533203125, 27.384798049926758), - new Vector3(-72.33480834960938, -615.8173217773438, 35.91234588623047), - new Vector3(-176.9166717529297, -153.85665893554688, 43.38493728637695), - new Vector3(-508.5746765136719, -261.1121826171875, 35.247962951660156), - new Vector3(-1396.5457763671875, 51.69581604003906, 53.21350860595703), - new Vector3(-1911.845458984375, 205.62884521484375, 84.06185150146484), - new Vector3(-1675.4029541015625, 488.7856140136719, 128.6395721435547), - new Vector3(-995.8155517578125, 589.4381713867188, 102.18698120117188), - new Vector3(-314.6571350097656, 451.9184875488281, 107.99801635742188), - new Vector3(211.09194946289062, 350.1848449707031, 105.41163635253906), - new Vector3(599.4515380859375, 626.0756225585938, 128.6754608154297), - new Vector3(969.324462890625, 164.03329467773438, 80.59388732910156), - new Vector3(1069.521240234375, -763.7572631835938, 57.43597412109375), - new Vector3(1421.075927734375, -1854.2821044921875, 70.56175994873047), - new Vector3(268.5604248046875, -2070.274169921875, 16.816179275512695), - new Vector3(-147.51795959472656, -1974.3182373046875, 22.48438262939453), - new Vector3(-569.0294189453125, -2210.80908203125, 5.571292877197266), + new Vector3(-146.62071, -2178.8228, 10.194298), + new Vector3(14.580393, -1578.6385, 29.212185), + new Vector3(222.91612, -1098.8556, 29.227453), + new Vector3(246.44946, -648.45496, 39.420746), + new Vector3(102.181, -298.95276, 46.04399), + new Vector3(-104.91002, -606.26013, 36.06103), + new Vector3(-288.1007, -1204.5107, 24.403156), + new Vector3(-166.23526, -1574.4166, 35.152023), + new Vector3(-60.337997, -1976.121, 16.486664), + new Vector3(-599.1891, -2049.2695, 6.14637), } }, { 1, @@ -238,16 +229,15 @@ namespace ReallifeGamemode.Server.Job new List() { //new Vector3(-601.733, -2049.285, 6.090), - new Vector3(-146.62071, -2178.8228, 9.194298), - new Vector3(14.580393, -1578.6385, 28.212185), - new Vector3(222.91612, -1098.8556, 28.227453), - new Vector3(246.44946, -648.45496, 38.420746), - new Vector3(102.181, -298.95276, 45.04399), - new Vector3(-104.91002, -606.26013, 35.06103), - new Vector3(-288.1007, -1204.5107, 23.403156), - new Vector3(-166.23526, -1574.4166, 34.152023), - new Vector3(-60.337997, -1976.121, 15.486664), - new Vector3(-599.1891, -2049.2695, 5.14637), + new Vector3(-566.381, -2209.74, 5.88064), + new Vector3(769.912, -1983.54, 29.2573), + new Vector3(1021.58, -725.525, 57.6664), + new Vector3(244.279, -860.634, 29.5133), + new Vector3(-506.147, -282.95, 35.4909), + new Vector3(-1205.3, -130.106, 40.9405), + new Vector3(-1396.98, -773.447, 20.68), + new Vector3(-666.861, -1241.26, 10.5494), + new Vector3(-599.541, -2054.42, 6.0372), } }, }; @@ -443,6 +433,14 @@ namespace ReallifeGamemode.Server.Job player.SendChatMessage("~y~[JOB]: ~w~Die neue Route lädt. Bitte warten..."); string type = getPlayerRouteType(player); + if (type == BEGINNER) + BusJobEvents.payWage(player, WAGE_BEGINNER); + else if (type == INTERMEDIATE) + BusJobEvents.payWage(player, WAGE_INTERMEDIATE); + else if (type == PROFESSIONAL) + BusJobEvents.payWage(player, WAGE_PROFESSIOAL); + + NAPI.Task.Run(() => { if (type == BEGINNER) @@ -466,6 +464,7 @@ namespace ReallifeGamemode.Server.Job NAPI.ClientEvent.TriggerClientEventForAll("SERVER:setIndicatorStatus", veh.Handle.Value, data.Left, data.Right); } + public void BusCheckpoint(Player player) { if (!player.IsInVehicle || player.VehicleSeat != 0) return; @@ -564,7 +563,7 @@ namespace ReallifeGamemode.Server.Job return; } - if(!playerVehiclePair.ContainsKey(player)) + if (!playerVehiclePair.ContainsKey(player)) { return; } @@ -624,7 +623,7 @@ namespace ReallifeGamemode.Server.Job payWage(player, BusDriverJob.WAGE_PROFESSIOAL / BusDriverJob.playerRouteCurrent[player.Name].Count); } - private void payWage(Player player, int wage) + public static void payWage(Player player, int wage) { using var dbContext = new DatabaseContext(); User user = player.GetUser(dbContext); diff --git a/ReallifeGamemode.Server/Job/MuellmannData.cs b/ReallifeGamemode.Server/Job/MuellmannData.cs index a91d5574..295205e8 100644 --- a/ReallifeGamemode.Server/Job/MuellmannData.cs +++ b/ReallifeGamemode.Server/Job/MuellmannData.cs @@ -32,7 +32,7 @@ namespace ReallifeGamemode.Server.Job public void removeClientFromData(Player player) { if (client1 == player) { client1 = null; } - if (client2 == player) { client2 = null;} + if (client2 == player) { client2 = null; } } public int getTrashCount() diff --git a/ReallifeGamemode.Server/Main.cs b/ReallifeGamemode.Server/Main.cs index ec1afb62..6ade1d26 100644 --- a/ReallifeGamemode.Server/Main.cs +++ b/ReallifeGamemode.Server/Main.cs @@ -122,6 +122,7 @@ namespace ReallifeGamemode.Server ShopManager.LoadClotheShops(); ShopManager.LoadItemShops(); ShopManager.LoadFriseur(); + ShopManager.LoadAmmunations(); TuningManager.LoadTuningGarages(); TimeManager.StartTimeManager(); diff --git a/ReallifeGamemode.Server/Managers/InteractionManager.cs b/ReallifeGamemode.Server/Managers/InteractionManager.cs index d7684129..d94029a1 100644 --- a/ReallifeGamemode.Server/Managers/InteractionManager.cs +++ b/ReallifeGamemode.Server/Managers/InteractionManager.cs @@ -181,6 +181,11 @@ namespace ReallifeGamemode.Server.Managers ChatService.ErrorMessage(player, "Dieser Spieler ist schon in einer Fraktion"); return; } + if (targetUser?.Wanteds > 0) + { + player.SendNotification("~r~Du kannst diesen Spieler nicht inviten da er aktuell gesucht wird. (Wanted)", false); + return; + } target.SetData("accept_faction_invite", player.Name); @@ -486,7 +491,7 @@ namespace ReallifeGamemode.Server.Managers using var dbContext = new DatabaseContext(); var user = player.GetUser(dbContext); - if(user.FactionId == null) + if (user.FactionId == null) { return; } @@ -517,7 +522,7 @@ namespace ReallifeGamemode.Server.Managers } var factionVehicleCount = dbContext.FactionVehicles.ToList().Where(v => v.Id == id && v.GetOwners().Contains(user.FactionId.Value)).Count(); - if(factionVehicleCount <= 6) + if (factionVehicleCount <= 6) { ChatService.ErrorMessage(player, "Die Fraktion braucht mindestens 6 Fahrzeuge"); return; @@ -589,86 +594,77 @@ namespace ReallifeGamemode.Server.Managers public void InteractionMenu_LSPD_Points3(Player player, string jsonNameOrId, string jsoAmount, string jsonReason) { string nameOrId = (string)JsonConvert.DeserializeObject(jsonNameOrId); - int amount = Int32.Parse((string)JsonConvert.DeserializeObject(jsoAmount)); string reason = (string)JsonConvert.DeserializeObject(jsonReason); Player target = PlayerService.GetPlayerByNameOrId(nameOrId); string playername = NAPI.Player.GetPlayerName(player); string targetname = NAPI.Player.GetPlayerName(target); + + if (!int.TryParse((string)JsonConvert.DeserializeObject(jsoAmount), out int amount)) + { + player.SendNotification("~r~Es muss eine gültige Zahl für die Punkte angegeben werden!"); + return; + } + if (target == null || !target.IsLoggedIn()) { ChatService.PlayerNotFound(player); return; } - else if (target.GetUser().DriverLicenseVehicle == false && target.GetUser().DriverLicenseBike == false) - { - player.SendNotification("~r~Spieler hat weder Auto- noch Motorradführerschein!"); - } - else if (target == player) + + if (target == player) { player.SendNotification("~r~Du kannst dir selbst keine Punkte setzen!"); + return; + } + + using var dbContext = new DatabaseContext(); + User targetUser = target.GetUser(dbContext); + + if(targetUser == null) + { + ChatService.PlayerNotFound(player); + return; + } + + if (targetUser.DriverLicenseVehicle == false && targetUser.DriverLicenseBike == false) + { + player.SendNotification("~r~Spieler hat weder Auto- noch Motorradführerschein!"); + return; + } + + if (amount < -13 || amount > 13) + { + player.SendNotification("~r~Du kannst nur zwischen 1 und 12 Punkte verteilen!"); + return; + } + + targetUser.Points += amount; + + player.SendNotification($"~w~Du hast ~y~{targetname} ~b~{amount} ~w~Strafpunkte gegeben. Grund: ~g~{reason}~w~."); + target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} | {playername} ~w~hat dir ~y~{amount} ~w~Strafpunkte gegeben.", true); + ChatService.HQMessage(targetname + " hat von " + playername + " " + amount + " Strafpunkt(e) erhalten. Gesamt: " + targetUser.Points); + + if (targetUser.Points < 0) + { + targetUser.Points = 0; + } + else if (targetUser.Points >= 12) + { + target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~r~12/12 ~x~Strafpunkten.", true); + target.SendNotification($"~w~Dir wird ~r~Auto- ~w~und ~r~Motorradführerschein ~w~entzogen.", true); //FlashNotif + + ChatService.HQMessage(targetname + " besitzt nun keinen Führerschein mehr."); + + targetUser.Points = 0; + targetUser.DriverLicenseVehicle = false; + targetUser.DriverLicenseBike = false; } else { - if (amount > -13 && amount < 13) - { - using (var dbContext = new DatabaseContext()) - { - User target2 = target.GetUser(dbContext); - target2.Points += amount; - dbContext.SaveChanges(); - } - player.SendNotification($"~w~Du hast ~y~{targetname} ~b~{amount} ~w~Strafpunkte gegeben. Grund: ~g~{reason}~w~."); - target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} | {playername} ~w~hat dir ~y~{amount} ~w~Strafpunkte gegeben.", true); - ChatService.BroadcastFaction("!{#8181E9}HQ: " + targetname + " hat von " + playername + " " + amount + " Strafpunkt(e) erhalten. Gesamt: " + target.GetUser().Points, new List() { 1, 3 }); - if (target.GetUser().Points < 0) - { - using (var dbContext = new DatabaseContext()) - { - User target2 = target.GetUser(dbContext); - target2.Points = 0; - dbContext.SaveChanges(); - } - } - else if (target.GetUser().Points >= 12) - { - target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~r~12/12 ~x~Strafpunkten.", true); - target.SendNotification($"~w~Dir wird ~r~Auto- ~w~und ~r~Motorradführerschein ~w~entzogen.", true); //FlashNotif - ChatService.HQMessage(targetname + "hat von" + playername + " " + amount + " Strafpunkt erhalten(e). Gesamt: " + target.GetUser().Points); - foreach (var copPlayer in NAPI.Pools.GetAllPlayers()) - { - User copUser = copPlayer.GetUser(); - if (copUser == null) - { - continue; - } - - if (copUser.FactionId == 1 || copUser.FactionId == 3) - { - if (copUser.GetData("duty") == true) - { - ChatService.HQMessage(targetname + " besitzt nun keinen Führerschein mehr."); - } - } - } - using (var dbContext = new DatabaseContext()) - { - User target2 = target.GetUser(dbContext); - target2.Points = 0; - target2.DriverLicenseVehicle = false; - target2.DriverLicenseBike = false; - dbContext.SaveChanges(); - } - } - else - { - target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~y~{target.GetUser().Points}/12 ~x~Strafpunkten.", true); - } - } - else - { - player.SendNotification("~r~Du kannst nur zwischen 1 und 12 Punkte verteilen!"); - } + target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~y~{targetUser.Points}/12 ~x~Strafpunkten.", true); } + + dbContext.SaveChanges(); } [RemoteEvent("CLIENT:InteractionMenu_Ticket")] diff --git a/ReallifeGamemode.Server/Managers/InventoryManager.cs b/ReallifeGamemode.Server/Managers/InventoryManager.cs index 3c105fae..d25d977a 100644 --- a/ReallifeGamemode.Server/Managers/InventoryManager.cs +++ b/ReallifeGamemode.Server/Managers/InventoryManager.cs @@ -563,6 +563,7 @@ namespace ReallifeGamemode.Server.Managers if (iItem is IWeaponDealItem obj) { player.ClearAttachments(); + player.ClearAnimation(); dropPosition.Z -= 1.05f; grndObject = NAPI.Object.CreateObject(3666746839, dropPosition, new Vector3(0, 0, r.Next(0, 360)), 255, 0); } diff --git a/ReallifeGamemode.Server/Managers/JobManager.cs b/ReallifeGamemode.Server/Managers/JobManager.cs index bd66afbe..63abaff8 100644 --- a/ReallifeGamemode.Server/Managers/JobManager.cs +++ b/ReallifeGamemode.Server/Managers/JobManager.cs @@ -186,7 +186,7 @@ namespace ReallifeGamemode.Server.Managers { VehicleStreaming.SetEngineState(player.Vehicle, false); } - + player.Position = playerJobStartPosition[player]; job.StopJob(player); if (playerTimersJobVehicleRespawn.ContainsKey(player)) diff --git a/ReallifeGamemode.Server/Managers/PositionManager.cs b/ReallifeGamemode.Server/Managers/PositionManager.cs index ec0ea301..e53e9aef 100644 --- a/ReallifeGamemode.Server/Managers/PositionManager.cs +++ b/ReallifeGamemode.Server/Managers/PositionManager.cs @@ -6,6 +6,7 @@ using ReallifeGamemode.Server.Shop.SevenEleven; using ReallifeGamemode.Server.Shop.Friseur; using ReallifeGamemode.Server.Util; using ReallifeGamemode.Server.Extensions; +using ReallifeGamemode.Server.Shop.Ammunation; namespace ReallifeGamemode.Server.Managers { @@ -29,6 +30,8 @@ namespace ReallifeGamemode.Server.Managers public static List cuffPoints = new List(); + public static List AmmunationPoints = new List(); + public static void LoadPositionManager() { #region DutyPoints @@ -280,6 +283,20 @@ namespace ReallifeGamemode.Server.Managers NAPI.TextLabel.CreateTextLabel("24/7 - Dr\u00fccke ~y~E", s.Position, 7, 1, 0, new Color(255, 255, 255), false, 0); } + foreach (Ammunation s in ShopManager.Ammunations) + { + NAPI.Marker.CreateMarker(1, new Vector3(s.vector.X, s.vector.Y, s.vector.Z - 2), new Vector3(s.vector.X, s.vector.Y, s.vector.Z + 1), + new Vector3(0, 0, 0), 2, new Color(255, 255, 255, 50), false, 0); + NAPI.TextLabel.CreateTextLabel("Ammunation - Dr\u00fccke ~y~E", s.vector, 7, 1, 0, new Color(255, 255, 255), false, 0); + + AmmunationPoint ammuShop = new AmmunationPoint + { + Position = s.vector, + Ammunation = s + }; + AmmunationPoints.Add(ammuShop); + } + #endregion Shops } @@ -407,3 +424,9 @@ public class ElevatorPoint public int FactionId { get; set; } public string Stage { get; set; } } + +public class AmmunationPoint +{ + public Vector3 Position { get; set; } + public Ammunation Ammunation { get; set; } +} diff --git a/ReallifeGamemode.Server/Managers/ShopManager.cs b/ReallifeGamemode.Server/Managers/ShopManager.cs index 6a94a4af..dd7e35d2 100644 --- a/ReallifeGamemode.Server/Managers/ShopManager.cs +++ b/ReallifeGamemode.Server/Managers/ShopManager.cs @@ -6,6 +6,7 @@ using ReallifeGamemode.Database.Models; using ReallifeGamemode.Server.Shop.Clothing; using ReallifeGamemode.Server.Shop.SevenEleven; using ReallifeGamemode.Server.Shop.Friseur; +using ReallifeGamemode.Server.Shop.Ammunation; namespace ReallifeGamemode.Server.Managers { @@ -14,6 +15,7 @@ namespace ReallifeGamemode.Server.Managers public static List clotheStores = new List(); public static List itemShops = new List(); public static List FriseurStores = new List(); + public static List Ammunations = new List(); public static void LoadClotheShops() { @@ -81,5 +83,20 @@ namespace ReallifeGamemode.Server.Managers } } + public static void LoadAmmunations() + { + using (var dbContext = new DatabaseContext()) + { + List ammunations = dbContext.Blips.ToList().FindAll(s => s.Name == "Ammunation"); + + foreach (var store in ammunations) + { + Vector3 pos = new Vector3(store.PositionX, store.PositionY, store.PositionZ); + Ammunation newShop = new Ammunation(pos); + Ammunations.Add(newShop); + } + NAPI.Util.ConsoleOutput($"Loading {ammunations.Count} Ammunations"); + } + } } } diff --git a/ReallifeGamemode.Server/Managers/VehicleManager.cs b/ReallifeGamemode.Server/Managers/VehicleManager.cs index fc0283a2..e4f05cae 100644 --- a/ReallifeGamemode.Server/Managers/VehicleManager.cs +++ b/ReallifeGamemode.Server/Managers/VehicleManager.cs @@ -14,6 +14,9 @@ namespace ReallifeGamemode.Server.Managers { public class VehicleManager : Script { + + public static Dictionary> lastDriversInVehicle = new Dictionary>(); + private static readonly List _enabledMods = new List() { "ninef", diff --git a/ReallifeGamemode.Server/Shop/Ammunation/Ammunation.cs b/ReallifeGamemode.Server/Shop/Ammunation/Ammunation.cs new file mode 100644 index 00000000..fb30a048 --- /dev/null +++ b/ReallifeGamemode.Server/Shop/Ammunation/Ammunation.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using GTANetworkAPI; +using Newtonsoft.Json; +using ReallifeGamemode.Database.Entities; +using ReallifeGamemode.Database.Models; +using ReallifeGamemode.Server.Extensions; +using ReallifeGamemode.Server.Managers; +using ReallifeGamemode.Server.Services; + +namespace ReallifeGamemode.Server.Shop.Ammunation +{ + public class Ammunation + { + public Vector3 vector { get; set; } + public List weaponList = new List(); + + public Ammunation(Vector3 position) + { + this.vector = position; + LoadWeapons(); + } + + public void LoadWeapons() + { + using (var dbContext = new DatabaseContext()) + { + weaponList = dbContext.Weapons.ToList().FindAll(w => w.AmmunationActive == true); + } + } + public void LoadShopNUI(Player client) + { + + List shopWeapons = weaponList.ToList(); + client.TriggerEvent("AmmunationShop:LoadNativeUI", JsonConvert.SerializeObject(shopWeapons)); + } + } +} diff --git a/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs b/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs index 530e4741..7f6fe6ea 100644 --- a/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs +++ b/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs @@ -77,7 +77,7 @@ namespace ReallifeGamemode.Server.Wanted dbContext.SaveChanges(); waTimer[user.Id] = WantedEscapeTime; } - else if (!isNearCop) + else if (!isNearCop && !player.IsAfk()) { player.TriggerEvent("SERVER:SetWantedFlash", true); waTimer[user.Id] -= 2500; diff --git a/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs b/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs index 54830d89..560c4e4b 100644 --- a/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs +++ b/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs @@ -196,7 +196,7 @@ namespace ReallifeGamemode.Server.WeaponDeal fVeh.AddAttachment("weapondeal1", false); fVeh.AddAttachment("weapondeal2", false); InventoryManager.RemoveAllItemsfromVehicleInventory(fVeh); - int oMembers = NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn() && p.GetUser(context).FactionId == user.FactionId).Count(); + int oMembers = NAPI.Pools.GetAllPlayers().Where(p => !p.IsAfk() && p.IsLoggedIn() && p.GetUser(context).FactionId == user.FactionId).Count(); if (factionVehicle.GetOwners().Contains(8) || factionVehicle.GetOwners().Contains(7)) {