forked from FabianTerhorst/coreclr-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlt.cs
More file actions
131 lines (94 loc) · 6.04 KB
/
Alt.cs
File metadata and controls
131 lines (94 loc) · 6.04 KB
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
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
{
public static ICore Core => CoreImpl;
internal static Core CoreImpl;
[Obsolete("Use Core instead")]
public static ICore Server
{
get
{
LogWarning("Alt.Server is deprecated, use Alt.Core instead");
return Core;
}
}
public static bool CacheEntities { get => AltShared.CacheEntities; set => AltShared.CacheEntities = value; }
public static bool ThrowIfEntityDoesNotExist = false;
public static bool IsDebug => Core.IsDebug;
public static void Emit(string eventName, params object[] args) => Core.TriggerLocalEvent(eventName, args);
public static void EmitAllClients(string eventName, params object[] args) =>
Core.TriggerClientEventForAll(eventName, args);
public static void EmitClients(IPlayer[] clients, string eventName, params object[] args) =>
Core.TriggerClientEventForSome(clients, eventName, args);
public static IEnumerable<string> GetRegisteredClientEvents() => Core.GetRegisteredClientEvents();
public static IEnumerable<string> GetRegisteredServerEvents() => Core.GetRegisteredServerEvents();
public static void Log(string message) => Core.LogInfo(message);
public static IReadOnlyCollection<IPlayer> GetAllPlayers() => Core.PlayerPool.GetAllEntities();
public static IReadOnlyCollection<IVehicle> GetAllVehicles() =>
Core.VehiclePool.GetAllEntities();
public static IReadOnlyCollection<IBlip> GetAllBlips() => Core.BlipPool.GetAllObjects();
public static IReadOnlyCollection<ICheckpoint> GetAllCheckpoints() =>
Core.CheckpointPool.GetAllObjects();
public static IReadOnlyCollection<IVoiceChannel> GetAllVoiceChannels() =>
Core.VoiceChannelPool.GetAllObjects();
public static IReadOnlyCollection<IColShape> GetAllColShapes() =>
Core.ColShapePool.GetAllObjects();
public static KeyValuePair<IntPtr, IPlayer>[] GetPlayersArray() => Core.PlayerPool.GetEntitiesArray();
public static KeyValuePair<IntPtr, IVehicle>[] GetVehiclesArray() => Core.VehiclePool.GetEntitiesArray();
public static KeyValuePair<IntPtr, IBlip>[] GetBlipsArray() => Core.BlipPool.GetObjectsArray();
public static KeyValuePair<IntPtr, ICheckpoint>[] GetCheckpointsArray() =>
Core.CheckpointPool.GetObjectsArray();
public static KeyValuePair<IntPtr, IVoiceChannel>[] GetVoiceChannelsArray() =>
Core.VoiceChannelPool.GetObjectsArray();
public static KeyValuePair<IntPtr, IColShape>[] GetColShapesArray() => Core.ColShapePool.GetObjectsArray();
public static void ForEachPlayers(IBaseObjectCallback<IPlayer> baseObjectCallback) =>
Core.PlayerPool.ForEach(baseObjectCallback);
public static Task ForEachPlayers(IAsyncBaseObjectCallback<IPlayer> baseObjectCallback) =>
Core.PlayerPool.ForEach(baseObjectCallback);
public static void ForEachVehicles(IBaseObjectCallback<IVehicle> baseObjectCallback) =>
Core.VehiclePool.ForEach(baseObjectCallback);
public static Task ForEachVehicles(IAsyncBaseObjectCallback<IVehicle> baseObjectCallback) =>
Core.VehiclePool.ForEach(baseObjectCallback);
public static void ForEachBlips(IBaseObjectCallback<IBlip> baseObjectCallback) =>
Core.BlipPool.ForEach(baseObjectCallback);
public static Task ForEachBlips(IAsyncBaseObjectCallback<IBlip> baseObjectCallback) =>
Core.BlipPool.ForEach(baseObjectCallback);
public static void ForEachCheckpoints(IBaseObjectCallback<ICheckpoint> baseObjectCallback) =>
Core.CheckpointPool.ForEach(baseObjectCallback);
public static Task ForEachCheckpoints(IAsyncBaseObjectCallback<ICheckpoint> baseObjectCallback) =>
Core.CheckpointPool.ForEach(baseObjectCallback);
public static void ForEachVoiceChannels(IBaseObjectCallback<IVoiceChannel> baseObjectCallback) =>
Core.VoiceChannelPool.ForEach(baseObjectCallback);
public static Task ForEachVoiceChannels(IAsyncBaseObjectCallback<IVoiceChannel> baseObjectCallback) =>
Core.VoiceChannelPool.ForEach(baseObjectCallback);
public static void ForEachColShapes(IBaseObjectCallback<IColShape> baseObjectCallback) =>
Core.ColShapePool.ForEach(baseObjectCallback);
public static Task ForEachColShapes(IAsyncBaseObjectCallback<IColShape> baseObjectCallback) =>
Core.ColShapePool.ForEach(baseObjectCallback);
public static VehicleModelInfo GetVehicleModelInfo(uint hash) => Core.GetVehicleModelInfo(hash);
public static VehicleModelInfo GetVehicleModelInfo(string name) => Core.GetVehicleModelInfo(Hash(name));
public static PedModelInfo? GetPedModelInfo(uint hash) => Core.GetPedModelInfo(hash);
public static PedModelInfo? GetPedModelInfo(string name) => Core.GetPedModelInfo(Hash(name));
public static uint Hash(string stringToHash) => Core.Hash(stringToHash);
public static ulong HashPassword(string password) => Core.HashPassword(password);
public static bool FileExists(string path) => Core.FileExists(path);
public static string ReadFile(string path) => Core.FileRead(path);
public static byte[] ReadFileBinary(string path) => Core.FileReadBinary(path);
public static IConfig GetServerConfig() => Core.GetServerConfig();
public static IEntity GetEntityById(ushort id) => Core.GetEntityById(id);
}
}