From ed95acc24d09aaa844cc4ab058d00ca171b905ca Mon Sep 17 00:00:00 2001 From: Lennart Kampshoff Date: Sat, 21 Dec 2019 14:03:06 +0100 Subject: [PATCH] Code formatiert --- .../Controllers/AuthController.cs | 2 +- .../Controllers/LocationController.cs | 2 +- .../Controllers/UserController.cs | 2 +- .../Logic/JwtTokenGenerator.cs | 2 +- .../Logic/LogicBase.cs | 2 +- .../Migrations/20190922135310_Initial.cs | 2410 ++++++++--------- .../20190922163450_WeaponDealTimer.cs | 54 +- .../20190929200617_SavedLocations.cs | 50 +- .../20190929202101_FactionWeaponAmount.cs | 32 +- .../20190929202856_SavedLocationsHeading.cs | 32 +- .../Migrations/20191017200636_gtavdev-db.cs | 18 +- .../20191030183018_DriverLicenseVehicle.cs | 32 +- .../20191030203114_FlyingLicensePlane.cs | 32 +- .../Migrations/20191101144543_SchoolId.cs | 30 +- .../20191101204247_DriverLicenseBike.cs | 32 +- .../Migrations/20191129201024_Turfs.cs | 58 +- .../Business/BusinessBase.cs | 4 +- .../Business/HelicopterDealerBusiness.cs | 4 +- .../Commands/AdminCommands.cs | 12 +- .../Commands/UserCommands.cs | 2 +- .../DrivingSchool/DrivingSchool.cs | 8 +- .../DrivingSchool/PlaneSchool.cs | 8 +- ReallifeGamemode.Server/Events/Connect.cs | 6 +- ReallifeGamemode.Server/Events/Death.cs | 12 +- ReallifeGamemode.Server/Events/Disconnect.cs | 2 +- .../Events/EnterVehicleAttempt.cs | 2 +- ReallifeGamemode.Server/Events/ExitVehicle.cs | 2 +- ReallifeGamemode.Server/Events/Inventory.cs | 6 +- ReallifeGamemode.Server/Events/Key.cs | 20 +- ReallifeGamemode.Server/Events/Login.cs | 7 +- .../Events/UpdateCharacterElevator.cs | 2 +- .../Events/UpdateCharacterWeapon.cs | 14 +- ReallifeGamemode.Server/Events/Vehicle.cs | 2 +- .../Extensions/ClientExtension.cs | 8 +- ReallifeGamemode.Server/Finance/Economy.cs | 2 +- ReallifeGamemode.Server/Gangwar/Gangwar.cs | 6 +- ReallifeGamemode.Server/Gangwar/Turf.cs | 39 +- ReallifeGamemode.Server/Job/BusDriverJob.cs | 6 +- ReallifeGamemode.Server/Job/PilotJob.cs | 40 +- .../Managers/BusinessManager.cs | 2 +- .../Managers/InteractionManager.cs | 8 +- .../Managers/InventoryManager.cs | 78 +- .../Managers/PositionManager.cs | 12 +- .../Migrations/20190719210722_PaydayTimer.cs | 32 +- .../20190721144830_FactionWeapons.cs | 70 +- .../20190722201850_VehicleLivery.cs | 32 +- .../20190728142431_HouseEnhancments.cs | 122 +- .../Migrations/20190805184145_VehicleItems.cs | 76 +- .../Migrations/20190911192912_BusinessData.cs | 46 +- .../Report/ReportManage.cs | 2 +- .../Util/CheckPointHandle.cs | 6 +- ReallifeGamemode.Server/Wanted/Autowanted.cs | 20 +- ReallifeGamemode.Server/Wanted/Jail.cs | 9 +- .../Wanted/WantedEscapeTimer.cs | 2 +- .../WeaponDeal/WeaponDealManager.cs | 12 +- .../WeaponDeal/WeaponDealPoints.cs | 2 +- 56 files changed, 1771 insertions(+), 1764 deletions(-) diff --git a/ReallifeGamemode.DataService/Controllers/AuthController.cs b/ReallifeGamemode.DataService/Controllers/AuthController.cs index bcc403ab..b6febd2c 100644 --- a/ReallifeGamemode.DataService/Controllers/AuthController.cs +++ b/ReallifeGamemode.DataService/Controllers/AuthController.cs @@ -34,7 +34,7 @@ namespace ReallifeGamemode.DataService.Controllers string token = tokenGenerator.GenerateUserToken(user); - if(string.IsNullOrEmpty(token)) + if (string.IsNullOrEmpty(token)) { return Unauthorized(); } diff --git a/ReallifeGamemode.DataService/Controllers/LocationController.cs b/ReallifeGamemode.DataService/Controllers/LocationController.cs index f911d98a..b9460385 100644 --- a/ReallifeGamemode.DataService/Controllers/LocationController.cs +++ b/ReallifeGamemode.DataService/Controllers/LocationController.cs @@ -30,7 +30,7 @@ namespace ReallifeGamemode.DataService.Controllers List locations = new List(); - foreach(var location in list) + foreach (var location in list) { string description = location.Description; description = Regex.Replace(description, @"<[^>]*(>|$)", string.Empty); diff --git a/ReallifeGamemode.DataService/Controllers/UserController.cs b/ReallifeGamemode.DataService/Controllers/UserController.cs index 27609420..f06d2696 100644 --- a/ReallifeGamemode.DataService/Controllers/UserController.cs +++ b/ReallifeGamemode.DataService/Controllers/UserController.cs @@ -33,7 +33,7 @@ namespace ReallifeGamemode.DataService.Controllers { User user = dbContext.Users.Where(u => u.Id == UserId).FirstOrDefault(); - if(user == null) + if (user == null) { return NotFound(); } diff --git a/ReallifeGamemode.DataService/Logic/JwtTokenGenerator.cs b/ReallifeGamemode.DataService/Logic/JwtTokenGenerator.cs index 45261610..53c9bb13 100644 --- a/ReallifeGamemode.DataService/Logic/JwtTokenGenerator.cs +++ b/ReallifeGamemode.DataService/Logic/JwtTokenGenerator.cs @@ -27,7 +27,7 @@ namespace ReallifeGamemode.DataService.Logic public string GenerateUserToken(User user) { - if(user == null) + if (user == null) { return null; } diff --git a/ReallifeGamemode.DataService/Logic/LogicBase.cs b/ReallifeGamemode.DataService/Logic/LogicBase.cs index 3fc6cbd4..fca87b89 100644 --- a/ReallifeGamemode.DataService/Logic/LogicBase.cs +++ b/ReallifeGamemode.DataService/Logic/LogicBase.cs @@ -24,7 +24,7 @@ namespace ReallifeGamemode.DataService.Logic { Type[] types = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.IsSubclassOf(typeof(LogicBase)) && !t.IsAbstract).ToArray(); - foreach(Type type in types) + foreach (Type type in types) { services = services.AddScoped(type); } diff --git a/ReallifeGamemode.Database/Migrations/20190922135310_Initial.cs b/ReallifeGamemode.Database/Migrations/20190922135310_Initial.cs index e5357484..65ae38ba 100644 --- a/ReallifeGamemode.Database/Migrations/20190922135310_Initial.cs +++ b/ReallifeGamemode.Database/Migrations/20190922135310_Initial.cs @@ -4,1211 +4,1211 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { - public partial class Initial : Migration + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ATMs", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Balance = table.Column(nullable: false), - X = table.Column(nullable: false), - Y = table.Column(nullable: false), - Z = table.Column(nullable: false), - Faulty = table.Column(nullable: false), - Active = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ATMs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "BankAccountTransactionLogs", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Sender = table.Column(maxLength: 32, nullable: true), - SenderBalance = table.Column(nullable: false), - MoneySent = table.Column(nullable: false), - Receiver = table.Column(maxLength: 32, nullable: true), - ReceiverBalance = table.Column(nullable: false), - NewSenderBalance = table.Column(nullable: false), - NewReceiverBalance = table.Column(nullable: false), - Fee = table.Column(nullable: false), - Origin = table.Column(maxLength: 32, nullable: true), - Timestamp = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_BankAccountTransactionLogs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Blips", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Sprite = table.Column(nullable: false), - PositionX = table.Column(nullable: false), - PositionY = table.Column(nullable: false), - PositionZ = table.Column(nullable: false), - Name = table.Column(nullable: true), - Scale = table.Column(nullable: false), - Color = table.Column(nullable: false), - Alpha = table.Column(nullable: false), - DrawDistance = table.Column(nullable: false), - ShortRange = table.Column(nullable: false), - Rotation = table.Column(nullable: false), - Dimension = table.Column(nullable: false), - Active = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Blips", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "BusinessBankAccounts", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Balance = table.Column(nullable: false), - BusinessId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BusinessBankAccounts", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "BusinessData", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - BusinessId = table.Column(nullable: false), - Price = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BusinessData", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "BusRoutes", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Description = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BusRoutes", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "ClothCombinations", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Gender = table.Column(nullable: false), - Top = table.Column(nullable: false), - Torso = table.Column(nullable: false), - Undershirt = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ClothCombinations", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Factions", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(maxLength: 32, nullable: true), - StateOwned = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Factions", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "GotoPoints", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Description = table.Column(maxLength: 32, nullable: true), - X = table.Column(nullable: false), - Y = table.Column(nullable: false), - Z = table.Column(nullable: false), - Active = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_GotoPoints", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Groups", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Groups", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Interiors", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(nullable: true), - EnterPosition = table.Column(nullable: true), - ExitPosition = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Interiors", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Markers", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Type = table.Column(nullable: false), - PositionX = table.Column(nullable: false), - PositionY = table.Column(nullable: false), - PositionZ = table.Column(nullable: false), - Scale = table.Column(nullable: false), - DirectionX = table.Column(nullable: false), - DirectionY = table.Column(nullable: false), - DirectionZ = table.Column(nullable: false), - RotationX = table.Column(nullable: false), - RotationY = table.Column(nullable: false), - RotationZ = table.Column(nullable: false), - ColorR = table.Column(nullable: false), - ColorG = table.Column(nullable: false), - ColorB = table.Column(nullable: false), - ColorA = table.Column(nullable: false), - Visible = table.Column(nullable: false), - Dimension = table.Column(nullable: false), - Active = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Markers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Peds", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - HashModel = table.Column(nullable: true), - PositionX = table.Column(nullable: false), - PositionY = table.Column(nullable: false), - PositionZ = table.Column(nullable: false), - Heading = table.Column(nullable: false), - Dimension = table.Column(nullable: false), - Active = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Peds", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Pickups", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - PositionX = table.Column(maxLength: 128, nullable: false), - PositionY = table.Column(nullable: false), - PositionZ = table.Column(nullable: false), - RotationX = table.Column(nullable: false), - RotationY = table.Column(nullable: false), - RotationZ = table.Column(nullable: false), - Vehicle = table.Column(nullable: false), - RespawnTime = table.Column(nullable: false), - Dimension = table.Column(nullable: false), - Active = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Pickups", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "TextLabels", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Text = table.Column(nullable: false), - PositionX = table.Column(nullable: false), - PositionY = table.Column(nullable: false), - PositionZ = table.Column(nullable: false), - LOS = table.Column(nullable: false), - Font = table.Column(nullable: false), - DrawDistance = table.Column(nullable: false), - ColorR = table.Column(nullable: false), - ColorG = table.Column(nullable: false), - ColorB = table.Column(nullable: false), - ColorA = table.Column(nullable: false), - Dimension = table.Column(nullable: false), - Active = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TextLabels", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "TuningGarages", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - X = table.Column(nullable: false), - Y = table.Column(nullable: false), - Z = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TuningGarages", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WhitelistEntries", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - SocialClubName = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_WhitelistEntries", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "BusRoutesPoints", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Description = table.Column(nullable: true), - X = table.Column(nullable: false), - Y = table.Column(nullable: false), - Z = table.Column(nullable: false), - BusRouteId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BusRoutesPoints", x => x.Id); - table.ForeignKey( - name: "FK_BusRoutesPoints_BusRoutes_BusRouteId", - column: x => x.BusRouteId, - principalTable: "BusRoutes", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Doors", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Category = table.Column(nullable: true), - Name = table.Column(nullable: true), - Locked = table.Column(nullable: false), - Model = table.Column(nullable: false), - X = table.Column(nullable: false), - Y = table.Column(nullable: false), - Z = table.Column(nullable: false), - Radius = table.Column(nullable: false), - FactionId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Doors", x => x.Id); - table.ForeignKey( - name: "FK_Doors_Factions_FactionId", - column: x => x.FactionId, - principalTable: "Factions", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "DutyClothes", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - FactionId = table.Column(nullable: false), - Gender = table.Column(nullable: false), - SlotType = table.Column(nullable: false), - SlotId = table.Column(nullable: false), - ClothId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_DutyClothes", x => x.Id); - table.ForeignKey( - name: "FK_DutyClothes_Factions_FactionId", - column: x => x.FactionId, - principalTable: "Factions", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "FactionBankAccounts", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - FactionId = table.Column(nullable: false), - Bic = table.Column(maxLength: 12, nullable: true), - Iban = table.Column(maxLength: 32, nullable: true), - Balance = table.Column(nullable: false), - Active = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FactionBankAccounts", x => x.Id); - table.ForeignKey( - name: "FK_FactionBankAccounts_Factions_FactionId", - column: x => x.FactionId, - principalTable: "Factions", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "FactionRanks", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - RankName = table.Column(nullable: true), - Order = table.Column(nullable: false), - FactionId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FactionRanks", x => x.Id); - table.ForeignKey( - name: "FK_FactionRanks_Factions_FactionId", - column: x => x.FactionId, - principalTable: "Factions", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "FactionWeapons", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - FactionId = table.Column(nullable: true), - WeaponModel = table.Column(nullable: true), - SlotID = table.Column(nullable: false), - Rank = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FactionWeapons", x => x.Id); - table.ForeignKey( - name: "FK_FactionWeapons_Factions_FactionId", - column: x => x.FactionId, - principalTable: "Factions", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "GroupBankAccounts", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - GroupId = table.Column(nullable: true), - Balance = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_GroupBankAccounts", x => x.Id); - table.ForeignKey( - name: "FK_GroupBankAccounts_Groups_GroupId", - column: x => x.GroupId, - principalTable: "Groups", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(maxLength: 32, nullable: true), - SocialClubName = table.Column(maxLength: 32, nullable: true), - Password = table.Column(maxLength: 64, nullable: true), - LogUserId = table.Column(nullable: false), - RegistrationDate = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Email = table.Column(maxLength: 64, nullable: true), - AdminLevel = table.Column(nullable: false), - Dead = table.Column(nullable: false), - Handmoney = table.Column(nullable: false), - PositionX = table.Column(nullable: false), - PositionY = table.Column(nullable: false), - PositionZ = table.Column(nullable: false), - CharacterId = table.Column(nullable: true), - BanId = table.Column(nullable: true), - BusinessId = table.Column(nullable: true), - FactionId = table.Column(nullable: true), - FactionLeader = table.Column(nullable: false), - FactionRankId = table.Column(nullable: true), - GroupId = table.Column(nullable: true), - GroupRank = table.Column(nullable: false), - HouseId = table.Column(nullable: true), - JobId = table.Column(nullable: true), - Wanteds = table.Column(nullable: false), - Wage = table.Column(nullable: false), - JailTime = table.Column(nullable: false), - PaydayTimer = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - table.ForeignKey( - name: "FK_Users_Factions_FactionId", - column: x => x.FactionId, - principalTable: "Factions", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Users_FactionRanks_FactionRankId", - column: x => x.FactionRankId, - principalTable: "FactionRanks", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Users_Groups_GroupId", - column: x => x.GroupId, - principalTable: "Groups", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Bans", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - UserId = table.Column(nullable: false), - Reason = table.Column(nullable: true), - BannedBy = table.Column(nullable: true), - Applied = table.Column(nullable: false), - UntilDateTime = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Bans", x => x.Id); - table.ForeignKey( - name: "FK_Bans_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "CharacterClothes", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - UserId = table.Column(nullable: false), - Duty = table.Column(nullable: false), - SlotType = table.Column(nullable: false), - SlotId = table.Column(nullable: false), - ClothId = table.Column(nullable: false), - Texture = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_CharacterClothes", x => x.Id); - table.ForeignKey( - name: "FK_CharacterClothes_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Characters", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - UserId = table.Column(nullable: false), - Gender = table.Column(nullable: false), - Father = table.Column(nullable: false), - Mother = table.Column(nullable: false), - Similarity = table.Column(nullable: false), - SkinSimilarity = table.Column(nullable: false), - NoseWidth = table.Column(nullable: false), - NoseBottomHeight = table.Column(nullable: false), - NoseTipLength = table.Column(nullable: false), - NoseBridgeDepth = table.Column(nullable: false), - NoseTipHeight = table.Column(nullable: false), - NoseBroken = table.Column(nullable: false), - BrowHeight = table.Column(nullable: false), - BrowDepth = table.Column(nullable: false), - CheekboneHeight = table.Column(nullable: false), - CheekboneWidth = table.Column(nullable: false), - CheekDepth = table.Column(nullable: false), - EyeSize = table.Column(nullable: false), - LipThickness = table.Column(nullable: false), - JawWidth = table.Column(nullable: false), - JawShape = table.Column(nullable: false), - ChinHeight = table.Column(nullable: false), - ChinDepth = table.Column(nullable: false), - ChinWidth = table.Column(nullable: false), - ChinIndent = table.Column(nullable: false), - NeckWidth = table.Column(nullable: false), - Blemishes = table.Column(nullable: false), - BlemishesOpacity = table.Column(nullable: false), - FacialHair = table.Column(nullable: false), - FacialHairOpacity = table.Column(nullable: false), - Eyebrows = table.Column(nullable: false), - EyebrowsOpacity = table.Column(nullable: false), - Ageing = table.Column(nullable: false), - AgeingOpacity = table.Column(nullable: false), - Makeup = table.Column(nullable: false), - MakeupOpacity = table.Column(nullable: false), - Blush = table.Column(nullable: false), - BlushOpacity = table.Column(nullable: false), - Complexion = table.Column(nullable: false), - ComplexionOpacity = table.Column(nullable: false), - SunDamage = table.Column(nullable: false), - SunDamageOpacity = table.Column(nullable: false), - Lipstick = table.Column(nullable: false), - LipstickOpacity = table.Column(nullable: false), - Freckles = table.Column(nullable: false), - FrecklesOpacity = table.Column(nullable: false), - ChestHair = table.Column(nullable: false), - ChestHairOpacity = table.Column(nullable: false), - Hair = table.Column(nullable: false), - HairColor = table.Column(nullable: false), - HairHighlightColor = table.Column(nullable: false), - EyebrowColor = table.Column(nullable: false), - BeardColor = table.Column(nullable: false), - EyeColor = table.Column(nullable: false), - BlushColor = table.Column(nullable: false), - LipstickColor = table.Column(nullable: false), - ChestHairColor = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Characters", x => x.Id); - table.ForeignKey( - name: "FK_Characters_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "DeathLogs", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - VictimId = table.Column(nullable: false), - KillerId = table.Column(nullable: true), - VictimPositionX = table.Column(nullable: false), - VictimPositionY = table.Column(nullable: false), - VictimPositionZ = table.Column(nullable: false), - VictimHeading = table.Column(nullable: false), - KillerPositionX = table.Column(nullable: false), - KillerPositionY = table.Column(nullable: false), - KillerPositionZ = table.Column(nullable: false), - KillerHeading = table.Column(nullable: false), - CauseOfDeath = table.Column(maxLength: 64, nullable: true), - Timestamp = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) - }, - constraints: table => - { - table.PrimaryKey("PK_DeathLogs", x => x.Id); - table.ForeignKey( - name: "FK_DeathLogs_Users_KillerId", - column: x => x.KillerId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_DeathLogs_Users_VictimId", - column: x => x.VictimId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Houses", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Type = table.Column(nullable: true), - Price = table.Column(nullable: false), - X = table.Column(nullable: false), - Y = table.Column(nullable: false), - Z = table.Column(nullable: false), - RentalFee = table.Column(nullable: false), - CanRentIn = table.Column(nullable: false), - OwnerId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Houses", x => x.Id); - table.ForeignKey( - name: "FK_Houses_Users_OwnerId", - column: x => x.OwnerId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "News", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - UserId = table.Column(nullable: true), - Caption = table.Column(nullable: true), - Content = table.Column(nullable: true), - Active = table.Column(nullable: false), - Timestamp = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_News", x => x.Id); - table.ForeignKey( - name: "FK_News_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "ServerVehicles", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Model = table.Column(nullable: false), - PositionX = table.Column(nullable: false), - PositionY = table.Column(nullable: false), - PositionZ = table.Column(nullable: false), - Heading = table.Column(nullable: false), - NumberPlate = table.Column(maxLength: 8, nullable: true), - PrimaryColor = table.Column(nullable: false), - SecondaryColor = table.Column(nullable: false), - Locked = table.Column(nullable: false), - Active = table.Column(nullable: false, defaultValue: true), - DistanceDriven = table.Column(nullable: false), - TankAmount = table.Column(nullable: false), - Livery = table.Column(nullable: false), - Discriminator = table.Column(nullable: false), - FactionId = table.Column(nullable: true), - GroupId = table.Column(nullable: true), - JobId = table.Column(nullable: true), - BusinessId = table.Column(nullable: true), - Price = table.Column(nullable: true), - UserId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ServerVehicles", x => x.Id); - table.ForeignKey( - name: "FK_ServerVehicles_Factions_FactionId", - column: x => x.FactionId, - principalTable: "Factions", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ServerVehicles_Groups_GroupId", - column: x => x.GroupId, - principalTable: "Groups", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_ServerVehicles_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "UserBankAccounts", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - UserId = table.Column(nullable: false), - Bic = table.Column(maxLength: 12, nullable: true), - Iban = table.Column(maxLength: 32, nullable: true), - Balance = table.Column(nullable: false), - Active = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_UserBankAccounts", x => x.Id); - table.ForeignKey( - name: "FK_UserBankAccounts_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "UserItems", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ItemId = table.Column(nullable: false), - UserId = table.Column(nullable: false), - Amount = table.Column(nullable: false), - Slot = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_UserItems", x => x.Id); - table.ForeignKey( - name: "FK_UserItems_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "HouseRentals", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - HouseId = table.Column(nullable: true), - UserId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_HouseRentals", x => x.Id); - table.ForeignKey( - name: "FK_HouseRentals_Houses_HouseId", - column: x => x.HouseId, - principalTable: "Houses", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_HouseRentals_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "VehicleItems", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ItemId = table.Column(nullable: false), - VehicleId = table.Column(nullable: false), - Amount = table.Column(nullable: false), - Slot = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_VehicleItems", x => x.Id); - table.ForeignKey( - name: "FK_VehicleItems_ServerVehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "ServerVehicles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "VehicleMods", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ServerVehicleId = table.Column(nullable: false), - Slot = table.Column(nullable: false), - ModId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_VehicleMods", x => x.Id); - table.ForeignKey( - name: "FK_VehicleMods_ServerVehicles_ServerVehicleId", - column: x => x.ServerVehicleId, - principalTable: "ServerVehicles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_Bans_UserId", - table: "Bans", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_BusinessBankAccounts_BusinessId", - table: "BusinessBankAccounts", - column: "BusinessId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_BusRoutesPoints_BusRouteId", - table: "BusRoutesPoints", - column: "BusRouteId"); - - migrationBuilder.CreateIndex( - name: "IX_CharacterClothes_UserId", - table: "CharacterClothes", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Characters_UserId", - table: "Characters", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_DeathLogs_KillerId", - table: "DeathLogs", - column: "KillerId"); - - migrationBuilder.CreateIndex( - name: "IX_DeathLogs_VictimId", - table: "DeathLogs", - column: "VictimId"); - - migrationBuilder.CreateIndex( - name: "IX_Doors_FactionId", - table: "Doors", - column: "FactionId"); - - migrationBuilder.CreateIndex( - name: "IX_DutyClothes_FactionId", - table: "DutyClothes", - column: "FactionId"); - - migrationBuilder.CreateIndex( - name: "IX_FactionBankAccounts_FactionId", - table: "FactionBankAccounts", - column: "FactionId"); - - migrationBuilder.CreateIndex( - name: "IX_FactionRanks_FactionId", - table: "FactionRanks", - column: "FactionId"); - - migrationBuilder.CreateIndex( - name: "IX_FactionWeapons_FactionId", - table: "FactionWeapons", - column: "FactionId"); - - migrationBuilder.CreateIndex( - name: "IX_GroupBankAccounts_GroupId", - table: "GroupBankAccounts", - column: "GroupId"); - - migrationBuilder.CreateIndex( - name: "IX_HouseRentals_HouseId", - table: "HouseRentals", - column: "HouseId"); - - migrationBuilder.CreateIndex( - name: "IX_HouseRentals_UserId", - table: "HouseRentals", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Houses_OwnerId", - table: "Houses", - column: "OwnerId"); - - migrationBuilder.CreateIndex( - name: "IX_News_UserId", - table: "News", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_ServerVehicles_FactionId", - table: "ServerVehicles", - column: "FactionId"); - - migrationBuilder.CreateIndex( - name: "IX_ServerVehicles_GroupId", - table: "ServerVehicles", - column: "GroupId"); - - migrationBuilder.CreateIndex( - name: "IX_ServerVehicles_UserId", - table: "ServerVehicles", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_UserBankAccounts_UserId", - table: "UserBankAccounts", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_UserItems_UserId", - table: "UserItems", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Users_BanId", - table: "Users", - column: "BanId"); - - migrationBuilder.CreateIndex( - name: "IX_Users_BusinessId", - table: "Users", - column: "BusinessId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Users_CharacterId", - table: "Users", - column: "CharacterId"); - - migrationBuilder.CreateIndex( - name: "IX_Users_FactionId", - table: "Users", - column: "FactionId"); - - migrationBuilder.CreateIndex( - name: "IX_Users_FactionRankId", - table: "Users", - column: "FactionRankId"); - - migrationBuilder.CreateIndex( - name: "IX_Users_GroupId", - table: "Users", - column: "GroupId"); - - migrationBuilder.CreateIndex( - name: "IX_Users_HouseId", - table: "Users", - column: "HouseId"); - - migrationBuilder.CreateIndex( - name: "IX_VehicleItems_VehicleId", - table: "VehicleItems", - column: "VehicleId"); - - migrationBuilder.CreateIndex( - name: "IX_VehicleMods_ServerVehicleId_Slot", - table: "VehicleMods", - columns: new[] { "ServerVehicleId", "Slot" }, - unique: true); - - migrationBuilder.AddForeignKey( - name: "FK_Users_Houses_HouseId", - table: "Users", - column: "HouseId", - principalTable: "Houses", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Users_Bans_BanId", - table: "Users", - column: "BanId", - principalTable: "Bans", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Users_Characters_CharacterId", - table: "Users", - column: "CharacterId", - principalTable: "Characters", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Bans_Users_UserId", - table: "Bans"); - - migrationBuilder.DropForeignKey( - name: "FK_Characters_Users_UserId", - table: "Characters"); - - migrationBuilder.DropForeignKey( - name: "FK_Houses_Users_OwnerId", - table: "Houses"); - - migrationBuilder.DropTable( - name: "ATMs"); - - migrationBuilder.DropTable( - name: "BankAccountTransactionLogs"); - - migrationBuilder.DropTable( - name: "Blips"); - - migrationBuilder.DropTable( - name: "BusinessBankAccounts"); - - migrationBuilder.DropTable( - name: "BusinessData"); - - migrationBuilder.DropTable( - name: "BusRoutesPoints"); - - migrationBuilder.DropTable( - name: "CharacterClothes"); - - migrationBuilder.DropTable( - name: "ClothCombinations"); - - migrationBuilder.DropTable( - name: "DeathLogs"); - - migrationBuilder.DropTable( - name: "Doors"); - - migrationBuilder.DropTable( - name: "DutyClothes"); - - migrationBuilder.DropTable( - name: "FactionBankAccounts"); - - migrationBuilder.DropTable( - name: "FactionWeapons"); - - migrationBuilder.DropTable( - name: "GotoPoints"); - - migrationBuilder.DropTable( - name: "GroupBankAccounts"); - - migrationBuilder.DropTable( - name: "HouseRentals"); - - migrationBuilder.DropTable( - name: "Interiors"); - - migrationBuilder.DropTable( - name: "Markers"); - - migrationBuilder.DropTable( - name: "News"); - - migrationBuilder.DropTable( - name: "Peds"); - - migrationBuilder.DropTable( - name: "Pickups"); - - migrationBuilder.DropTable( - name: "TextLabels"); - - migrationBuilder.DropTable( - name: "TuningGarages"); - - migrationBuilder.DropTable( - name: "UserBankAccounts"); - - migrationBuilder.DropTable( - name: "UserItems"); - - migrationBuilder.DropTable( - name: "VehicleItems"); - - migrationBuilder.DropTable( - name: "VehicleMods"); - - migrationBuilder.DropTable( - name: "WhitelistEntries"); - - migrationBuilder.DropTable( - name: "BusRoutes"); - - migrationBuilder.DropTable( - name: "ServerVehicles"); - - migrationBuilder.DropTable( - name: "Users"); - - migrationBuilder.DropTable( - name: "Bans"); - - migrationBuilder.DropTable( - name: "Characters"); - - migrationBuilder.DropTable( - name: "FactionRanks"); - - migrationBuilder.DropTable( - name: "Groups"); - - migrationBuilder.DropTable( - name: "Houses"); - - migrationBuilder.DropTable( - name: "Factions"); - } + migrationBuilder.CreateTable( + name: "ATMs", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Balance = table.Column(nullable: false), + X = table.Column(nullable: false), + Y = table.Column(nullable: false), + Z = table.Column(nullable: false), + Faulty = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ATMs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "BankAccountTransactionLogs", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Sender = table.Column(maxLength: 32, nullable: true), + SenderBalance = table.Column(nullable: false), + MoneySent = table.Column(nullable: false), + Receiver = table.Column(maxLength: 32, nullable: true), + ReceiverBalance = table.Column(nullable: false), + NewSenderBalance = table.Column(nullable: false), + NewReceiverBalance = table.Column(nullable: false), + Fee = table.Column(nullable: false), + Origin = table.Column(maxLength: 32, nullable: true), + Timestamp = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_BankAccountTransactionLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Blips", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Sprite = table.Column(nullable: false), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + Name = table.Column(nullable: true), + Scale = table.Column(nullable: false), + Color = table.Column(nullable: false), + Alpha = table.Column(nullable: false), + DrawDistance = table.Column(nullable: false), + ShortRange = table.Column(nullable: false), + Rotation = table.Column(nullable: false), + Dimension = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Blips", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "BusinessBankAccounts", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Balance = table.Column(nullable: false), + BusinessId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BusinessBankAccounts", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "BusinessData", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + BusinessId = table.Column(nullable: false), + Price = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BusinessData", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "BusRoutes", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Description = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_BusRoutes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "ClothCombinations", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Gender = table.Column(nullable: false), + Top = table.Column(nullable: false), + Torso = table.Column(nullable: false), + Undershirt = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ClothCombinations", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Factions", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(maxLength: 32, nullable: true), + StateOwned = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Factions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "GotoPoints", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Description = table.Column(maxLength: 32, nullable: true), + X = table.Column(nullable: false), + Y = table.Column(nullable: false), + Z = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_GotoPoints", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Groups", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Groups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Interiors", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(nullable: true), + EnterPosition = table.Column(nullable: true), + ExitPosition = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Interiors", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Markers", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Type = table.Column(nullable: false), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + Scale = table.Column(nullable: false), + DirectionX = table.Column(nullable: false), + DirectionY = table.Column(nullable: false), + DirectionZ = table.Column(nullable: false), + RotationX = table.Column(nullable: false), + RotationY = table.Column(nullable: false), + RotationZ = table.Column(nullable: false), + ColorR = table.Column(nullable: false), + ColorG = table.Column(nullable: false), + ColorB = table.Column(nullable: false), + ColorA = table.Column(nullable: false), + Visible = table.Column(nullable: false), + Dimension = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Markers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Peds", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + HashModel = table.Column(nullable: true), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + Heading = table.Column(nullable: false), + Dimension = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Peds", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Pickups", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + PositionX = table.Column(maxLength: 128, nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + RotationX = table.Column(nullable: false), + RotationY = table.Column(nullable: false), + RotationZ = table.Column(nullable: false), + Vehicle = table.Column(nullable: false), + RespawnTime = table.Column(nullable: false), + Dimension = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pickups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "TextLabels", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Text = table.Column(nullable: false), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + LOS = table.Column(nullable: false), + Font = table.Column(nullable: false), + DrawDistance = table.Column(nullable: false), + ColorR = table.Column(nullable: false), + ColorG = table.Column(nullable: false), + ColorB = table.Column(nullable: false), + ColorA = table.Column(nullable: false), + Dimension = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_TextLabels", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "TuningGarages", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + X = table.Column(nullable: false), + Y = table.Column(nullable: false), + Z = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_TuningGarages", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "WhitelistEntries", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + SocialClubName = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_WhitelistEntries", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "BusRoutesPoints", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Description = table.Column(nullable: true), + X = table.Column(nullable: false), + Y = table.Column(nullable: false), + Z = table.Column(nullable: false), + BusRouteId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_BusRoutesPoints", x => x.Id); + table.ForeignKey( + name: "FK_BusRoutesPoints_BusRoutes_BusRouteId", + column: x => x.BusRouteId, + principalTable: "BusRoutes", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Doors", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Category = table.Column(nullable: true), + Name = table.Column(nullable: true), + Locked = table.Column(nullable: false), + Model = table.Column(nullable: false), + X = table.Column(nullable: false), + Y = table.Column(nullable: false), + Z = table.Column(nullable: false), + Radius = table.Column(nullable: false), + FactionId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Doors", x => x.Id); + table.ForeignKey( + name: "FK_Doors_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "DutyClothes", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + FactionId = table.Column(nullable: false), + Gender = table.Column(nullable: false), + SlotType = table.Column(nullable: false), + SlotId = table.Column(nullable: false), + ClothId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DutyClothes", x => x.Id); + table.ForeignKey( + name: "FK_DutyClothes_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "FactionBankAccounts", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + FactionId = table.Column(nullable: false), + Bic = table.Column(maxLength: 12, nullable: true), + Iban = table.Column(maxLength: 32, nullable: true), + Balance = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FactionBankAccounts", x => x.Id); + table.ForeignKey( + name: "FK_FactionBankAccounts_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "FactionRanks", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + RankName = table.Column(nullable: true), + Order = table.Column(nullable: false), + FactionId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FactionRanks", x => x.Id); + table.ForeignKey( + name: "FK_FactionRanks_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "FactionWeapons", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + FactionId = table.Column(nullable: true), + WeaponModel = table.Column(nullable: true), + SlotID = table.Column(nullable: false), + Rank = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FactionWeapons", x => x.Id); + table.ForeignKey( + name: "FK_FactionWeapons_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "GroupBankAccounts", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + GroupId = table.Column(nullable: true), + Balance = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_GroupBankAccounts", x => x.Id); + table.ForeignKey( + name: "FK_GroupBankAccounts_Groups_GroupId", + column: x => x.GroupId, + principalTable: "Groups", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(maxLength: 32, nullable: true), + SocialClubName = table.Column(maxLength: 32, nullable: true), + Password = table.Column(maxLength: 64, nullable: true), + LogUserId = table.Column(nullable: false), + RegistrationDate = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Email = table.Column(maxLength: 64, nullable: true), + AdminLevel = table.Column(nullable: false), + Dead = table.Column(nullable: false), + Handmoney = table.Column(nullable: false), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + CharacterId = table.Column(nullable: true), + BanId = table.Column(nullable: true), + BusinessId = table.Column(nullable: true), + FactionId = table.Column(nullable: true), + FactionLeader = table.Column(nullable: false), + FactionRankId = table.Column(nullable: true), + GroupId = table.Column(nullable: true), + GroupRank = table.Column(nullable: false), + HouseId = table.Column(nullable: true), + JobId = table.Column(nullable: true), + Wanteds = table.Column(nullable: false), + Wage = table.Column(nullable: false), + JailTime = table.Column(nullable: false), + PaydayTimer = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.Id); + table.ForeignKey( + name: "FK_Users_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Users_FactionRanks_FactionRankId", + column: x => x.FactionRankId, + principalTable: "FactionRanks", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Users_Groups_GroupId", + column: x => x.GroupId, + principalTable: "Groups", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Bans", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: false), + Reason = table.Column(nullable: true), + BannedBy = table.Column(nullable: true), + Applied = table.Column(nullable: false), + UntilDateTime = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Bans", x => x.Id); + table.ForeignKey( + name: "FK_Bans_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "CharacterClothes", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: false), + Duty = table.Column(nullable: false), + SlotType = table.Column(nullable: false), + SlotId = table.Column(nullable: false), + ClothId = table.Column(nullable: false), + Texture = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CharacterClothes", x => x.Id); + table.ForeignKey( + name: "FK_CharacterClothes_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Characters", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: false), + Gender = table.Column(nullable: false), + Father = table.Column(nullable: false), + Mother = table.Column(nullable: false), + Similarity = table.Column(nullable: false), + SkinSimilarity = table.Column(nullable: false), + NoseWidth = table.Column(nullable: false), + NoseBottomHeight = table.Column(nullable: false), + NoseTipLength = table.Column(nullable: false), + NoseBridgeDepth = table.Column(nullable: false), + NoseTipHeight = table.Column(nullable: false), + NoseBroken = table.Column(nullable: false), + BrowHeight = table.Column(nullable: false), + BrowDepth = table.Column(nullable: false), + CheekboneHeight = table.Column(nullable: false), + CheekboneWidth = table.Column(nullable: false), + CheekDepth = table.Column(nullable: false), + EyeSize = table.Column(nullable: false), + LipThickness = table.Column(nullable: false), + JawWidth = table.Column(nullable: false), + JawShape = table.Column(nullable: false), + ChinHeight = table.Column(nullable: false), + ChinDepth = table.Column(nullable: false), + ChinWidth = table.Column(nullable: false), + ChinIndent = table.Column(nullable: false), + NeckWidth = table.Column(nullable: false), + Blemishes = table.Column(nullable: false), + BlemishesOpacity = table.Column(nullable: false), + FacialHair = table.Column(nullable: false), + FacialHairOpacity = table.Column(nullable: false), + Eyebrows = table.Column(nullable: false), + EyebrowsOpacity = table.Column(nullable: false), + Ageing = table.Column(nullable: false), + AgeingOpacity = table.Column(nullable: false), + Makeup = table.Column(nullable: false), + MakeupOpacity = table.Column(nullable: false), + Blush = table.Column(nullable: false), + BlushOpacity = table.Column(nullable: false), + Complexion = table.Column(nullable: false), + ComplexionOpacity = table.Column(nullable: false), + SunDamage = table.Column(nullable: false), + SunDamageOpacity = table.Column(nullable: false), + Lipstick = table.Column(nullable: false), + LipstickOpacity = table.Column(nullable: false), + Freckles = table.Column(nullable: false), + FrecklesOpacity = table.Column(nullable: false), + ChestHair = table.Column(nullable: false), + ChestHairOpacity = table.Column(nullable: false), + Hair = table.Column(nullable: false), + HairColor = table.Column(nullable: false), + HairHighlightColor = table.Column(nullable: false), + EyebrowColor = table.Column(nullable: false), + BeardColor = table.Column(nullable: false), + EyeColor = table.Column(nullable: false), + BlushColor = table.Column(nullable: false), + LipstickColor = table.Column(nullable: false), + ChestHairColor = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Characters", x => x.Id); + table.ForeignKey( + name: "FK_Characters_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DeathLogs", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + VictimId = table.Column(nullable: false), + KillerId = table.Column(nullable: true), + VictimPositionX = table.Column(nullable: false), + VictimPositionY = table.Column(nullable: false), + VictimPositionZ = table.Column(nullable: false), + VictimHeading = table.Column(nullable: false), + KillerPositionX = table.Column(nullable: false), + KillerPositionY = table.Column(nullable: false), + KillerPositionZ = table.Column(nullable: false), + KillerHeading = table.Column(nullable: false), + CauseOfDeath = table.Column(maxLength: 64, nullable: true), + Timestamp = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_DeathLogs", x => x.Id); + table.ForeignKey( + name: "FK_DeathLogs_Users_KillerId", + column: x => x.KillerId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_DeathLogs_Users_VictimId", + column: x => x.VictimId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Houses", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Type = table.Column(nullable: true), + Price = table.Column(nullable: false), + X = table.Column(nullable: false), + Y = table.Column(nullable: false), + Z = table.Column(nullable: false), + RentalFee = table.Column(nullable: false), + CanRentIn = table.Column(nullable: false), + OwnerId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Houses", x => x.Id); + table.ForeignKey( + name: "FK_Houses_Users_OwnerId", + column: x => x.OwnerId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "News", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: true), + Caption = table.Column(nullable: true), + Content = table.Column(nullable: true), + Active = table.Column(nullable: false), + Timestamp = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_News", x => x.Id); + table.ForeignKey( + name: "FK_News_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ServerVehicles", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Model = table.Column(nullable: false), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + Heading = table.Column(nullable: false), + NumberPlate = table.Column(maxLength: 8, nullable: true), + PrimaryColor = table.Column(nullable: false), + SecondaryColor = table.Column(nullable: false), + Locked = table.Column(nullable: false), + Active = table.Column(nullable: false, defaultValue: true), + DistanceDriven = table.Column(nullable: false), + TankAmount = table.Column(nullable: false), + Livery = table.Column(nullable: false), + Discriminator = table.Column(nullable: false), + FactionId = table.Column(nullable: true), + GroupId = table.Column(nullable: true), + JobId = table.Column(nullable: true), + BusinessId = table.Column(nullable: true), + Price = table.Column(nullable: true), + UserId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_ServerVehicles", x => x.Id); + table.ForeignKey( + name: "FK_ServerVehicles_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ServerVehicles_Groups_GroupId", + column: x => x.GroupId, + principalTable: "Groups", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ServerVehicles_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "UserBankAccounts", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: false), + Bic = table.Column(maxLength: 12, nullable: true), + Iban = table.Column(maxLength: 32, nullable: true), + Balance = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UserBankAccounts", x => x.Id); + table.ForeignKey( + name: "FK_UserBankAccounts_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "UserItems", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ItemId = table.Column(nullable: false), + UserId = table.Column(nullable: false), + Amount = table.Column(nullable: false), + Slot = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UserItems", x => x.Id); + table.ForeignKey( + name: "FK_UserItems_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "HouseRentals", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + HouseId = table.Column(nullable: true), + UserId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_HouseRentals", x => x.Id); + table.ForeignKey( + name: "FK_HouseRentals_Houses_HouseId", + column: x => x.HouseId, + principalTable: "Houses", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_HouseRentals_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "VehicleItems", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ItemId = table.Column(nullable: false), + VehicleId = table.Column(nullable: false), + Amount = table.Column(nullable: false), + Slot = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_VehicleItems", x => x.Id); + table.ForeignKey( + name: "FK_VehicleItems_ServerVehicles_VehicleId", + column: x => x.VehicleId, + principalTable: "ServerVehicles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "VehicleMods", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ServerVehicleId = table.Column(nullable: false), + Slot = table.Column(nullable: false), + ModId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_VehicleMods", x => x.Id); + table.ForeignKey( + name: "FK_VehicleMods_ServerVehicles_ServerVehicleId", + column: x => x.ServerVehicleId, + principalTable: "ServerVehicles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_Bans_UserId", + table: "Bans", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_BusinessBankAccounts_BusinessId", + table: "BusinessBankAccounts", + column: "BusinessId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_BusRoutesPoints_BusRouteId", + table: "BusRoutesPoints", + column: "BusRouteId"); + + migrationBuilder.CreateIndex( + name: "IX_CharacterClothes_UserId", + table: "CharacterClothes", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Characters_UserId", + table: "Characters", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_DeathLogs_KillerId", + table: "DeathLogs", + column: "KillerId"); + + migrationBuilder.CreateIndex( + name: "IX_DeathLogs_VictimId", + table: "DeathLogs", + column: "VictimId"); + + migrationBuilder.CreateIndex( + name: "IX_Doors_FactionId", + table: "Doors", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_DutyClothes_FactionId", + table: "DutyClothes", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_FactionBankAccounts_FactionId", + table: "FactionBankAccounts", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_FactionRanks_FactionId", + table: "FactionRanks", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_FactionWeapons_FactionId", + table: "FactionWeapons", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_GroupBankAccounts_GroupId", + table: "GroupBankAccounts", + column: "GroupId"); + + migrationBuilder.CreateIndex( + name: "IX_HouseRentals_HouseId", + table: "HouseRentals", + column: "HouseId"); + + migrationBuilder.CreateIndex( + name: "IX_HouseRentals_UserId", + table: "HouseRentals", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Houses_OwnerId", + table: "Houses", + column: "OwnerId"); + + migrationBuilder.CreateIndex( + name: "IX_News_UserId", + table: "News", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_ServerVehicles_FactionId", + table: "ServerVehicles", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_ServerVehicles_GroupId", + table: "ServerVehicles", + column: "GroupId"); + + migrationBuilder.CreateIndex( + name: "IX_ServerVehicles_UserId", + table: "ServerVehicles", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_UserBankAccounts_UserId", + table: "UserBankAccounts", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_UserItems_UserId", + table: "UserItems", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_BanId", + table: "Users", + column: "BanId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_BusinessId", + table: "Users", + column: "BusinessId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Users_CharacterId", + table: "Users", + column: "CharacterId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_FactionId", + table: "Users", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_FactionRankId", + table: "Users", + column: "FactionRankId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_GroupId", + table: "Users", + column: "GroupId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_HouseId", + table: "Users", + column: "HouseId"); + + migrationBuilder.CreateIndex( + name: "IX_VehicleItems_VehicleId", + table: "VehicleItems", + column: "VehicleId"); + + migrationBuilder.CreateIndex( + name: "IX_VehicleMods_ServerVehicleId_Slot", + table: "VehicleMods", + columns: new[] { "ServerVehicleId", "Slot" }, + unique: true); + + migrationBuilder.AddForeignKey( + name: "FK_Users_Houses_HouseId", + table: "Users", + column: "HouseId", + principalTable: "Houses", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Users_Bans_BanId", + table: "Users", + column: "BanId", + principalTable: "Bans", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Users_Characters_CharacterId", + table: "Users", + column: "CharacterId", + principalTable: "Characters", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Bans_Users_UserId", + table: "Bans"); + + migrationBuilder.DropForeignKey( + name: "FK_Characters_Users_UserId", + table: "Characters"); + + migrationBuilder.DropForeignKey( + name: "FK_Houses_Users_OwnerId", + table: "Houses"); + + migrationBuilder.DropTable( + name: "ATMs"); + + migrationBuilder.DropTable( + name: "BankAccountTransactionLogs"); + + migrationBuilder.DropTable( + name: "Blips"); + + migrationBuilder.DropTable( + name: "BusinessBankAccounts"); + + migrationBuilder.DropTable( + name: "BusinessData"); + + migrationBuilder.DropTable( + name: "BusRoutesPoints"); + + migrationBuilder.DropTable( + name: "CharacterClothes"); + + migrationBuilder.DropTable( + name: "ClothCombinations"); + + migrationBuilder.DropTable( + name: "DeathLogs"); + + migrationBuilder.DropTable( + name: "Doors"); + + migrationBuilder.DropTable( + name: "DutyClothes"); + + migrationBuilder.DropTable( + name: "FactionBankAccounts"); + + migrationBuilder.DropTable( + name: "FactionWeapons"); + + migrationBuilder.DropTable( + name: "GotoPoints"); + + migrationBuilder.DropTable( + name: "GroupBankAccounts"); + + migrationBuilder.DropTable( + name: "HouseRentals"); + + migrationBuilder.DropTable( + name: "Interiors"); + + migrationBuilder.DropTable( + name: "Markers"); + + migrationBuilder.DropTable( + name: "News"); + + migrationBuilder.DropTable( + name: "Peds"); + + migrationBuilder.DropTable( + name: "Pickups"); + + migrationBuilder.DropTable( + name: "TextLabels"); + + migrationBuilder.DropTable( + name: "TuningGarages"); + + migrationBuilder.DropTable( + name: "UserBankAccounts"); + + migrationBuilder.DropTable( + name: "UserItems"); + + migrationBuilder.DropTable( + name: "VehicleItems"); + + migrationBuilder.DropTable( + name: "VehicleMods"); + + migrationBuilder.DropTable( + name: "WhitelistEntries"); + + migrationBuilder.DropTable( + name: "BusRoutes"); + + migrationBuilder.DropTable( + name: "ServerVehicles"); + + migrationBuilder.DropTable( + name: "Users"); + + migrationBuilder.DropTable( + name: "Bans"); + + migrationBuilder.DropTable( + name: "Characters"); + + migrationBuilder.DropTable( + name: "FactionRanks"); + + migrationBuilder.DropTable( + name: "Groups"); + + migrationBuilder.DropTable( + name: "Houses"); + + migrationBuilder.DropTable( + name: "Factions"); + } + } } diff --git a/ReallifeGamemode.Database/Migrations/20190922163450_WeaponDealTimer.cs b/ReallifeGamemode.Database/Migrations/20190922163450_WeaponDealTimer.cs index 625a83bd..c0b374d6 100644 --- a/ReallifeGamemode.Database/Migrations/20190922163450_WeaponDealTimer.cs +++ b/ReallifeGamemode.Database/Migrations/20190922163450_WeaponDealTimer.cs @@ -2,34 +2,34 @@ namespace ReallifeGamemode.Database.Migrations { - public partial class WeaponDealTimer : Migration + public partial class WeaponDealTimer : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "WeaponDealTime", - table: "Factions", - nullable: false, - defaultValue: 0); + migrationBuilder.AddColumn( + name: "WeaponDealTime", + table: "Factions", + nullable: false, + defaultValue: 0); - migrationBuilder.AlterColumn( - name: "PaydayTimer", - table: "Users", - nullable: false, - defaultValue: 60); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "WeaponDealTime", - table: "Factions"); - - migrationBuilder.AlterColumn( - name: "PaydayTimer", - table: "Users", - nullable: false, - defaultValue: 0); - } + migrationBuilder.AlterColumn( + name: "PaydayTimer", + table: "Users", + nullable: false, + defaultValue: 60); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "WeaponDealTime", + table: "Factions"); + + migrationBuilder.AlterColumn( + name: "PaydayTimer", + table: "Users", + nullable: false, + defaultValue: 0); + } + } } diff --git a/ReallifeGamemode.Database/Migrations/20190929200617_SavedLocations.cs b/ReallifeGamemode.Database/Migrations/20190929200617_SavedLocations.cs index 4b7dd759..b313d67e 100644 --- a/ReallifeGamemode.Database/Migrations/20190929200617_SavedLocations.cs +++ b/ReallifeGamemode.Database/Migrations/20190929200617_SavedLocations.cs @@ -3,31 +3,31 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { - public partial class SavedLocations : Migration + public partial class SavedLocations : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Locations", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Description = table.Column(nullable: true), - X = table.Column(nullable: false), - Y = table.Column(nullable: false), - Z = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Locations", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Locations"); - } + migrationBuilder.CreateTable( + name: "Locations", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Description = table.Column(nullable: true), + X = table.Column(nullable: false), + Y = table.Column(nullable: false), + Z = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Locations", x => x.Id); + }); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Locations"); + } + } } diff --git a/ReallifeGamemode.Database/Migrations/20190929202101_FactionWeaponAmount.cs b/ReallifeGamemode.Database/Migrations/20190929202101_FactionWeaponAmount.cs index 12589381..489b3a87 100644 --- a/ReallifeGamemode.Database/Migrations/20190929202101_FactionWeaponAmount.cs +++ b/ReallifeGamemode.Database/Migrations/20190929202101_FactionWeaponAmount.cs @@ -2,22 +2,22 @@ namespace ReallifeGamemode.Database.Migrations { - public partial class FactionWeaponAmount : Migration + public partial class FactionWeaponAmount : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Ammount", - table: "FactionWeapons", - nullable: false, - defaultValue: 0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Ammount", - table: "FactionWeapons"); - } + migrationBuilder.AddColumn( + name: "Ammount", + table: "FactionWeapons", + nullable: false, + defaultValue: 0); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Ammount", + table: "FactionWeapons"); + } + } } diff --git a/ReallifeGamemode.Database/Migrations/20190929202856_SavedLocationsHeading.cs b/ReallifeGamemode.Database/Migrations/20190929202856_SavedLocationsHeading.cs index 5208a6c6..2c191f49 100644 --- a/ReallifeGamemode.Database/Migrations/20190929202856_SavedLocationsHeading.cs +++ b/ReallifeGamemode.Database/Migrations/20190929202856_SavedLocationsHeading.cs @@ -2,22 +2,22 @@ namespace ReallifeGamemode.Database.Migrations { - public partial class SavedLocationsHeading : Migration + public partial class SavedLocationsHeading : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Heading", - table: "Locations", - nullable: false, - defaultValue: 0.0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Heading", - table: "Locations"); - } + migrationBuilder.AddColumn( + name: "Heading", + table: "Locations", + nullable: false, + defaultValue: 0.0); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Heading", + table: "Locations"); + } + } } diff --git a/ReallifeGamemode.Database/Migrations/20191017200636_gtavdev-db.cs b/ReallifeGamemode.Database/Migrations/20191017200636_gtavdev-db.cs index 90b739f7..d9d07177 100644 --- a/ReallifeGamemode.Database/Migrations/20191017200636_gtavdev-db.cs +++ b/ReallifeGamemode.Database/Migrations/20191017200636_gtavdev-db.cs @@ -2,16 +2,16 @@ namespace ReallifeGamemode.Database.Migrations { - public partial class gtavdevdb : Migration + public partial class gtavdevdb : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } } diff --git a/ReallifeGamemode.Database/Migrations/20191030183018_DriverLicenseVehicle.cs b/ReallifeGamemode.Database/Migrations/20191030183018_DriverLicenseVehicle.cs index 1108acd2..ca74fc33 100644 --- a/ReallifeGamemode.Database/Migrations/20191030183018_DriverLicenseVehicle.cs +++ b/ReallifeGamemode.Database/Migrations/20191030183018_DriverLicenseVehicle.cs @@ -2,22 +2,22 @@ namespace ReallifeGamemode.Database.Migrations { - public partial class DriverLicenseVehicle : Migration + public partial class DriverLicenseVehicle : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DriverLicenseVehicle", - table: "Users", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "DriverLicenseVehicle", - table: "Users"); - } + migrationBuilder.AddColumn( + name: "DriverLicenseVehicle", + table: "Users", + nullable: false, + defaultValue: false); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "DriverLicenseVehicle", + table: "Users"); + } + } } diff --git a/ReallifeGamemode.Database/Migrations/20191030203114_FlyingLicensePlane.cs b/ReallifeGamemode.Database/Migrations/20191030203114_FlyingLicensePlane.cs index 65b57f33..0ec29ed8 100644 --- a/ReallifeGamemode.Database/Migrations/20191030203114_FlyingLicensePlane.cs +++ b/ReallifeGamemode.Database/Migrations/20191030203114_FlyingLicensePlane.cs @@ -2,22 +2,22 @@ namespace ReallifeGamemode.Database.Migrations { - public partial class FlyingLicensePlane : Migration + public partial class FlyingLicensePlane : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "FlyingLicensePlane", - table: "Users", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "FlyingLicensePlane", - table: "Users"); - } + migrationBuilder.AddColumn( + name: "FlyingLicensePlane", + table: "Users", + nullable: false, + defaultValue: false); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "FlyingLicensePlane", + table: "Users"); + } + } } diff --git a/ReallifeGamemode.Database/Migrations/20191101144543_SchoolId.cs b/ReallifeGamemode.Database/Migrations/20191101144543_SchoolId.cs index 8e75b8c8..8aa63d51 100644 --- a/ReallifeGamemode.Database/Migrations/20191101144543_SchoolId.cs +++ b/ReallifeGamemode.Database/Migrations/20191101144543_SchoolId.cs @@ -2,21 +2,21 @@ namespace ReallifeGamemode.Database.Migrations { - public partial class SchoolId : Migration + public partial class SchoolId : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "SchoolId", - table: "ServerVehicles", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "SchoolId", - table: "ServerVehicles"); - } + migrationBuilder.AddColumn( + name: "SchoolId", + table: "ServerVehicles", + nullable: true); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "SchoolId", + table: "ServerVehicles"); + } + } } diff --git a/ReallifeGamemode.Database/Migrations/20191101204247_DriverLicenseBike.cs b/ReallifeGamemode.Database/Migrations/20191101204247_DriverLicenseBike.cs index d8dd80d7..a9592c1e 100644 --- a/ReallifeGamemode.Database/Migrations/20191101204247_DriverLicenseBike.cs +++ b/ReallifeGamemode.Database/Migrations/20191101204247_DriverLicenseBike.cs @@ -2,22 +2,22 @@ namespace ReallifeGamemode.Database.Migrations { - public partial class DriverLicenseBike : Migration + public partial class DriverLicenseBike : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DriverLicenseBike", - table: "Users", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "DriverLicenseBike", - table: "Users"); - } + migrationBuilder.AddColumn( + name: "DriverLicenseBike", + table: "Users", + nullable: false, + defaultValue: false); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "DriverLicenseBike", + table: "Users"); + } + } } diff --git a/ReallifeGamemode.Database/Migrations/20191129201024_Turfs.cs b/ReallifeGamemode.Database/Migrations/20191129201024_Turfs.cs index 1be7cde2..a3c88778 100644 --- a/ReallifeGamemode.Database/Migrations/20191129201024_Turfs.cs +++ b/ReallifeGamemode.Database/Migrations/20191129201024_Turfs.cs @@ -3,35 +3,35 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { - public partial class Turfs : Migration + public partial class Turfs : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Turfs", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - FactionId = table.Column(nullable: true), - Owner = table.Column(nullable: true), - Name = table.Column(nullable: true), - X = table.Column(nullable: false), - Y = table.Column(nullable: false), - Rotation = table.Column(nullable: false), - Range = table.Column(nullable: false), - Color = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Turfs", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Turfs"); - } + migrationBuilder.CreateTable( + name: "Turfs", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + FactionId = table.Column(nullable: true), + Owner = table.Column(nullable: true), + Name = table.Column(nullable: true), + X = table.Column(nullable: false), + Y = table.Column(nullable: false), + Rotation = table.Column(nullable: false), + Range = table.Column(nullable: false), + Color = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Turfs", x => x.Id); + }); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Turfs"); + } + } } diff --git a/ReallifeGamemode.Server/Business/BusinessBase.cs b/ReallifeGamemode.Server/Business/BusinessBase.cs index 769b0488..f6d5ec68 100644 --- a/ReallifeGamemode.Server/Business/BusinessBase.cs +++ b/ReallifeGamemode.Server/Business/BusinessBase.cs @@ -69,7 +69,7 @@ namespace ReallifeGamemode.Server.Business BusinessData data = GetData(); - if(data == null) + if (data == null) { using (var dbContext = new DatabaseContext()) { @@ -93,7 +93,7 @@ namespace ReallifeGamemode.Server.Business public BusinessData GetData(DatabaseContext dbContext = null) { - if(dbContext == null) + if (dbContext == null) { using (dbContext = new DatabaseContext()) { diff --git a/ReallifeGamemode.Server/Business/HelicopterDealerBusiness.cs b/ReallifeGamemode.Server/Business/HelicopterDealerBusiness.cs index a417973f..91677561 100644 --- a/ReallifeGamemode.Server/Business/HelicopterDealerBusiness.cs +++ b/ReallifeGamemode.Server/Business/HelicopterDealerBusiness.cs @@ -11,9 +11,9 @@ namespace ReallifeGamemode.Server.Business public override string Name => "Helikopter Shop"; - public override Vector3 Position => new Vector3(-700.6019,- 1401.571, 5.495285); + public override Vector3 Position => new Vector3(-700.6019, -1401.571, 5.495285); - public override Vector3 CarSpawnPositon => new Vector3(-745.4077, - 1468.357, 5.00052); + public override Vector3 CarSpawnPositon => new Vector3(-745.4077, -1468.357, 5.00052); public override float CarSpawnHeading => 356.6f; diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index d71b4205..d5926b3c 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1951,7 +1951,7 @@ namespace ReallifeGamemode.Server.Commands ChatService.SendMessage(player, "~m~Benutzung: ~s~/save schoolvehicle [FahrschuleID]"); return; } - if(drivingSchoolId > 2 || drivingSchoolId < 0) + if (drivingSchoolId > 2 || drivingSchoolId < 0) { ChatService.SendMessage(player, "~m~Diese Fahrschule existiert nicht."); return; @@ -1965,13 +1965,13 @@ namespace ReallifeGamemode.Server.Commands break; case "location": - if(option1 == null || option1.Length < 0) + if (option1 == null || option1.Length < 0) { ChatService.SendMessage(player, "~m~Benutzung: ~s~/save location [Beschreibung]"); return; } - using(var dbContext = new DatabaseContext()) + using (var dbContext = new DatabaseContext()) { dbContext.Locations.Add(new Location { @@ -2384,7 +2384,7 @@ namespace ReallifeGamemode.Server.Commands return; } - if(modifier < 0) + if (modifier < 0) { ChatService.ErrorMessage(player, "Es muss positives Adminspeed angegeben werden"); return; @@ -2989,7 +2989,7 @@ namespace ReallifeGamemode.Server.Commands BusinessBase business = BusinessManager.GetNearBusiness(player); - if(business == null) + if (business == null) { ChatService.ErrorMessage(player, "In deiner Nähe ist kein Business"); return; @@ -2998,7 +2998,7 @@ namespace ReallifeGamemode.Server.Commands switch (option.ToLower()) { case "price": - if(!int.TryParse(option1, out int price)) + if (!int.TryParse(option1, out int price)) { ChatService.ErrorMessage(player, "Es muss ein gültiger Preis angegeben werden"); return; diff --git a/ReallifeGamemode.Server/Commands/UserCommands.cs b/ReallifeGamemode.Server/Commands/UserCommands.cs index c8b95964..bbb41131 100644 --- a/ReallifeGamemode.Server/Commands/UserCommands.cs +++ b/ReallifeGamemode.Server/Commands/UserCommands.cs @@ -27,7 +27,7 @@ namespace ReallifeGamemode.Server.Commands if (!managedClient.IsLoggedIn()) return; ChatService.SendMessage(managedClient, "* " + player.Name + " hat eine " + number + " gewürfelt."); } - } + } [Command("car", "~m~Benutzung: ~s~/car")] public void CmdUserCar(Client player) diff --git a/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs b/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs index 801055e7..a8e834ef 100644 --- a/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs +++ b/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs @@ -82,10 +82,10 @@ namespace ReallifeGamemode.Server.DrivingSchool }.AsReadOnly(); private readonly IReadOnlyCollection StopCar = new List { - new Vector3(-788.66, -1278.75, 4), + new Vector3(-788.66, -1278.75, 4), }.AsReadOnly(); - + public static void Setup() { informationLabel = NAPI.TextLabel.CreateTextLabel("Fahrschule\n~y~Auto ~s~- $~g~2500\n~y~Motorrad ~s~- $~g~3500", new Vector3(-813.17, -1354.5, 5.14), 20.0f, 1.3f, 0, new Color(255, 255, 255)); @@ -148,7 +148,7 @@ namespace ReallifeGamemode.Server.DrivingSchool user.TriggerEvent("stopTimer"); CheckPointHandle.StartCheckPointRoute(user, DrivingRoute, 0, 1, 7, "drivingSchoolEvent"); } - if(schoolVehicle.SchoolId == 2 && user.IsInVehicle) + if (schoolVehicle.SchoolId == 2 && user.IsInVehicle) { user.TriggerEvent("renderTextOnScreen", "Gut nun kann die Prüfung losgehen."); user.TriggerEvent("stopTimer"); @@ -202,7 +202,7 @@ namespace ReallifeGamemode.Server.DrivingSchool { user.TriggerEvent("renderTextOnScreen", "Parke nun das Auto an der markierten Stelle."); CheckPointHandle.StartCheckPointRoute(user, StopCar, 5000, 1, 7, "drivingSchoolEventEnd"); - } + } } diff --git a/ReallifeGamemode.Server/DrivingSchool/PlaneSchool.cs b/ReallifeGamemode.Server/DrivingSchool/PlaneSchool.cs index fb3a1573..c0ac38cc 100644 --- a/ReallifeGamemode.Server/DrivingSchool/PlaneSchool.cs +++ b/ReallifeGamemode.Server/DrivingSchool/PlaneSchool.cs @@ -72,7 +72,7 @@ namespace ReallifeGamemode.Server.DrivingSchool public void StartplaneSchool(Client client) { User user = client.GetUser(); - + if (user.FlyingLicensePlane || client.HasData("ActiveSchool")) return; @@ -101,7 +101,7 @@ namespace ReallifeGamemode.Server.DrivingSchool if (veh.GetServerVehicle() is SchoolVehicle schoolVehicle) { - if(schoolVehicle.SchoolId == 1) + if (schoolVehicle.SchoolId == 1) { user.TriggerEvent("renderTextOnScreen", "Fahren Sie langsam und sicher zur Roten Markierung."); user.TriggerEvent("stopTimer"); @@ -178,10 +178,10 @@ namespace ReallifeGamemode.Server.DrivingSchool CheckPointHandle.StartCheckPointRoute(user, planeRouteEnd, 5000, 6, 12, "planeSchoolEventEnd"); break; - + } } - + } } diff --git a/ReallifeGamemode.Server/Events/Connect.cs b/ReallifeGamemode.Server/Events/Connect.cs index e555a721..704ed08c 100644 --- a/ReallifeGamemode.Server/Events/Connect.cs +++ b/ReallifeGamemode.Server/Events/Connect.cs @@ -23,8 +23,8 @@ namespace ReallifeGamemode.Server.Events player.SetData("isLoggedIn", false); player.Position = new Vector3(-1883.736, -781.4911, -10); player.FreezePosition = true; - - + + using (var dbContext = new DatabaseContext()) { if (!dbContext.WhitelistEntries.Any(w => w.SocialClubName.ToLower() == player.SocialClubName.ToLower())) @@ -40,7 +40,7 @@ namespace ReallifeGamemode.Server.Events return; } } - + if (IsPlayerBanned(player)) return; player.TriggerEvent("SERVER:Login_ShowBrowser"); diff --git a/ReallifeGamemode.Server/Events/Death.cs b/ReallifeGamemode.Server/Events/Death.cs index 3b00e38c..8154e475 100644 --- a/ReallifeGamemode.Server/Events/Death.cs +++ b/ReallifeGamemode.Server/Events/Death.cs @@ -23,11 +23,11 @@ namespace ReallifeGamemode.Server.Events public void OnPlayerDeath(Client player, Client killer, uint reason) { if (!player.IsLoggedIn()) player.Kick(); - player.SetData("isDead", true); + player.SetData("isDead", true); //TODO: Zum Full Release entfernen ChatService.SendMessage(player, "Du bist durch " + killer.Name + " gestorben: " + reason.ToString()); - + int? killerId; float killerPosX; float killerPosY; @@ -49,7 +49,7 @@ namespace ReallifeGamemode.Server.Events killerPosY = killer.Position.Y; killerPosZ = killer.Position.Z; killerHeading = killer.Heading; - if(player.HasData("inGangWar") && killer.HasData("inGangWar")) + if (player.HasData("inGangWar") && killer.HasData("inGangWar")) { Gangwar.Gangwar.GangwarKill(killer, player); } @@ -57,13 +57,13 @@ namespace ReallifeGamemode.Server.Events if (player != killer) { Autowanted.Check_AutoWanted(killer, player); - string message = "~y~[HINWEIS]: " + killer.Name + " hat " + player.Name + " getötet (" + Managers.WeaponManager.GetCauseOfDeathByHash(reason)+ ")"; + string message = "~y~[HINWEIS]: " + killer.Name + " hat " + player.Name + " getötet (" + Managers.WeaponManager.GetCauseOfDeathByHash(reason) + ")"; ChatService.BroadcastAdmin(message, AdminLevel.ADMIN); } } User user = player.GetUser(); - if(user.JailTime <= 0) + if (user.JailTime <= 0) { //MEDIC AUFTRAG MedicTask reviveTask = new MedicTask() @@ -113,7 +113,7 @@ namespace ReallifeGamemode.Server.Events - + //JailTime.cs Jail.Check_PutBehindBars(player); diff --git a/ReallifeGamemode.Server/Events/Disconnect.cs b/ReallifeGamemode.Server/Events/Disconnect.cs index dc1dc064..8e4157e7 100644 --- a/ReallifeGamemode.Server/Events/Disconnect.cs +++ b/ReallifeGamemode.Server/Events/Disconnect.cs @@ -38,7 +38,7 @@ namespace ReallifeGamemode.Server.Events { NAPI.Util.ConsoleOutput(player.Name + " Timeoutet"); } - + if (GlobalHelper.DutyAdmins.Contains(player)) { GlobalHelper.DutyAdmins.Remove(player); diff --git a/ReallifeGamemode.Server/Events/EnterVehicleAttempt.cs b/ReallifeGamemode.Server/Events/EnterVehicleAttempt.cs index ec4bb6ae..70154241 100644 --- a/ReallifeGamemode.Server/Events/EnterVehicleAttempt.cs +++ b/ReallifeGamemode.Server/Events/EnterVehicleAttempt.cs @@ -29,7 +29,7 @@ namespace ReallifeGamemode.Server.Events if ((VehicleHash)vehicle.Model == VehicleHash.Burrito3) { if (WeaponDealManager.checkWeaponDbyVehicle(vehicle)) - return; + return; } player.StopAnimation(); player.SendNotification("~r~Du darfst dieses Fahrzeug nicht benutzen!", true); diff --git a/ReallifeGamemode.Server/Events/ExitVehicle.cs b/ReallifeGamemode.Server/Events/ExitVehicle.cs index 2a680359..af54459b 100644 --- a/ReallifeGamemode.Server/Events/ExitVehicle.cs +++ b/ReallifeGamemode.Server/Events/ExitVehicle.cs @@ -10,7 +10,7 @@ using ReallifeGamemode.Server.WeaponDeal; namespace ReallifeGamemode.Server.Events { - public class ExitVehicle:Script + public class ExitVehicle : Script { [ServerEvent(Event.PlayerExitVehicleAttempt)] public void OnPlayerExitVehicle(Client client, GTANetworkAPI.Vehicle vehicle) diff --git a/ReallifeGamemode.Server/Events/Inventory.cs b/ReallifeGamemode.Server/Events/Inventory.cs index 6cf36353..4064a6be 100644 --- a/ReallifeGamemode.Server/Events/Inventory.cs +++ b/ReallifeGamemode.Server/Events/Inventory.cs @@ -32,12 +32,12 @@ namespace ReallifeGamemode.Server.Events { vehicleInventory = getVehItem(veh); } - client.TriggerEvent("setVehiclesInventory", vehicleInventory.ToArray()); + client.TriggerEvent("setVehiclesInventory", vehicleInventory.ToArray()); return; } } - } - } + } + } } public List getVehItem(GTANetworkAPI.Vehicle veh) diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index a25b859d..7e2db916 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -113,7 +113,7 @@ namespace ReallifeGamemode.Server.Events if (Economy.Paychecks.ContainsKey(u.Id)) paycheck = Economy.Paychecks[u.Id]; Licenses licenses = new Licenses(u.DriverLicenseVehicle, u.DriverLicenseBike, u.FlyingLicensePlane); - + var accountData = new { regDate = u.RegistrationDate.ToShortDateString(), @@ -140,7 +140,7 @@ namespace ReallifeGamemode.Server.Events { if (!player.IsLoggedIn()) return; var user = player.GetUser(); - + if (user?.FactionId != null) { @@ -245,13 +245,13 @@ namespace ReallifeGamemode.Server.Events using (var context = new DatabaseContext()) { - + List fItem = context.UserItems.Where(u => u.UserId == user.Id).ToList(); - foreach(var item in fItem) + foreach (var item in fItem) { IItem iItem = InventoryManager.GetItemById(item.ItemId); - if(iItem is IWeaponDealItem obj) + if (iItem is IWeaponDealItem obj) { FactionWeapon weapon = context.FactionWeapons.Where(w => w.FactionId == user.FactionId && w.WeaponModel == iItem.Name).FirstOrDefault(); if (weapon == null) @@ -267,7 +267,7 @@ namespace ReallifeGamemode.Server.Events Database.Entities.Faction faction = context.Factions.Where(fac => fac.Id == user.FactionId).FirstOrDefault(); if (faction.WeaponDealTime > 0) - dealTime = "noch " + faction.WeaponDealTime.ToString()+" min. übrig"; + dealTime = "noch " + faction.WeaponDealTime.ToString() + " min. übrig"; timer.Add(dealTime); @@ -296,7 +296,7 @@ namespace ReallifeGamemode.Server.Events } } } - + player.TriggerEvent("showWeaponMenu", primarys.ToArray(), secondarys.ToArray(), melees.ToArray(), specials.ToArray(), JsonConvert.SerializeObject(timer.ToArray())); } if (nearestJailReleasePoint != null) @@ -309,16 +309,16 @@ namespace ReallifeGamemode.Server.Events if (c.JailTime > 0) { criminals.Add(c.Name); - } + } } player.TriggerEvent("showJailMenu", JsonConvert.SerializeObject(criminals.ToArray())); } if (nearestElevatorPoint != null) { List stages = new List(); - foreach(var e in PositionManager.ElevatorPoints) + foreach (var e in PositionManager.ElevatorPoints) { - if(e.Position.DistanceTo2D(player.Position) <= 25 && e.Position.DistanceTo(player.Position) > 1.5) + if (e.Position.DistanceTo2D(player.Position) <= 25 && e.Position.DistanceTo(player.Position) > 1.5) { stages.Add(e.Stage); } diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index 4aeb4f21..1e485fef 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -58,7 +58,7 @@ namespace ReallifeGamemode.Server.Events player.SetData("editmode", false); player.SetData("quicksavemode", "none"); } - + var userBankAccount = user.GetBankAccount(); userBankAccount.Balance = userBankAccount.Balance; @@ -73,9 +73,10 @@ namespace ReallifeGamemode.Server.Events if (GlobalHelper.CustomJoinMessages.ContainsKey(player.SocialClubName)) { ChatService.BroadcastAdmin("!{#FFFF00}*** " + GlobalHelper.CustomJoinMessages[player.SocialClubName] + " [ID: " + player.Handle.Value + "] (" + user.AdminLevel.GetName() + ")", AdminLevel.TEAM); - } else if (user.IsAdmin(AdminLevel.TEAM)) + } + else if (user.IsAdmin(AdminLevel.TEAM)) { - ChatService.BroadcastAdmin("!{#FFFF00}*** " + user.Name +" [ID: " + player.Handle.Value + "]" + " hat sich als " + user.AdminLevel.GetName() + " eingeloggt!", AdminLevel.TEAM); + ChatService.BroadcastAdmin("!{#FFFF00}*** " + user.Name + " [ID: " + player.Handle.Value + "]" + " hat sich als " + user.AdminLevel.GetName() + " eingeloggt!", AdminLevel.TEAM); } var userItems = dbContext.UserItems.Where(u => u.UserId == user.Id).ToList(); diff --git a/ReallifeGamemode.Server/Events/UpdateCharacterElevator.cs b/ReallifeGamemode.Server/Events/UpdateCharacterElevator.cs index 87d7cdec..fd37218b 100644 --- a/ReallifeGamemode.Server/Events/UpdateCharacterElevator.cs +++ b/ReallifeGamemode.Server/Events/UpdateCharacterElevator.cs @@ -13,7 +13,7 @@ namespace ReallifeGamemode.Server.Events public void SaveWeaponSelection(Client client, string stage) { ElevatorPoint elevator = PositionManager.ElevatorPoints.Find(e => e.Stage == stage); - if(elevator != null) + if (elevator != null) { client.Position = elevator.Position; } diff --git a/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs b/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs index 319612d0..cf510e2e 100644 --- a/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs +++ b/ReallifeGamemode.Server/Events/UpdateCharacterWeapon.cs @@ -12,7 +12,7 @@ namespace ReallifeGamemode.Server.Events [RemoteEvent("updateWeaponSelection")] public void UpdateWeaponSelection(Client client, string weaponModel, int slot) { - if(weaponModel == "Keine") + if (weaponModel == "Keine") { client.RemoveAllWeapons(); return; @@ -38,14 +38,14 @@ namespace ReallifeGamemode.Server.Events if (slot == 4) { client.RemoveAllWeapons(); - client.GiveWeapon(weaponHash, 0); + client.GiveWeapon(weaponHash, 0); } } [RemoteEvent("cancelWeaponSelection")] public void CancelWeaponSelection(Client client) { - client.RemoveAllWeapons(); + client.RemoveAllWeapons(); } @@ -68,12 +68,12 @@ namespace ReallifeGamemode.Server.Events if (meleeModel.Contains("mk2") && !meleeModel.Contains("_mk2")) meleeModel = meleeModel.Replace("mk2", "_mk2"); melee = NAPI.Util.GetHashKey($"weapon_{meleeModel}"); } - + client.GiveWeapon((WeaponHash)primary, 50); client.GiveWeapon((WeaponHash)secondary, 150); client.GiveWeapon((WeaponHash)melee, 1); - if(specialModel != "Schutzweste") + if (specialModel != "Schutzweste") { client.Armor = 0; if (!uint.TryParse(specialModel, out uint special)) @@ -87,8 +87,8 @@ namespace ReallifeGamemode.Server.Events { client.Armor = 50; } - - using(var context = new DatabaseContext()) + + using (var context = new DatabaseContext()) { User user = client.GetUser(); FactionWeapon slot1 = context.FactionWeapons.Where(w => w.FactionId == user.FactionId && w.WeaponModel == primaryModel).FirstOrDefault(); diff --git a/ReallifeGamemode.Server/Events/Vehicle.cs b/ReallifeGamemode.Server/Events/Vehicle.cs index fb28184b..99310ad4 100644 --- a/ReallifeGamemode.Server/Events/Vehicle.cs +++ b/ReallifeGamemode.Server/Events/Vehicle.cs @@ -202,7 +202,7 @@ namespace ReallifeGamemode.Server.Events [ServerEvent(Event.VehicleDeath)] public void VehicleDeathEvent(GTANetworkAPI.Vehicle veh) { - + } } } diff --git a/ReallifeGamemode.Server/Extensions/ClientExtension.cs b/ReallifeGamemode.Server/Extensions/ClientExtension.cs index c2f2529a..1a71f1c6 100644 --- a/ReallifeGamemode.Server/Extensions/ClientExtension.cs +++ b/ReallifeGamemode.Server/Extensions/ClientExtension.cs @@ -111,18 +111,18 @@ namespace ReallifeGamemode.Server.Extensions foreach (var copPlayer in NAPI.Pools.GetAllPlayers()) { User copUser = copPlayer.GetUser(); - if(cop != null && (copUser.FactionId == 1 || copUser.FactionId == 3)) + if (cop != null && (copUser.FactionId == 1 || copUser.FactionId == 3)) { - ChatService.SendMessage(copPlayer, "!{#8181E9}HQ: Straftat gemeldet von " + cop.Name + " mit Fahndungslevel "+ amount +". Straftäter: "+ user.Name + "."); + ChatService.SendMessage(copPlayer, "!{#8181E9}HQ: Straftat gemeldet von " + cop.Name + " mit Fahndungslevel " + amount + ". Straftäter: " + user.Name + "."); ChatService.SendMessage(copPlayer, "!{#8181E9}HQ: Grund: " + reason + "."); ChatService.SendMessage(copPlayer, "!{#8181E9}HQ: Der Straftäter: " + user.Name + " wird nun mit Fahndungslevel " + newWanteds + " gesucht."); } - else if((copUser.FactionId == 1 || copUser.FactionId == 3) && cop == null) + else if ((copUser.FactionId == 1 || copUser.FactionId == 3) && cop == null) { ChatService.SendMessage(copPlayer, "!{#8181E9}HQ: " + user.Name + " hat eine Straftat begangen. Grund: " + reason + "."); ChatService.SendMessage(copPlayer, "!{#8181E9}HQ: Der Straftäter: " + user.Name + " wird nun mit Fahndungslevel " + newWanteds + " gesucht."); } - } + } } public static FactionRank GetFactionRank(this User user) { diff --git a/ReallifeGamemode.Server/Finance/Economy.cs b/ReallifeGamemode.Server/Finance/Economy.cs index 50696569..ce56d218 100644 --- a/ReallifeGamemode.Server/Finance/Economy.cs +++ b/ReallifeGamemode.Server/Finance/Economy.cs @@ -168,7 +168,7 @@ namespace ReallifeGamemode.Server.Finance Paychecks[user.Id] = paycheck; ReleasePayDay(client, paycheck); } - + private static int GetRentalFees(Client client) { using (var dbContext = new DatabaseContext()) diff --git a/ReallifeGamemode.Server/Gangwar/Gangwar.cs b/ReallifeGamemode.Server/Gangwar/Gangwar.cs index 0270af4e..9782e6c3 100644 --- a/ReallifeGamemode.Server/Gangwar/Gangwar.cs +++ b/ReallifeGamemode.Server/Gangwar/Gangwar.cs @@ -155,13 +155,13 @@ namespace ReallifeGamemode.Server.Gangwar return; } } - if(client.GetUser().Faction.Name == "Ballas" || client.GetUser().Faction.Name == "Grove") + if (client.GetUser().Faction.Name == "Ballas" || client.GetUser().Faction.Name == "Grove") { foreach (var turf in getTurfs()) { - foreach(var u in turf.playerInside) + foreach (var u in turf.playerInside) { - if(u == client) + if (u == client) { if (turf.Owner != client.GetUser().Faction.Name) turf.attack(client.GetUser().Faction.Name); diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index 621c8ec2..b38db68d 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -14,7 +14,7 @@ namespace ReallifeGamemode.Server.Gangwar { public class Turf { - + public int TurfID { get; set; } public string TurfName { get; set; } public int Color { get; set; } @@ -68,7 +68,7 @@ namespace ReallifeGamemode.Server.Gangwar { return this.Attacker; } - + private void TurfTick() { this.timer = new System.Timers.Timer(1000); @@ -81,7 +81,7 @@ namespace ReallifeGamemode.Server.Gangwar private void Tick(object sender, System.Timers.ElapsedEventArgs e) { - if(this.status == "attack") + if (this.status == "attack") { update(); } @@ -120,16 +120,17 @@ namespace ReallifeGamemode.Server.Gangwar if (this.Def_Score <= 0) { this.takeOver(this.Attacker); - } else if (this.Att_Score <= 0) + } + else if (this.Att_Score <= 0) { this.takeOver(this.Owner); } timerCount += 1; - if(timerCount >= 60) //change to 900 before release + if (timerCount >= 60) //change to 900 before release { this.timer.Stop(); this.timer = null; - if(this.Def_Score > this.Att_Score) + if (this.Def_Score > this.Att_Score) { this.takeOver(this.Owner); this.Att_Score = 0; @@ -137,7 +138,8 @@ namespace ReallifeGamemode.Server.Gangwar { gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0); } - }else if(this.Def_Score < this.Att_Score) + } + else if (this.Def_Score < this.Att_Score) { this.takeOver(this.Attacker); this.Def_Score = 0; @@ -147,7 +149,7 @@ namespace ReallifeGamemode.Server.Gangwar } return; } - else if(this.Def_Score == this.Att_Score) + else if (this.Def_Score == this.Att_Score) { this.takeOver(this.Attacker); this.Def_Score = 0; @@ -177,8 +179,9 @@ namespace ReallifeGamemode.Server.Gangwar return; } } - - if(playerInside.Find(c => c == client) == null) { + + if (playerInside.Find(c => c == client) == null) + { playerInside.Add(client); client.SetData("GotInsideOfTurf", true); } @@ -186,10 +189,10 @@ namespace ReallifeGamemode.Server.Gangwar public void leave(Client client) { - if(playerInside.Find(c => c == client) != null) + if (playerInside.Find(c => c == client) != null) { this.playerInside = this.playerInside.Where(c => c != client).ToList(); - if(this.status != "attack") + if (this.status != "attack") client.ResetData("GotInsideOfTurf"); } } @@ -213,7 +216,7 @@ namespace ReallifeGamemode.Server.Gangwar a.TriggerEvent("CLIENT:loose"); } ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat erfolgreich das Gebiet ~g~" + getName() + "~w~ verteidigt.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault()); - ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat den Angrif auf das Gebiet ~r~" + getName() + "~w~ verloren.", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault()); + ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat den Angrif auf das Gebiet ~r~" + getName() + "~w~ verloren.", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault()); } else if (getOwner() != FactionName) { @@ -239,10 +242,10 @@ namespace ReallifeGamemode.Server.Gangwar turf.FactionId = dbContext.Factions.Where(f => f.Name == this.Owner).FirstOrDefault().Id; dbContext.SaveChanges(); } - + } this.Attacker = null; - foreach(var c in playerInGangwar) + foreach (var c in playerInGangwar) { c.TriggerEvent("CLIENT:setAttackBlip", false, TurfID); c.ResetData("inGangWar"); @@ -255,9 +258,9 @@ namespace ReallifeGamemode.Server.Gangwar public void attack(string attacker) { - if(this.status == "normal") + if (this.status == "normal") { - if(this.timer != null) + if (this.timer != null) { this.timer.Stop(); this.timer = null; @@ -274,7 +277,7 @@ namespace ReallifeGamemode.Server.Gangwar u.TriggerEvent("CLIENT:setAttackBlip", true, TurfID); u.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score); u.SetData("inGangWar", getId()); - ChatService.SendMessage(u, "~y~[GANGWAR]~w~ Die " + getAttacker() + " hat das Gebiet ~y~"+ TurfName +"~w~ der "+ getOwner() +" angegriffen."); + ChatService.SendMessage(u, "~y~[GANGWAR]~w~ Die " + getAttacker() + " hat das Gebiet ~y~" + TurfName + "~w~ der " + getOwner() + " angegriffen."); clientsInGangwar.Add(u); } playerInGangwar = clientsInGangwar.ToArray(); diff --git a/ReallifeGamemode.Server/Job/BusDriverJob.cs b/ReallifeGamemode.Server/Job/BusDriverJob.cs index e528077e..7a0635ad 100644 --- a/ReallifeGamemode.Server/Job/BusDriverJob.cs +++ b/ReallifeGamemode.Server/Job/BusDriverJob.cs @@ -41,11 +41,11 @@ namespace ReallifeGamemode.Server.Job new Vector3(313.7626,-647.1252,27.6658), new Vector3(28.84793,-543.386,34.42649), new Vector3(120.2759,-195.0664,52.98029), - new Vector3(291.5339,-257.244,52.89333), + new Vector3(291.5339,-257.244,52.89333), new Vector3(459.6921,116.3203,97.18157), new Vector3(173.9451,220.1987,104.4178), new Vector3(-327.3175,261.2248,84.86708), - new Vector3(-764.2745,294.4415,84.00808), + new Vector3(-764.2745,294.4415,84.00808), new Vector3(-980.486,275.0842,67.26749), new Vector3(-1031.586,107.9002,51.30307), new Vector3(-489.973,-195.4356,35.59651), @@ -108,7 +108,7 @@ namespace ReallifeGamemode.Server.Job if (veh.DisplayName == "Bus") { listRouteTexts2.Add("Kurz 1"); - listRouteTexts2.Add("Kurz 2");; + listRouteTexts2.Add("Kurz 2"); ; player.TriggerEvent("showPilotRouteMenu", JsonConvert.SerializeObject(listRouteTexts2)); } diff --git a/ReallifeGamemode.Server/Job/PilotJob.cs b/ReallifeGamemode.Server/Job/PilotJob.cs index a166372a..4ae69665 100644 --- a/ReallifeGamemode.Server/Job/PilotJob.cs +++ b/ReallifeGamemode.Server/Job/PilotJob.cs @@ -45,7 +45,7 @@ namespace ReallifeGamemode.Server.Job new Vector3(-1275.95, 342.97, 326.71), }.AsReadOnly(); - private readonly IReadOnlyCollection Route3 = new List + private readonly IReadOnlyCollection Route3 = new List { new Vector3(-850.61, 2181.98, 429.67), new Vector3(-675.89, 1709.52, 462.85), @@ -54,10 +54,10 @@ namespace ReallifeGamemode.Server.Job new Vector3(-2607.08, 2981.38, 454.81), new Vector3(-1771.7, 4241.02, 460.07), new Vector3(1158.77, 4573.67, 455.08), - new Vector3(2028.63, 4842.29, 437.01), + new Vector3(2028.63, 4842.29, 437.01), }.AsReadOnly(); - private readonly IReadOnlyCollection Route4 = new List + private readonly IReadOnlyCollection Route4 = new List { new Vector3(893.99, -3091.43, 326.67), new Vector3(1712.6, -1676.47, 384.2), @@ -69,7 +69,7 @@ namespace ReallifeGamemode.Server.Job new Vector3(-2333.96, 510.26, 660.64), }.AsReadOnly(); - private readonly IReadOnlyCollection Route5 = new List + private readonly IReadOnlyCollection Route5 = new List { new Vector3(-485.68, -2776.08, 204.5), new Vector3(-19.83, -2133.08, 296.04), @@ -113,26 +113,26 @@ namespace ReallifeGamemode.Server.Job List listRouteTexts = new List(); List listRouteTexts2 = new List(); - Vehicle veh = player.Vehicle; + Vehicle veh = player.Vehicle; - if (veh.DisplayName == "Velum") - { + if (veh.DisplayName == "Velum") + { - listRouteTexts2.Add("Route 4"); - listRouteTexts2.Add("Route 5"); - listRouteTexts2.Add("Route 6"); + listRouteTexts2.Add("Route 4"); + listRouteTexts2.Add("Route 5"); + listRouteTexts2.Add("Route 6"); player.TriggerEvent("showPilotRouteMenu", JsonConvert.SerializeObject(listRouteTexts2)); - } - else - { - listRouteTexts.Add("Route 1"); - listRouteTexts.Add("Route 2"); - listRouteTexts.Add("Route 3"); + } + else + { + listRouteTexts.Add("Route 1"); + listRouteTexts.Add("Route 2"); + listRouteTexts.Add("Route 3"); + + player.TriggerEvent("showPilotRouteMenu", JsonConvert.SerializeObject(listRouteTexts)); + } - player.TriggerEvent("showPilotRouteMenu", JsonConvert.SerializeObject(listRouteTexts)); - } - } [RemoteEvent("startPilotRoute")] public void StartPilotRoute(Client player, string type) @@ -159,7 +159,7 @@ namespace ReallifeGamemode.Server.Job } else if (type == "Route 6") { - CheckPointHandle.StartCheckPointRoute(player, Route6, 0, 6,12, ""); + CheckPointHandle.StartCheckPointRoute(player, Route6, 0, 6, 12, ""); } } } diff --git a/ReallifeGamemode.Server/Managers/BusinessManager.cs b/ReallifeGamemode.Server/Managers/BusinessManager.cs index c5e1c60a..f672eeec 100644 --- a/ReallifeGamemode.Server/Managers/BusinessManager.cs +++ b/ReallifeGamemode.Server/Managers/BusinessManager.cs @@ -267,7 +267,7 @@ namespace ReallifeGamemode.Server.Managers { User user = player.GetUser(dbContext); - if(user.Id != business.Id) + if (user.Id != business.Id) { ChatService.ErrorMessage(player, "Dieses Business gehört nicht dir"); return; diff --git a/ReallifeGamemode.Server/Managers/InteractionManager.cs b/ReallifeGamemode.Server/Managers/InteractionManager.cs index bf74479a..3f2f2828 100644 --- a/ReallifeGamemode.Server/Managers/InteractionManager.cs +++ b/ReallifeGamemode.Server/Managers/InteractionManager.cs @@ -144,21 +144,21 @@ namespace ReallifeGamemode.Server.Managers player.SendNotification("~r~Sie besitzen keine Scheine!"); return; } - if (player.Position.DistanceTo(target.Position) > 5) + if (player.Position.DistanceTo(target.Position) > 5) return; if (target.HasData("ShowActive")) { player.SendNotification("Spieler ist beschäftigt."); return; - } + } target.SetData("ShowActive", true); List licenses = new List(); licenses.Add(playerUser.DriverLicenseVehicle); licenses.Add(playerUser.DriverLicenseBike); licenses.Add(playerUser.FlyingLicensePlane); target.TriggerEvent("ShowLicenses", player.Name, licenses.ToArray()); - + } } @@ -267,7 +267,7 @@ namespace ReallifeGamemode.Server.Managers target.GetUser(dbContext).FactionId = null; ChatService.SendMessage(player, "!{02FCFF}Du hast " + target.Name + " aus der Fraktion geworfen."); - ChatService.SendMessage(target, "!{02FCFF}Du wurdest von " + player.Name + " aus der Fraktion geworfen."); + ChatService.SendMessage(target, "!{02FCFF}Du wurdest von " + player.Name + " aus der Fraktion geworfen."); target.SetSharedData("blipColor", 0); dbContext.SaveChanges(); } diff --git a/ReallifeGamemode.Server/Managers/InventoryManager.cs b/ReallifeGamemode.Server/Managers/InventoryManager.cs index e6878845..e56445a0 100644 --- a/ReallifeGamemode.Server/Managers/InventoryManager.cs +++ b/ReallifeGamemode.Server/Managers/InventoryManager.cs @@ -138,7 +138,7 @@ namespace ReallifeGamemode.Server.Managers } - public static int GetVehicleInventoryWeight(Vehicle veh) + public static int GetVehicleInventoryWeight(Vehicle veh) { var inventoryWeight = 0; @@ -229,19 +229,20 @@ namespace ReallifeGamemode.Server.Managers { IItem iItem = GetItemById(vItem.ItemId); - if (GetUserInventoryWeight(client) + (iItem.Gewicht * vItem.Amount) > 40000) + if (GetUserInventoryWeight(client) + (iItem.Gewicht * vItem.Amount) > 40000) { - for(int i = 0; i <= vItem.Amount; i++) + for (int i = 0; i <= vItem.Amount; i++) { - if(GetUserInventoryWeight(client) + (iItem.Gewicht * i) > 40000) { + if (GetUserInventoryWeight(client) + (iItem.Gewicht * i) > 40000) + { vItem.Amount = i - 1; break; } - + } } - if(vItem.Amount == 0) + if (vItem.Amount == 0) { return false; } @@ -282,7 +283,7 @@ namespace ReallifeGamemode.Server.Managers } else if (origin[0] == 0) { - + VehicleItem cItem = new VehicleItem { Amount = vehAmount, @@ -290,7 +291,7 @@ namespace ReallifeGamemode.Server.Managers VehicleId = origin[1], Slot = -1, }; - + UserItem uItem = context.UserItems.Where(u => u.UserId == user.Id && u.ItemId == cItem.ItemId).FirstOrDefault(); IItem iItem = GetItemById(cItem.ItemId); Vehicle veh = VehicleManager.GetVehicleFromId(cItem.VehicleId); @@ -303,7 +304,7 @@ namespace ReallifeGamemode.Server.Managers cItem.Amount = i - 1; break; } - + } } @@ -399,7 +400,7 @@ namespace ReallifeGamemode.Server.Managers [RemoteEvent("saveInventory")] - public void SavePlayerInventory(Client player, string jsonItemID,string jsonItemAmount, string jsonGotFrom, string vehAmount) + public void SavePlayerInventory(Client player, string jsonItemID, string jsonItemAmount, string jsonGotFrom, string vehAmount) { var user = player.GetUser(); @@ -407,34 +408,34 @@ namespace ReallifeGamemode.Server.Managers var itemAmount = JsonConvert.DeserializeObject(jsonItemAmount); var origin = JsonConvert.DeserializeObject(jsonGotFrom); - if (!CheckOriginOfItem(player,jsonItemID, jsonItemAmount,jsonGotFrom, vehAmount)) + if (!CheckOriginOfItem(player, jsonItemID, jsonItemAmount, jsonGotFrom, vehAmount)) return; using (var context = new DatabaseContext()) { - UserItem cItem = new UserItem - { - Amount = itemAmount, - ItemId = itemID, - UserId = user.Id, - Slot = -1, - }; + UserItem cItem = new UserItem + { + Amount = itemAmount, + ItemId = itemID, + UserId = user.Id, + Slot = -1, + }; + - UserItem item = context.UserItems.Where(u => u.UserId == user.Id && u.ItemId == cItem.ItemId).FirstOrDefault(); - if (item == null) - { - context.UserItems.Add(cItem); - } - else if (cItem.Amount <= 0) - { - context.UserItems.Remove(item); - } - else - { - item.Amount = cItem.Amount; - } + if (item == null) + { + context.UserItems.Add(cItem); + } + else if (cItem.Amount <= 0) + { + context.UserItems.Remove(item); + } + else + { + item.Amount = cItem.Amount; + } context.SaveChanges(); IItem iItem = GetItemById(item.ItemId); @@ -511,7 +512,7 @@ namespace ReallifeGamemode.Server.Managers public static void RemoveAllItemsfromVehicleInventory(Vehicle veh) { - using(var context = new DatabaseContext()) + using (var context = new DatabaseContext()) { ServerVehicle sVeh = VehicleManager.GetServerVehicleFromVehicle(veh); List allItemsByVehicle = context.VehicleItems.ToList().FindAll(i => i.VehicleId == sVeh.Id); @@ -614,14 +615,15 @@ namespace ReallifeGamemode.Server.Managers { dropPosition.Z -= 0.8f; grndObject = NAPI.Object.CreateObject(3777723516, dropPosition, new Vector3(0, 0, r.Next(0, 360)), 0); - } + } GroundItem grndItem = new GroundItem { ItemId = iItem.Id, Amount = amount, Position = dropPosition }; TextLabel grndTxtLbl = NAPI.TextLabel.CreateTextLabel(iItem.Name + " ~s~(~y~" + amount + "~s~)", dropPosition, 5, 0.5f, 4, new Color(255, 255, 255), false, 0); GroundItem.AddGroundItem(grndItem, grndObject, grndTxtLbl); - if(fItem.Amount > amount) + if (fItem.Amount > amount) { fItem.Amount -= amount; - }else if(fItem.Amount == amount) + } + else if (fItem.Amount == amount) { context.UserItems.Remove(fItem); } @@ -654,7 +656,7 @@ namespace ReallifeGamemode.Server.Managers int[] itemIdArr = JsonConvert.DeserializeObject(itemIdArrStr); int[] itemAmountArr = JsonConvert.DeserializeObject(itemAmountArrStr); List itemNameList = new List(); - + if (target.HasData("inTrade") && target.GetData("inTrade") == true) { @@ -665,7 +667,7 @@ namespace ReallifeGamemode.Server.Managers using (var context = new DatabaseContext()) { int targetInvWeight = GetUserInventoryWeight(target); - + for (int i = 0; i < itemIdArr.Length; i++) { int itemId = itemIdArr[i]; @@ -813,7 +815,7 @@ namespace ReallifeGamemode.Server.Managers return; } target.SetData("inTrade", false); - + using (var context = new DatabaseContext()) { diff --git a/ReallifeGamemode.Server/Managers/PositionManager.cs b/ReallifeGamemode.Server/Managers/PositionManager.cs index 2173b215..efce3ddb 100644 --- a/ReallifeGamemode.Server/Managers/PositionManager.cs +++ b/ReallifeGamemode.Server/Managers/PositionManager.cs @@ -52,13 +52,13 @@ namespace ReallifeGamemode.Server.Managers #region WeaponPoints WeaponPoint weaponPointLSPD = new WeaponPoint() { - Position = new Vector3(460.3162,-981.0168,30.68959), + Position = new Vector3(460.3162, -981.0168, 30.68959), FactionId = 1 }; WeaponPoint weaponPointFIB = new WeaponPoint() { //Position = new Vector3(119.6835, -729.3273, 242.1519), old - Position = new Vector3(143.5561,-762.7424,242.152), + Position = new Vector3(143.5561, -762.7424, 242.152), FactionId = 3 }; WeaponPoint weaponPointBallas = new WeaponPoint() @@ -91,7 +91,7 @@ namespace ReallifeGamemode.Server.Managers }; JailReleasePoint jailPointFIB = new JailReleasePoint() { - Position = new Vector3(119.6362,-727.6199,242.152) + Position = new Vector3(119.6362, -727.6199, 242.152) }; JailReleasePoints.Add(jailPointLSPD); @@ -110,20 +110,20 @@ namespace ReallifeGamemode.Server.Managers Position = new Vector3(136.1958, -761.657, 242.152), //FBI oben FactionId = 3, Stage = "Büro" - }; + }; ElevatorPoint FibElevatorPointIntern = new ElevatorPoint() { Position = new Vector3(136.1958, -761.7176, 45.75203), //FBI unten FactionId = 3, Stage = "EG" - }; + }; ElevatorPoint FibElevatorPointGarage = new ElevatorPoint() { Position = new Vector3(124.2521, -741.3329, 33.13322), //FBI ganz ganz unten FactionId = 3, Stage = "Garage" }; - + ElevatorPoints.Add(FibElevatorPointEG); ElevatorPoints.Add(FibElevatorPointIntern); ElevatorPoints.Add(FibElevatorPointGarage); diff --git a/ReallifeGamemode.Server/Migrations/20190719210722_PaydayTimer.cs b/ReallifeGamemode.Server/Migrations/20190719210722_PaydayTimer.cs index 22def7ed..9204a832 100644 --- a/ReallifeGamemode.Server/Migrations/20190719210722_PaydayTimer.cs +++ b/ReallifeGamemode.Server/Migrations/20190719210722_PaydayTimer.cs @@ -2,22 +2,22 @@ namespace ReallifeGamemode.Database.Migrations { - public partial class PaydayTimer : Migration + public partial class PaydayTimer : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "PaydayTimer", - table: "Users", - nullable: false, - defaultValue: 0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "PaydayTimer", - table: "Users"); - } + migrationBuilder.AddColumn( + name: "PaydayTimer", + table: "Users", + nullable: false, + defaultValue: 0); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "PaydayTimer", + table: "Users"); + } + } } diff --git a/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs b/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs index be92ff97..38884914 100644 --- a/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs +++ b/ReallifeGamemode.Server/Migrations/20190721144830_FactionWeapons.cs @@ -3,42 +3,42 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { - public partial class FactionWeapons : Migration + public partial class FactionWeapons : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "FactionWeapons", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - FactionId = table.Column(nullable: false), - WeaponModel = table.Column(nullable: true), - SlotID = table.Column(nullable: false), - Rank = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FactionWeapons", x => x.Id); - table.ForeignKey( - name: "FK_FactionWeapons_Factions_FactionId", - column: x => x.FactionId, - principalTable: "Factions", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); + migrationBuilder.CreateTable( + name: "FactionWeapons", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + FactionId = table.Column(nullable: false), + WeaponModel = table.Column(nullable: true), + SlotID = table.Column(nullable: false), + Rank = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FactionWeapons", x => x.Id); + table.ForeignKey( + name: "FK_FactionWeapons_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); - migrationBuilder.CreateIndex( - name: "IX_FactionWeapons_FactionId", - table: "FactionWeapons", - column: "FactionId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "FactionWeapons"); - } + migrationBuilder.CreateIndex( + name: "IX_FactionWeapons_FactionId", + table: "FactionWeapons", + column: "FactionId"); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "FactionWeapons"); + } + } } diff --git a/ReallifeGamemode.Server/Migrations/20190722201850_VehicleLivery.cs b/ReallifeGamemode.Server/Migrations/20190722201850_VehicleLivery.cs index af39a70c..c5e781bb 100644 --- a/ReallifeGamemode.Server/Migrations/20190722201850_VehicleLivery.cs +++ b/ReallifeGamemode.Server/Migrations/20190722201850_VehicleLivery.cs @@ -2,22 +2,22 @@ namespace ReallifeGamemode.Database.Migrations { - public partial class VehicleLivery : Migration + public partial class VehicleLivery : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Livery", - table: "ServerVehicles", - nullable: false, - defaultValue: 0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Livery", - table: "ServerVehicles"); - } + migrationBuilder.AddColumn( + name: "Livery", + table: "ServerVehicles", + nullable: false, + defaultValue: 0); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Livery", + table: "ServerVehicles"); + } + } } diff --git a/ReallifeGamemode.Server/Migrations/20190728142431_HouseEnhancments.cs b/ReallifeGamemode.Server/Migrations/20190728142431_HouseEnhancments.cs index 2a4cf8c6..4ec553bf 100644 --- a/ReallifeGamemode.Server/Migrations/20190728142431_HouseEnhancments.cs +++ b/ReallifeGamemode.Server/Migrations/20190728142431_HouseEnhancments.cs @@ -3,71 +3,71 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { - public partial class HouseEnhancments : Migration + public partial class HouseEnhancments : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "CanRentIn", - table: "Houses", - nullable: false, - defaultValue: false); + migrationBuilder.AddColumn( + name: "CanRentIn", + table: "Houses", + nullable: false, + defaultValue: false); - migrationBuilder.AddColumn( - name: "RentalFee", - table: "Houses", - nullable: false, - defaultValue: 0); + migrationBuilder.AddColumn( + name: "RentalFee", + table: "Houses", + nullable: false, + defaultValue: 0); - migrationBuilder.CreateTable( - name: "HouseRentals", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - HouseId = table.Column(nullable: true), - UserId = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_HouseRentals", x => x.Id); - table.ForeignKey( - name: "FK_HouseRentals_Houses_HouseId", - column: x => x.HouseId, - principalTable: "Houses", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_HouseRentals_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); + migrationBuilder.CreateTable( + name: "HouseRentals", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + HouseId = table.Column(nullable: true), + UserId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_HouseRentals", x => x.Id); + table.ForeignKey( + name: "FK_HouseRentals_Houses_HouseId", + column: x => x.HouseId, + principalTable: "Houses", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_HouseRentals_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); - migrationBuilder.CreateIndex( - name: "IX_HouseRentals_HouseId", - table: "HouseRentals", - column: "HouseId"); + migrationBuilder.CreateIndex( + name: "IX_HouseRentals_HouseId", + table: "HouseRentals", + column: "HouseId"); - migrationBuilder.CreateIndex( - name: "IX_HouseRentals_UserId", - table: "HouseRentals", - column: "UserId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "HouseRentals"); - - migrationBuilder.DropColumn( - name: "CanRentIn", - table: "Houses"); - - migrationBuilder.DropColumn( - name: "RentalFee", - table: "Houses"); - } + migrationBuilder.CreateIndex( + name: "IX_HouseRentals_UserId", + table: "HouseRentals", + column: "UserId"); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "HouseRentals"); + + migrationBuilder.DropColumn( + name: "CanRentIn", + table: "Houses"); + + migrationBuilder.DropColumn( + name: "RentalFee", + table: "Houses"); + } + } } diff --git a/ReallifeGamemode.Server/Migrations/20190805184145_VehicleItems.cs b/ReallifeGamemode.Server/Migrations/20190805184145_VehicleItems.cs index d75f1726..965b3c68 100644 --- a/ReallifeGamemode.Server/Migrations/20190805184145_VehicleItems.cs +++ b/ReallifeGamemode.Server/Migrations/20190805184145_VehicleItems.cs @@ -3,48 +3,48 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { - public partial class VehicleItems : Migration + public partial class VehicleItems : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - - migrationBuilder.CreateTable( - name: "VehicleItems", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ItemId = table.Column(nullable: false), - VehicleId = table.Column(nullable: false), - Amount = table.Column(nullable: false), - Slot = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_VehicleItems", x => x.Id); - table.ForeignKey( - name: "FK_VehicleItems_ServerVehicles_VehicleId", - column: x => x.VehicleId, - principalTable: "ServerVehicles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - migrationBuilder.CreateIndex( - name: "IX_VehicleItems_VehicleId", - table: "VehicleItems", - column: "VehicleId"); + migrationBuilder.CreateTable( + name: "VehicleItems", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ItemId = table.Column(nullable: false), + VehicleId = table.Column(nullable: false), + Amount = table.Column(nullable: false), + Slot = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_VehicleItems", x => x.Id); + table.ForeignKey( + name: "FK_VehicleItems_ServerVehicles_VehicleId", + column: x => x.VehicleId, + principalTable: "ServerVehicles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); - - } + migrationBuilder.CreateIndex( + name: "IX_VehicleItems_VehicleId", + table: "VehicleItems", + column: "VehicleId"); - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "VehicleItems"); - - - } } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + migrationBuilder.DropTable( + name: "VehicleItems"); + + + } + } } diff --git a/ReallifeGamemode.Server/Migrations/20190911192912_BusinessData.cs b/ReallifeGamemode.Server/Migrations/20190911192912_BusinessData.cs index 07c94fc9..528fa7c9 100644 --- a/ReallifeGamemode.Server/Migrations/20190911192912_BusinessData.cs +++ b/ReallifeGamemode.Server/Migrations/20190911192912_BusinessData.cs @@ -3,29 +3,29 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { - public partial class BusinessData : Migration + public partial class BusinessData : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "BusinessData", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - BusinessId = table.Column(nullable: false), - Price = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BusinessData", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "BusinessData"); - } + migrationBuilder.CreateTable( + name: "BusinessData", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + BusinessId = table.Column(nullable: false), + Price = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BusinessData", x => x.Id); + }); } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "BusinessData"); + } + } } diff --git a/ReallifeGamemode.Server/Report/ReportManage.cs b/ReallifeGamemode.Server/Report/ReportManage.cs index f482c4ae..6b2da7ab 100644 --- a/ReallifeGamemode.Server/Report/ReportManage.cs +++ b/ReallifeGamemode.Server/Report/ReportManage.cs @@ -11,7 +11,7 @@ namespace ReallifeGamemode.Server.Report private String reportText; private Boolean assigned; - public ReportManage (String nUser, string nReportText) + public ReportManage(String nUser, string nReportText) { this.user = nUser; this.admin = "N/A"; diff --git a/ReallifeGamemode.Server/Util/CheckPointHandle.cs b/ReallifeGamemode.Server/Util/CheckPointHandle.cs index f1a8a69a..0b0c8267 100644 --- a/ReallifeGamemode.Server/Util/CheckPointHandle.cs +++ b/ReallifeGamemode.Server/Util/CheckPointHandle.cs @@ -21,7 +21,7 @@ namespace ReallifeGamemode.Server.Util playerHandle.DeleteCheckpoints(); listHandle.Add(playerHandle); - + playerHandle.StartRoute(); } public static void RemovePlayerHandlerFromList(Client player) @@ -48,7 +48,7 @@ namespace ReallifeGamemode.Server.Util { break; } - } + } temp.NextCheckpoint(); } } @@ -88,7 +88,7 @@ namespace ReallifeGamemode.Server.Util this.player.TriggerEvent("setCheckPoint", nextCp, player, this.checkPointsDone, delay, this.markerID, this.markerSize, this.eventInCheckpoint); } if (this.list.Count() == checkPointsDone) - { + { CheckPointHandle.RemovePlayerHandlerFromList(this.player); if (this.eventInCheckpoint == "busDriverJob") diff --git a/ReallifeGamemode.Server/Wanted/Autowanted.cs b/ReallifeGamemode.Server/Wanted/Autowanted.cs index 8f494c50..b83d71b8 100644 --- a/ReallifeGamemode.Server/Wanted/Autowanted.cs +++ b/ReallifeGamemode.Server/Wanted/Autowanted.cs @@ -15,18 +15,18 @@ namespace ReallifeGamemode.Server.Wanted User killer = killerPlayer.GetUser(); if (killer.FactionId == 1 || killer.FactionId == 3) return; - - User cop = copPlayer.GetUser(); - if(cop.FactionId == 1 || cop.FactionId == 3) + + User cop = copPlayer.GetUser(); + if (cop.FactionId == 1 || cop.FactionId == 3) + { + using (var dbContext = new DatabaseContext()) { - using (var dbContext = new DatabaseContext()) - { - killer = killerPlayer.GetUser(dbContext); - killer.GiveWanteds(copPlayer, 10, "Beamten-Mord"); - dbContext.SaveChanges(); - } + killer = killerPlayer.GetUser(dbContext); + killer.GiveWanteds(copPlayer, 10, "Beamten-Mord"); + dbContext.SaveChanges(); } - + } + } } } diff --git a/ReallifeGamemode.Server/Wanted/Jail.cs b/ReallifeGamemode.Server/Wanted/Jail.cs index 13bb25a9..96e0d614 100644 --- a/ReallifeGamemode.Server/Wanted/Jail.cs +++ b/ReallifeGamemode.Server/Wanted/Jail.cs @@ -106,12 +106,12 @@ namespace ReallifeGamemode.Server.Wanted break; } - } + } } } } - + public static void JailTimer() { @@ -203,7 +203,8 @@ namespace ReallifeGamemode.Server.Wanted if (((int)(user.JailTime / 60)) == 0 && user.JailTime != 0) { timeMinutes = 1; - } else + } + else { timeMinutes = (int)(user.JailTime / 60); } @@ -241,7 +242,7 @@ namespace ReallifeGamemode.Server.Wanted player.TriggerEvent("jailTime", 0); } } - + public static void Release_Jail_Admin(Client admin, Client target) { User user = target.GetUser(); diff --git a/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs b/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs index cf6027e7..a42705a4 100644 --- a/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs +++ b/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs @@ -70,7 +70,7 @@ namespace ReallifeGamemode.Server.Wanted using (var dbContext = new DatabaseContext()) { player.GetUser(dbContext).Wanteds -= 1; - if(player.GetUser(dbContext).Wanteds == 0) + if (player.GetUser(dbContext).Wanteds == 0) { switch (player.GetUser(dbContext).FactionId) { diff --git a/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs b/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs index b08598f5..2f1466c8 100644 --- a/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs +++ b/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs @@ -12,7 +12,7 @@ using ReallifeGamemode.Server.Util; namespace ReallifeGamemode.Server.WeaponDeal { - public class WeaponDealManager:Script + public class WeaponDealManager : Script { public static bool checkWeaponDbyVehicle(Vehicle vehicle) { @@ -62,17 +62,17 @@ namespace ReallifeGamemode.Server.WeaponDeal private static void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { - using(var context = new DatabaseContext()) + using (var context = new DatabaseContext()) { List fac = context.Factions.ToList(); - foreach(var faction in fac) + foreach (var faction in fac) { if (faction.WeaponDealTime > 0) - faction.WeaponDealTime -= 1; + faction.WeaponDealTime -= 1; } context.SaveChanges(); } - + } @@ -91,7 +91,7 @@ namespace ReallifeGamemode.Server.WeaponDeal fVeh.SetData("WeaponDealLoad", true); InventoryManager.RemoveAllItemsfromVehicleInventory(fVeh); Random rnd = new Random(); - if(factionVehicle.FactionId == 8 || factionVehicle.FactionId == 7) + if (factionVehicle.FactionId == 8 || factionVehicle.FactionId == 7) { VehicleItem item = new VehicleItem() { ItemId = 11, VehicleId = factionVehicle.Id, Amount = rnd.Next(45, 75) }; //pistole InventoryManager.AddItemToVehicleInventory(client, item, fVeh); diff --git a/ReallifeGamemode.Server/WeaponDeal/WeaponDealPoints.cs b/ReallifeGamemode.Server/WeaponDeal/WeaponDealPoints.cs index b0dcb581..de701419 100644 --- a/ReallifeGamemode.Server/WeaponDeal/WeaponDealPoints.cs +++ b/ReallifeGamemode.Server/WeaponDeal/WeaponDealPoints.cs @@ -28,7 +28,7 @@ namespace ReallifeGamemode.Server.WeaponDeal if (!factionWeaponDeal.ContainsKey(factionID)) return null; - if(factionWeaponDeal[factionID] == -1) + if (factionWeaponDeal[factionID] == -1) { Random rnd = new Random(); factionWeaponDeal[factionID] = rnd.Next(0, WT_Route.Count - 1);