Begin script abstraction
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user