-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathAlt.cs
160 lines (131 loc) · 7.23 KB
/
Alt.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using AltV.Net.Data;
using AltV.Net.Elements.Entities;
using AltV.Net.Elements.Pools;
using AltV.Net.Shared;
using AltV.Net.Shared.Elements.Data;
[assembly: InternalsVisibleTo("AltV.Net")]
[assembly: InternalsVisibleTo("AltV.Net.Mock")]
[assembly: InternalsVisibleTo("AltV.Net.Mock2")]
[assembly: InternalsVisibleTo("AltV.Net.Async")]
namespace AltV.Net
{
public static partial class Alt
{
internal static ICore CoreImpl;
public static bool CacheEntities { get => AltShared.CacheEntities; set => AltShared.CacheEntities = value; }
public static bool ThrowIfEntityDoesNotExist = false;
public static bool IsDebug => CoreImpl.IsDebug;
public static void Emit(string eventName, params object[] args) => CoreImpl.TriggerLocalEvent(eventName, args);
public static void EmitAllClients(string eventName, params object[] args) =>
CoreImpl.TriggerClientEventForAll(eventName, args);
public static void EmitClients(IPlayer[] clients, string eventName, params object[] args) =>
CoreImpl.TriggerClientEventForSome(clients, eventName, args);
public static void EmitEventUnreliableAllClients(string eventName, params object[] args) =>
CoreImpl.TriggerClientEventUnreliableForAll(eventName, args);
public static void EmitUnreliableClients(IPlayer[] clients, string eventName, params object[] args) =>
CoreImpl.TriggerClientEventUnreliableForSome(clients, eventName, args);
public static IEnumerable<string> GetRegisteredClientEvents() => CoreImpl.GetRegisteredClientEvents();
public static IEnumerable<string> GetRegisteredServerEvents() => CoreImpl.GetRegisteredServerEvents();
/// <summary>
/// Logging a message
/// </summary>
/// <param name="message">a message</param>
public static void Log(string message) => CoreImpl.LogInfo(message);
public static VehicleModelInfo GetVehicleModelInfo(uint hash) => CoreImpl.GetVehicleModelInfo(hash);
public static VehicleModelInfo GetVehicleModelInfo(string name) => CoreImpl.GetVehicleModelInfo(Hash(name));
public static PedModelInfo? GetPedModelInfo(uint hash) => CoreImpl.GetPedModelInfo(hash);
public static PedModelInfo? GetPedModelInfo(string name) => CoreImpl.GetPedModelInfo(Hash(name));
public static uint Hash(string stringToHash) => CoreImpl.Hash(stringToHash);
public static ulong HashPassword(string password) => CoreImpl.HashPassword(password);
public static bool FileExists(string path) => CoreImpl.FileExists(path);
public static string ReadFile(string path) => CoreImpl.FileRead(path);
public static byte[] ReadFileBinary(string path) => CoreImpl.FileReadBinary(path);
public static IConfig GetServerConfig() => CoreImpl.GetServerConfig();
public static IBaseObject GetBaseObjectById(BaseObjectType type, uint id) => CoreImpl.GetBaseObjectById(type, id);
public static IMetric RegisterMetric(string name, MetricType type = MetricType.MetricTypeGauge, Dictionary<string, string> dataDict = default) => CoreImpl.RegisterMetric(name, type, dataDict);
public static void UnregisterMetric(IMetric metric) => CoreImpl.UnregisterMetric(metric);
public static IReadOnlyCollection<IMetric> GetAllMetrics() => CoreImpl.GetAllMetrics();
public static VoiceConnectionState GetVoiceConnectionState() => CoreImpl.GetVoiceConnectionState();
public static void SetWorldProfiler(bool state) => CoreImpl.SetWorldProfiler(state);
public static IBaseObject[] GetClosestEntities(Position position, int range, int dimension, int limit, EntityType allowedTypes, Order order = Order.Default) =>
CoreImpl.GetClosestEntities(position, range, dimension, limit, allowedTypes, order);
public static IBaseObject[] GetEntitiesInDimension(int dimension, EntityType allowedTypes) => CoreImpl.GetEntitiesInDimension(dimension, allowedTypes);
public static IBaseObject[] GetEntitiesInRange(Position position, int range, int dimension, EntityType allowedTypes) => CoreImpl.GetEntitiesInRange(position, range, dimension, allowedTypes);
public static int NetTime => CoreImpl.NetTime;
public static void AddClientConfigKey(string key) => CoreImpl.AddClientConfigKey(key);
public static ushort MaxStreamingPeds
{
get => CoreImpl.MaxStreamingPeds;
set => CoreImpl.MaxStreamingPeds = value;
}
public static ushort MaxStreamingObjects
{
get => CoreImpl.MaxStreamingObjects;
set => CoreImpl.MaxStreamingObjects = value;
}
public static ushort MaxStreamingVehicles
{
get => CoreImpl.MaxStreamingVehicles;
set => CoreImpl.MaxStreamingVehicles = value;
}
public static byte StreamerThreadCount
{
get => CoreImpl.StreamerThreadCount;
set => CoreImpl.StreamerThreadCount = value;
}
public static uint StreamingTickRate
{
get => CoreImpl.StreamingTickRate;
set => CoreImpl.StreamingTickRate = value;
}
public static uint StreamingDistance
{
get => CoreImpl.StreamingDistance;
set => CoreImpl.StreamingDistance = value;
}
public static uint ColShapeTickRate
{
get => CoreImpl.ColShapeTickRate;
set => CoreImpl.ColShapeTickRate = value;
}
public static uint MigrationDistance
{
get => CoreImpl.MigrationDistance;
set => CoreImpl.MigrationDistance = value;
}
public static byte MigrationThreadCount
{
get => CoreImpl.MigrationThreadCount;
set => CoreImpl.MigrationThreadCount = value;
}
public static uint MigrationTickRate
{
get => CoreImpl.MigrationTickRate;
set => CoreImpl.MigrationTickRate = value;
}
public static byte SyncReceiveThreadCount
{
get => CoreImpl.SyncReceiveThreadCount;
set => CoreImpl.SyncReceiveThreadCount = value;
}
public static byte SyncSendThreadCount
{
get => CoreImpl.SyncSendThreadCount;
set => CoreImpl.SyncSendThreadCount = value;
}
public static bool HasBenefit(Benefit benefit) => CoreImpl.HasBenefit(benefit);
public static void StopServer() => CoreImpl.StopServer();
public static WeaponModelInfo? GetWeaponModelInfo(uint hash) => CoreImpl.GetWeaponModelInfo(hash);
public static void SetPassword(string password) => CoreImpl.SetPassword(password);
public static void SetVoiceExternal(string host, ushort port) => CoreImpl.SetVoiceExternal(host, port);
public static void SetVoiceExternalPublic(string host, ushort port) => CoreImpl.SetVoiceExternalPublic(host, port);
public static string Branch => CoreImpl.Branch;
public static string Version => CoreImpl.Version;
public static bool IsMainThread => CoreImpl.IsMainThread();
public static uint[] LoadedVehicleModels => CoreImpl.LoadedVehicleModels;
}
}