Begin weaponschein
This commit is contained in:
22
ReallifeGamemode.Server.Core.API/Color.cs
Normal file
22
ReallifeGamemode.Server.Core.API/Color.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.API
|
||||
{
|
||||
public struct Color
|
||||
{
|
||||
public int R { get; set; }
|
||||
|
||||
public int G { get; set; }
|
||||
|
||||
public int B { get; set; }
|
||||
|
||||
public Color(int r, int g, int b)
|
||||
{
|
||||
R = r;
|
||||
G = g;
|
||||
B = b;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,8 @@ namespace ReallifeGamemode.Server.Core.API
|
||||
|
||||
IVehicleAPI Vehicle { get; }
|
||||
|
||||
IMarkerAPI Marker { get; }
|
||||
|
||||
void DisableDefaultCommandErrorMessages();
|
||||
|
||||
void DisableDefaultSpawnBehavior();
|
||||
|
||||
11
ReallifeGamemode.Server.Core.API/IMarker.cs
Normal file
11
ReallifeGamemode.Server.Core.API/IMarker.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.API
|
||||
{
|
||||
public interface IMarker : IEntity
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
12
ReallifeGamemode.Server.Core.API/IMarkerAPI.cs
Normal file
12
ReallifeGamemode.Server.Core.API/IMarkerAPI.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ReallifeGamemode.Server.Types;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.API
|
||||
{
|
||||
public interface IMarkerAPI
|
||||
{
|
||||
IMarker CreateMarker(MarkerType markerType, Position position, Position direction, Position rotation, float scale, Color color);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@ namespace ReallifeGamemode.Server.Core.RageMP
|
||||
|
||||
public IVehicleAPI Vehicle => new RageVehicleAPI();
|
||||
|
||||
public IMarkerAPI Marker => new RageMarkerAPI();
|
||||
|
||||
public void DisableDefaultCommandErrorMessages()
|
||||
{
|
||||
NAPI.Server.SetCommandErrorMessage(null);
|
||||
|
||||
@@ -35,5 +35,10 @@ namespace ReallifeGamemode.Server.Core.RageMP
|
||||
return DisconnectReason.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
public static GTANetworkAPI.Color ToColor(this API.Color color)
|
||||
{
|
||||
return new GTANetworkAPI.Color(color.R, color.G, color.B);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
20
ReallifeGamemode.Server.Core.RageMP/RageMarker.cs
Normal file
20
ReallifeGamemode.Server.Core.RageMP/RageMarker.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Core.API;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.RageMP
|
||||
{
|
||||
public class RageMarker : RageEntity, IMarker
|
||||
{
|
||||
private readonly Marker marker;
|
||||
|
||||
public RageMarker(Marker marker) : base(marker)
|
||||
{
|
||||
this.marker = marker;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
24
ReallifeGamemode.Server.Core.RageMP/RageMarkerAPI.cs
Normal file
24
ReallifeGamemode.Server.Core.RageMP/RageMarkerAPI.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Core.API;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.RageMP
|
||||
{
|
||||
public class RageMarkerAPI : IMarkerAPI
|
||||
{
|
||||
public IMarker CreateMarker(Types.MarkerType markerType, Position position, Position direction, Position rotation, float scale, API.Color color)
|
||||
{
|
||||
Marker rageMarker = NAPI.Marker.CreateMarker(
|
||||
(int)markerType,
|
||||
position.ToVector3(),
|
||||
direction.ToVector3(),
|
||||
rotation.ToVector3(),
|
||||
scale,
|
||||
color.ToColor());
|
||||
|
||||
return new RageMarker(rageMarker);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace ReallifeGamemode.Server.Core
|
||||
internal static IAPI API { get; private set; }
|
||||
internal static Events.EventHandler EventHandler { get; private set; }
|
||||
|
||||
private static List<Script> loadedScripts = new List<Script>();
|
||||
private static readonly List<Script> loadedScripts = new List<Script>();
|
||||
|
||||
private readonly ILogger logger = LogManager.GetLogger<Main>();
|
||||
|
||||
@@ -36,10 +36,10 @@ namespace ReallifeGamemode.Server.Core
|
||||
|
||||
private void LoadScript()
|
||||
{
|
||||
var allTypes = Assembly.GetExecutingAssembly().GetTypes();
|
||||
var commandTypes = allTypes.Where(t => t.IsSubclassOf(typeof(Script)) && !t.IsAbstract);
|
||||
var allTypes = typeof(Main).Assembly.GetTypes();
|
||||
var scriptTypes = allTypes.Where(t => t.IsSubclassOf(typeof(Script)) && !t.IsAbstract);
|
||||
|
||||
foreach (var scriptType in commandTypes)
|
||||
foreach (var scriptType in scriptTypes)
|
||||
{
|
||||
logger.LogDebug("Loading script '{FullName}'", scriptType.FullName);
|
||||
var script = Activator.CreateInstance(scriptType) as Script;
|
||||
|
||||
14
ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs
Normal file
14
ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Core.Menus
|
||||
{
|
||||
internal class PoliceDepartment : Script
|
||||
{
|
||||
public PoliceDepartment()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace ReallifeGamemode.Server.Log
|
||||
{
|
||||
builder.AddConsole();
|
||||
builder.AddDebug();
|
||||
builder.AddFilter("RageMP.Server", LogLevel.Debug);
|
||||
builder.AddFilter("ReallifeGamemode.Server", LogLevel.Debug);
|
||||
builder.AddFilter("Microsoft.EntityFrameworkCore", LogLevel.Information);
|
||||
});
|
||||
|
||||
|
||||
39
ReallifeGamemode.Server.Types/MarkerType.cs
Normal file
39
ReallifeGamemode.Server.Types/MarkerType.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Types
|
||||
{
|
||||
public enum MarkerType
|
||||
{
|
||||
UpsideDownCone = 0,
|
||||
VerticalCylinder = 1,
|
||||
ThickChevronUp = 2,
|
||||
ThinChevronUp = 3,
|
||||
CheckeredFlagRect = 4,
|
||||
CheckeredFlagCircle = 5,
|
||||
VerticleCircle = 6,
|
||||
PlaneModel = 7,
|
||||
LostMCDark = 8,
|
||||
LostMCLight = 9,
|
||||
Number0 = 10,
|
||||
Number1 = 11,
|
||||
Number2 = 12,
|
||||
Number3 = 13,
|
||||
Number4 = 14,
|
||||
Number5 = 15,
|
||||
Number6 = 16,
|
||||
Number7 = 17,
|
||||
Number8 = 18,
|
||||
Number9 = 19,
|
||||
ChevronUpx1 = 20,
|
||||
ChevronUpx2 = 21,
|
||||
ChevronUpx3 = 22,
|
||||
HorizontalCircleFat = 23,
|
||||
ReplayIcon = 24,
|
||||
HorizontalCircleSkinny = 25,
|
||||
HorizontalCircleSkinnyArrow = 26,
|
||||
HorizontalSplitArrowCircle = 27,
|
||||
DebugSphere = 28
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user