Begin script abstraction

This commit is contained in:
hydrant
2020-02-29 14:50:10 +01:00
parent 447dd2eabc
commit 37f499a446
48 changed files with 2201 additions and 49 deletions

View File

@@ -8,6 +8,11 @@ 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 ReallifeGamemode.Server.Job;
/**
@@ -25,9 +30,16 @@ namespace ReallifeGamemode.Server
public static readonly CultureInfo SERVER_CULTURE = new CultureInfo("de-DE");
private EventHandler eventHandler;
[ServerEvent(Event.ResourceStart)]
public void OnResourceStart()
{
IAPI apiInstance = new RageAPI();
eventHandler = new EventHandler(apiInstance);
new Core.Main(apiInstance, eventHandler);
NAPI.Server.SetGlobalServerChat(false);
NAPI.Server.SetCommandErrorMessage("~r~[FEHLER]~s~ Dieser Command existiert nicht.");
@@ -83,9 +95,13 @@ namespace ReallifeGamemode.Server
Jail.JailTimer();
Economy.PaydayTimer();
WeaponDealManager.WeaponDealTimer();
}
[RemoteEvent("CLIENT:Event")]
public void OnClientEvent(Player player, string dataStr)
{
var data = dataStr.DeserializeJson<List<object>>();
eventHandler.HandleEvent(new RagePlayer(player), data);
}
}
}

View File

@@ -7,7 +7,7 @@
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<Platforms>AnyCPU;x64</Platforms>
<Configurations>Debug;Release;ServerBuild</Configurations>
<LangVersion>7.3</LangVersion>
<LangVersion>8.0</LangVersion>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
@@ -29,6 +29,11 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ReallifeGamemode.Database\ReallifeGamemode.Database.csproj" />
<ProjectReference Include="..\ReallifeGamemode.Server.Common\ReallifeGamemode.Server.Common.csproj" />
<ProjectReference Include="..\ReallifeGamemode.Server.Core.API\ReallifeGamemode.Server.Core.API.csproj" />
<ProjectReference Include="..\ReallifeGamemode.Server.Core.Events\ReallifeGamemode.Server.Core.Events.csproj" />
<ProjectReference Include="..\ReallifeGamemode.Server.Core.RageMP\ReallifeGamemode.Server.Core.RageMP.csproj" />
<ProjectReference Include="..\ReallifeGamemode.Server.Core\ReallifeGamemode.Server.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Bootstrapper">