Miese Corona Zeiten push für Lenhardt

This commit is contained in:
Siga
2020-05-10 19:19:53 +02:00
parent 15e4cec8ee
commit efbff34c21
159 changed files with 8042 additions and 8695 deletions

View File

@@ -1,29 +1,21 @@
using System.Globalization;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using GTANetworkAPI;
using Newtonsoft.Json;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Classes;
using ReallifeGamemode.Server.Finance;
using ReallifeGamemode.Server.Common;
using ReallifeGamemode.Server.Core.API;
using ReallifeGamemode.Server.Core.Events;
using ReallifeGamemode.Server.Core.RageMP;
using ReallifeGamemode.Server.DrivingSchool;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Util;
using ReallifeGamemode.Server.Wanted;
using ReallifeGamemode.Server.DrivingSchool;
using ReallifeGamemode.Server.WeaponDeal;
using ReallifeGamemode.Server.Core.API;
using ReallifeGamemode.Server.Core.RageMP;
using ReallifeGamemode.Server.Core.Events;
using System.Collections.Generic;
using ReallifeGamemode.Server.Common;
using System.Reflection;
using System.Linq;
using ReallifeGamemode.Server.Job;
using ReallifeGamemode.Database.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Infrastructure;
using ReallifeGamemode.Database.Entities;
using ReallifeGamemode.Services;
/**
* @overview Life of German Reallife - Main Class (Main.cs)
* @author VegaZ, hydrant
@@ -33,93 +25,93 @@ using ReallifeGamemode.Services;
namespace ReallifeGamemode.Server
{
public class Main : Script
{
public static readonly Vector3 DEFAULT_SPAWN_POSITION = new Vector3(-427.5189, 1116.453, 326.7829);
public static readonly float DEFAULT_SPAWN_HEADING = 340.8f;
public static readonly CultureInfo SERVER_CULTURE = new CultureInfo("de-DE");
private EventHandler eventHandler;
[ServerEvent(Event.ResourceStart)]
public void OnResourceStart()
{
var methods = Assembly.GetExecutingAssembly()
.GetTypes()
.SelectMany(t => t.GetMethods())
.Where(m => m.GetCustomAttributes(typeof(CommandAttribute), false).Length > 0)
.ToArray();
public static readonly Vector3 DEFAULT_SPAWN_POSITION = new Vector3(-427.5189, 1116.453, 326.7829);
public static readonly float DEFAULT_SPAWN_HEADING = 340.8f;
var cmdAttributes = methods.Select(c => c.GetCustomAttribute<CommandAttribute>()).ToList();
public static readonly CultureInfo SERVER_CULTURE = new CultureInfo("de-DE");
var registeredCommands = cmdAttributes.Select(c => c.CommandString).ToList();
cmdAttributes.Where(c => c.Alias?.Any() ?? false).ToList().ForEach(a =>
{
registeredCommands.AddRange(a.Alias.Split(','));
});
private EventHandler eventHandler;
IAPI apiInstance = new RageAPI();
eventHandler = new EventHandler(apiInstance);
new Core.Main(apiInstance, eventHandler, registeredCommands.ToArray());
NAPI.Server.SetGlobalServerChat(false);
NAPI.Server.SetCommandErrorMessage("~r~[FEHLER]~s~ Dieser Command existiert nicht.");
NAPI.Server.SetDefaultSpawnLocation(DEFAULT_SPAWN_POSITION, DEFAULT_SPAWN_HEADING);
NAPI.Server.SetAutoSpawnOnConnect(false);
NAPI.Server.SetAutoRespawnAfterDeath(false);
NAPI.Data.SetWorldData("playerCreatorDimension", 0);
JsonConvert.DefaultSettings = () =>
{
return new JsonSerializerSettings()
[ServerEvent(Event.ResourceStart)]
public void OnResourceStart()
{
NullValueHandling = NullValueHandling.Ignore
};
};
var methods = Assembly.GetExecutingAssembly()
.GetTypes()
.SelectMany(t => t.GetMethods())
.Where(m => m.GetCustomAttributes(typeof(CommandAttribute), false).Length > 0)
.ToArray();
InventoryManager.LoadItems();
ShopManager.LoadClotheShops();
ShopManager.LoadItemShops();
TuningManager.LoadTuningGarages();
var cmdAttributes = methods.Select(c => c.GetCustomAttribute<CommandAttribute>()).ToList();
TimeManager.StartTimeManager();
VehicleManager.CheckEnabledMods();
var registeredCommands = cmdAttributes.Select(c => c.CommandString).ToList();
cmdAttributes.Where(c => c.Alias?.Any() ?? false).ToList().ForEach(a =>
{
registeredCommands.AddRange(a.Alias.Split(','));
});
DatabaseHelper.InitDatabaseFirstTime();
IAPI apiInstance = new RageAPI();
eventHandler = new EventHandler(apiInstance);
FactionHelper.CheckFactionBankAccounts();
BusinessManager.LoadBusinesses();
//InteriorManager.LoadInteriors();
DoorManager.LoadDoors();
ATMManager.InitATMs();
CityHallManager.LoadCityHall();
JobManager.LoadJobs();
//TaxiDriverJob.StartTaxiTimer(); Obselete
//HouseManager.LoadHouses();
DrivingSchool.DrivingSchool.Setup();
PlaneSchool.Setup();
Gangwar.Gangwar.loadTurfs();
new Core.Main(apiInstance, eventHandler, registeredCommands.ToArray());
TempBlip tempBlip = new TempBlip()
{
Color = 1,
Name = "",
Transparency = 0,
ShortRange = true,
Sprite = 1,
Scale = 1,
};
NAPI.Server.SetGlobalServerChat(false);
NAPI.Data.SetWorldData("blipTemplate", tempBlip);
NAPI.Server.SetCommandErrorMessage("~r~[FEHLER]~s~ Dieser Command existiert nicht.");
NAPI.Server.SetDefaultSpawnLocation(DEFAULT_SPAWN_POSITION, DEFAULT_SPAWN_HEADING);
NAPI.Server.SetAutoSpawnOnConnect(false);
NAPI.Server.SetAutoRespawnAfterDeath(false);
NAPI.Data.SetWorldData("playerCreatorDimension", 0);
//WantedEscapeTimer.WantedTimer(); Obselete
//Jail.JailTimer(); Obselete
//Economy.PaydayTimer(); Obselete
// WeaponDealManager.WeaponDealTimer(); Obselete
JsonConvert.DefaultSettings = () =>
{
return new JsonSerializerSettings()
{
NullValueHandling = NullValueHandling.Ignore
};
};
ThreadTimers.StartAllTimers();
InventoryManager.LoadItems();
ShopManager.LoadClotheShops();
ShopManager.LoadItemShops();
TuningManager.LoadTuningGarages();
TimeManager.StartTimeManager();
VehicleManager.CheckEnabledMods();
DatabaseHelper.InitDatabaseFirstTime();
FactionHelper.CheckFactionBankAccounts();
BusinessManager.LoadBusinesses();
//InteriorManager.LoadInteriors();
DoorManager.LoadDoors();
ATMManager.InitATMs();
CityHallManager.LoadCityHall();
JobManager.LoadJobs();
//TaxiDriverJob.StartTaxiTimer(); Obselete
//HouseManager.LoadHouses();
DrivingSchool.DrivingSchool.Setup();
PlaneSchool.Setup();
Gangwar.Gangwar.loadTurfs();
TempBlip tempBlip = new TempBlip()
{
Color = 1,
Name = "",
Transparency = 0,
ShortRange = true,
Sprite = 1,
Scale = 1,
};
NAPI.Data.SetWorldData("blipTemplate", tempBlip);
//WantedEscapeTimer.WantedTimer(); Obselete
//Jail.JailTimer(); Obselete
//Economy.PaydayTimer(); Obselete
// WeaponDealManager.WeaponDealTimer(); Obselete
ThreadTimers.StartAllTimers();
UserBankAccount.BalanceChanged += (account) =>
{
@@ -137,11 +129,11 @@ namespace ReallifeGamemode.Server
};
}
[RemoteEvent("CLIENT:Event")]
public void OnClientEvent(Player player, string dataStr)
{
var data = dataStr.DeserializeJson<List<object>>();
eventHandler.HandleEvent(new RagePlayer(player), data);
[RemoteEvent("CLIENT:Event")]
public void OnClientEvent(Player player, string dataStr)
{
var data = dataStr.DeserializeJson<List<object>>();
eventHandler.HandleEvent(new RagePlayer(player), data);
}
}
}
}
}