Code formatiert
This commit is contained in:
@@ -34,7 +34,7 @@ namespace ReallifeGamemode.DataService.Controllers
|
||||
|
||||
string token = tokenGenerator.GenerateUserToken(user);
|
||||
|
||||
if(string.IsNullOrEmpty(token))
|
||||
if (string.IsNullOrEmpty(token))
|
||||
{
|
||||
return Unauthorized();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace ReallifeGamemode.DataService.Controllers
|
||||
|
||||
List<string> locations = new List<string>();
|
||||
|
||||
foreach(var location in list)
|
||||
foreach (var location in list)
|
||||
{
|
||||
string description = location.Description;
|
||||
description = Regex.Replace(description, @"<[^>]*(>|$)", string.Empty);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace ReallifeGamemode.DataService.Logic
|
||||
|
||||
public string GenerateUserToken(User user)
|
||||
{
|
||||
if(user == null)
|
||||
if (user == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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<int>(
|
||||
name: "WeaponDealTime",
|
||||
table: "Factions",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "WeaponDealTime",
|
||||
table: "Factions",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "PaydayTimer",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: 60);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeaponDealTime",
|
||||
table: "Factions");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "PaydayTimer",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "PaydayTimer",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: 60);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeaponDealTime",
|
||||
table: "Factions");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "PaydayTimer",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Description = table.Column<string>(nullable: true),
|
||||
X = table.Column<double>(nullable: false),
|
||||
Y = table.Column<double>(nullable: false),
|
||||
Z = table.Column<double>(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<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Description = table.Column<string>(nullable: true),
|
||||
X = table.Column<double>(nullable: false),
|
||||
Y = table.Column<double>(nullable: false),
|
||||
Z = table.Column<double>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Locations", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Locations");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<int>(
|
||||
name: "Ammount",
|
||||
table: "FactionWeapons",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Ammount",
|
||||
table: "FactionWeapons");
|
||||
}
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Ammount",
|
||||
table: "FactionWeapons",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Ammount",
|
||||
table: "FactionWeapons");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<double>(
|
||||
name: "Heading",
|
||||
table: "Locations",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Heading",
|
||||
table: "Locations");
|
||||
}
|
||||
migrationBuilder.AddColumn<double>(
|
||||
name: "Heading",
|
||||
table: "Locations",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Heading",
|
||||
table: "Locations");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<bool>(
|
||||
name: "DriverLicenseVehicle",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DriverLicenseVehicle",
|
||||
table: "Users");
|
||||
}
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "DriverLicenseVehicle",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DriverLicenseVehicle",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<bool>(
|
||||
name: "FlyingLicensePlane",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FlyingLicensePlane",
|
||||
table: "Users");
|
||||
}
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "FlyingLicensePlane",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FlyingLicensePlane",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<int>(
|
||||
name: "SchoolId",
|
||||
table: "ServerVehicles",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SchoolId",
|
||||
table: "ServerVehicles");
|
||||
}
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "SchoolId",
|
||||
table: "ServerVehicles",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SchoolId",
|
||||
table: "ServerVehicles");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<bool>(
|
||||
name: "DriverLicenseBike",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DriverLicenseBike",
|
||||
table: "Users");
|
||||
}
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "DriverLicenseBike",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DriverLicenseBike",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
FactionId = table.Column<int>(nullable: true),
|
||||
Owner = table.Column<string>(nullable: true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
X = table.Column<int>(nullable: false),
|
||||
Y = table.Column<int>(nullable: false),
|
||||
Rotation = table.Column<float>(nullable: false),
|
||||
Range = table.Column<float>(nullable: false),
|
||||
Color = table.Column<int>(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<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
FactionId = table.Column<int>(nullable: true),
|
||||
Owner = table.Column<string>(nullable: true),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
X = table.Column<int>(nullable: false),
|
||||
Y = table.Column<int>(nullable: false),
|
||||
Rotation = table.Column<float>(nullable: false),
|
||||
Range = table.Column<float>(nullable: false),
|
||||
Color = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Turfs", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Turfs");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
{
|
||||
vehicleInventory = getVehItem(veh);
|
||||
}
|
||||
client.TriggerEvent("setVehiclesInventory", vehicleInventory.ToArray());
|
||||
client.TriggerEvent("setVehiclesInventory", vehicleInventory.ToArray());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,10 +248,10 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
|
||||
List<UserItem> 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);
|
||||
|
||||
@@ -316,9 +316,9 @@ namespace ReallifeGamemode.Server.Events
|
||||
if (nearestElevatorPoint != null)
|
||||
{
|
||||
List<string> stages = new List<string>();
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -73,7 +73,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
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))
|
||||
@@ -88,7 +88,7 @@ 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();
|
||||
|
||||
@@ -111,13 +111,13 @@ 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.");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
@@ -178,7 +180,8 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
}
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -242,7 +245,7 @@ namespace ReallifeGamemode.Server.Gangwar
|
||||
|
||||
}
|
||||
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();
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
new Vector3(-1275.95, 342.97, 326.71),
|
||||
}.AsReadOnly();
|
||||
|
||||
private readonly IReadOnlyCollection<Vector3> Route3 = new List<Vector3>
|
||||
private readonly IReadOnlyCollection<Vector3> Route3 = new List<Vector3>
|
||||
{
|
||||
new Vector3(-850.61, 2181.98, 429.67),
|
||||
new Vector3(-675.89, 1709.52, 462.85),
|
||||
@@ -57,7 +57,7 @@ namespace ReallifeGamemode.Server.Job
|
||||
new Vector3(2028.63, 4842.29, 437.01),
|
||||
}.AsReadOnly();
|
||||
|
||||
private readonly IReadOnlyCollection<Vector3> Route4 = new List<Vector3>
|
||||
private readonly IReadOnlyCollection<Vector3> Route4 = new List<Vector3>
|
||||
{
|
||||
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<Vector3> Route5 = new List<Vector3>
|
||||
private readonly IReadOnlyCollection<Vector3> Route5 = new List<Vector3>
|
||||
{
|
||||
new Vector3(-485.68, -2776.08, 204.5),
|
||||
new Vector3(-19.83, -2133.08, 296.04),
|
||||
@@ -113,25 +113,25 @@ namespace ReallifeGamemode.Server.Job
|
||||
List<String> listRouteTexts = new List<string>();
|
||||
List<String> listRouteTexts2 = new List<string>();
|
||||
|
||||
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")]
|
||||
@@ -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, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
}
|
||||
|
||||
|
||||
public static int GetVehicleInventoryWeight(Vehicle veh)
|
||||
public static int GetVehicleInventoryWeight(Vehicle veh)
|
||||
{
|
||||
var inventoryWeight = 0;
|
||||
|
||||
@@ -229,11 +229,12 @@ 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;
|
||||
}
|
||||
@@ -241,7 +242,7 @@ namespace ReallifeGamemode.Server.Managers
|
||||
}
|
||||
}
|
||||
|
||||
if(vItem.Amount == 0)
|
||||
if (vItem.Amount == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -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<int>(jsonItemAmount);
|
||||
var origin = JsonConvert.DeserializeObject<int[]>(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<VehicleItem> allItemsByVehicle = context.VehicleItems.ToList().FindAll(i => i.VehicleId == sVeh.Id);
|
||||
@@ -618,10 +619,11 @@ namespace ReallifeGamemode.Server.Managers
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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,13 +110,13 @@ 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
|
||||
|
||||
@@ -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<int>(
|
||||
name: "PaydayTimer",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PaydayTimer",
|
||||
table: "Users");
|
||||
}
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PaydayTimer",
|
||||
table: "Users",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PaydayTimer",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
FactionId = table.Column<int>(nullable: false),
|
||||
WeaponModel = table.Column<string>(nullable: true),
|
||||
SlotID = table.Column<int>(nullable: false),
|
||||
Rank = table.Column<int>(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<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
FactionId = table.Column<int>(nullable: false),
|
||||
WeaponModel = table.Column<string>(nullable: true),
|
||||
SlotID = table.Column<int>(nullable: false),
|
||||
Rank = table.Column<int>(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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<int>(
|
||||
name: "Livery",
|
||||
table: "ServerVehicles",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Livery",
|
||||
table: "ServerVehicles");
|
||||
}
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Livery",
|
||||
table: "ServerVehicles",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Livery",
|
||||
table: "ServerVehicles");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<bool>(
|
||||
name: "CanRentIn",
|
||||
table: "Houses",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "CanRentIn",
|
||||
table: "Houses",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "RentalFee",
|
||||
table: "Houses",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "RentalFee",
|
||||
table: "Houses",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "HouseRentals",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
HouseId = table.Column<int>(nullable: true),
|
||||
UserId = table.Column<int>(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<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
HouseId = table.Column<int>(nullable: true),
|
||||
UserId = table.Column<int>(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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
ItemId = table.Column<int>(nullable: false),
|
||||
VehicleId = table.Column<int>(nullable: false),
|
||||
Amount = table.Column<int>(nullable: false),
|
||||
Slot = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_VehicleItems", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_VehicleItems_ServerVehicles_VehicleId",
|
||||
column: x => x.VehicleId,
|
||||
principalTable: "ServerVehicles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
migrationBuilder.CreateTable(
|
||||
name: "VehicleItems",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
ItemId = table.Column<int>(nullable: false),
|
||||
VehicleId = table.Column<int>(nullable: false),
|
||||
Amount = table.Column<int>(nullable: false),
|
||||
Slot = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_VehicleItems", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_VehicleItems_ServerVehicles_VehicleId",
|
||||
column: x => x.VehicleId,
|
||||
principalTable: "ServerVehicles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_VehicleItems_VehicleId",
|
||||
table: "VehicleItems",
|
||||
column: "VehicleId");
|
||||
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");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
BusinessId = table.Column<int>(nullable: false),
|
||||
Price = table.Column<int>(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<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
BusinessId = table.Column<int>(nullable: false),
|
||||
Price = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BusinessData", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "BusinessData");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -16,16 +16,16 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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,10 +62,10 @@ 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<Faction> fac = context.Factions.ToList<Faction>();
|
||||
foreach(var faction in fac)
|
||||
foreach (var faction in fac)
|
||||
{
|
||||
if (faction.WeaponDealTime > 0)
|
||||
faction.WeaponDealTime -= 1;
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user