-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
ICore.cs
239 lines (225 loc) · 13.3 KB
/
ICore.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
using System.Numerics;
using System.Runtime.CompilerServices;
using AltV.Net.Client.Elements.Data;
using AltV.Net.Client.Elements.Interfaces;
using AltV.Net.Client.Elements.Pools;
using AltV.Net.Data;
using AltV.Net.Elements.Args;
using AltV.Net.Elements.Entities;
using AltV.Net.Shared;
using AltV.Net.Shared.Enums;
using WeaponData = AltV.Net.Client.Elements.Data.WeaponData;
namespace AltV.Net.Client
{
public interface ICore : ISharedCore
{
IPoolManager PoolManager { get; }
LocalStorage LocalStorage { get; }
new INativeResource Resource { get; }
INatives Natives { get; }
Voice Voice { get; }
bool MinimapIsRectangle { set; }
ushort Fps { get; }
ushort Ping { get; }
uint TotalPacketsLost { get; }
ulong TotalPacketsSent { get; }
Vector2 ScreenResolution { get; }
string LicenseHash { get; }
string Locale { get; }
string ServerIp { get; }
ushort ServerPort { get; }
bool IsGameFocused { get; }
bool IsInStreamerMode { get; }
bool IsMenuOpened { get; }
bool IsConsoleOpen { get; }
bool CamFrozen { get; set; }
Vector3 CamPos { get; }
bool GameControlsEnabled { get; set; }
bool RmlControlsEnabled { get; set; }
bool VoiceControlsEnabled { get; set; }
int MsPerGameMinute { get; set; }
INativeResourcePool NativeResourcePool { get; }
ITimerPool TimerPool { get; }
IBlip CreatePointBlip(Position position);
IBlip CreateRadiusBlip(Position position, float radius);
IBlip CreateAreaBlip(Position position, int width, int height);
IntPtr CreateWebViewPtr(out uint id, string url, bool isOverlay = false, Vector2? pos = null, Vector2? size = null);
IWebView CreateWebView(string url, bool isOverlay = false, Vector2? pos = null, Vector2? size = null);
IntPtr CreateWebViewPtr(out uint id, string url, uint propHash, string targetTexture);
IWebView CreateWebView(string url, uint propHash, string targetTexture);
IntPtr CreatePointBlipPtr(out uint id, Position position);
IntPtr CreateRadiusBlipPtr(out uint id, Position position, float radius);
IntPtr CreateAreaBlipPtr(out uint id, Position position, int width, int height);
IntPtr CreateMarkerPtr(out uint id, MarkerType type, Position pos, Rgba color, bool useStreaming, uint streamingDistance);
new IBaseObject GetBaseObjectById(BaseObjectType type, uint id);
void ShowCursor(bool state);
bool IsCursorVisible { get; }
Discord Discord { get; }
FocusData FocusData { get; }
void TriggerServerEvent(string eventName, params object[] args);
ushort TriggerServerRPCEvent(string name, params object[] args);
void TriggerServerRPCAnswer(ushort answerId, object answer, string error);
void TriggerServerEventUnreliable(string eventName, params object[] args);
IntPtr CreateRmlDocumentPtr(out uint id, string url);
IRmlDocument CreateRmlDocument(string url);
Vector2 WorldToScreen(Vector3 position);
string[] MarshalStringArrayPtrAndFree(IntPtr ptr, uint size);
DiscordUser? GetDiscordUser();
void LoadRmlFont(string path, string name, bool italic = false, bool bold = false);
HandlingData? GetHandlingByModelHash(uint modelHash);
AudioCategory? GetAudioCategoryByName(string audioCategory);
Vector3 ScreenToWorld(Vector2 position);
void AddGxtText(uint key, string value);
string GetGxtText(uint key);
void RemoveGxtText(uint key);
bool BeginScaleformMovieMethodMinimap(string methodName);
void SetMinimapComponentPosition(string name, char alignX, char alignY, float posX, float posY, float sizeX, float sizeY);
void ResetMinimapComponentPosition(string name);
void CopyToClipboard(string content);
bool GetPermissionState(Permission permission);
bool IsTextureExistInArchetype(uint modelHash, string targetTextureName);
bool IsPointOnScreen(Vector3 position);
void LoadModel(uint modelHash);
void LoadModelAsync(uint modelHash);
bool LoadYtyp(string ytypName);
bool UnloadYtyp(string ytypName);
void RequestIpl(string iplName);
void RemoveIpl(string iplName);
bool IsKeyDown(Key key);
bool IsKeyToggled(Key key);
bool DoesConfigFlagExist(string flagName);
bool GetConfigFlag(string flagName);
void SetConfigFlag(string flagName, bool value);
Vector2 GetCursorPos(bool normalized);
void SetCursorPos(Vector2 pos, bool normalized);
string GetStatType(string stat);
void ResetStat(string stat);
void GetStat(string stat, out int value);
void GetStat(string stat, out long value);
void GetStat(string stat, out float value);
void GetStat(string stat, out bool value);
void GetStat(string stat, out string value);
void GetStat(string stat, out byte value);
void GetStat(string stat, out ushort value);
void GetStat(string stat, out uint value);
void GetStat(string stat, out ulong value);
void SetStat(string stat, int value);
void SetStat(string stat, long value);
void SetStat(string stat, float value);
void SetStat(string stat, bool value);
void SetStat(string stat, string value);
void SetStat(string stat, byte value);
void SetStat(string stat, ushort value);
void SetStat(string stat, uint value);
void SetStat(string stat, ulong value);
void ClearPedProp(int scriptId, byte component);
void SetPedDlcProp(int scriptId, uint dlc, byte component, byte drawable, byte texture);
void SetPedDlcClothes(int scriptId, uint dlc, byte component, byte drawable, byte texture, byte palette);
void SetRotationVelocity(int scriptId, Rotation velocity);
void SetWatermarkPosition(WatermarkPosition position);
string StringToSha256(string value);
void SetWeatherCycle(byte[] weathers, byte[] multipliers);
void SetWeatherSyncActive(bool state);
string GetHeadshotBase64(byte id);
Task<string> TakeScreenshot();
Task<string> TakeScreenshotGameOnly();
INativeResource GetResource(string name);
bool HasResource(string name);
INativeResource[] GetAllResources();
uint SetTimeout(Action action, uint duration, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0);
uint SetInterval(Action action, uint duration, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0);
uint NextTick(Action action, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0);
uint EveryTick(Action action, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0);
void ClearTimer(uint id);
IntPtr CreateCheckpointPtr(out uint id, CheckpointType type, Vector3 pos, Vector3 nextPos, float radius, float height, Rgba color, Rgba iconColor, uint streamingDistance);
ICheckpoint CreateCheckpoint(CheckpointType type, Vector3 pos, Vector3 nextPos, float radius, float height, Rgba color, Rgba iconColor, uint streamingDistance);
IntPtr CreateAudioPtr(out uint id, string source, float volume, bool isRadio = false, bool clearCache = true, string basePath = "");
IAudio CreateAudio(string source, float volume, bool isRadio = false, bool clearCache = true, string basePath = "");
IntPtr CreateAudioFilterPtr(out uint id, uint hash);
IntPtr CreateFrontendOutputPtr(out uint id, uint categoryHash);
IntPtr CreateWorldOutputPtr(out uint id, uint categoryHash, Position pos);
IntPtr CreateAttachedOutputPtr(out uint id, uint categoryHash, IWorldObject worldObject);
IAudioFilter CreateAudioFilter(uint hash);
IAudioOutputFrontend CreateAudioOutputFrontend(uint categoryHash);
IAudioOutputWorld CreateAudioOutputWorld(uint categoryHash, Position pos);
IAudioOutputAttached CreateAudioOutputAttached(uint categoryHash, IWorldObject worldObject);
WeaponData[] GetAllWeaponData();
IntPtr CreateLocalObjectPtr(out uint id, uint modelHash, Position position, Rotation rotation, bool noOffset = false,
bool dynamic = false, bool useStreaming = false, uint streamingDistance = 0);
ILocalObject CreateLocalObject(uint modelHash, Position position, Rotation rotation, bool noOffset = false,
bool dynamic = false, bool useStreaming = false, uint streamingDistance = 0);
MapZoomData GetMapZoomData(uint id);
MapZoomData GetMapZoomData(string alias);
void ResetAllMapZoomData();
void LoadDefaultIpls();
IntPtr CreateHttpClientPtr(out uint id);
IHttpClient CreateHttpClient();
IntPtr CreateWebSocketClientPtr(out uint id, string url);
IWebSocketClient CreateWebSocketClient(string url);
bool HasLocalMetaData(string key);
void GetLocalMetaData<T>(string key, out MValueConst result);
bool FileExists(string path);
string FileRead(string path);
byte[] FileReadBinary(string path);
WeaponData GetWeaponDataByWeaponHash(uint weaponHash);
IReadOnlyCollection<ILocalObject> GetAllWorldObjects();
IEnumerable<string> GetRegisteredClientEvents();
IEnumerable<string> GetRegisteredServerEvents();
Vector3 PedBonesPosition(int scriptId, ushort boneId);
IReadOnlyCollection<IPlayer> GetAllPlayers();
IReadOnlyCollection<IVehicle> GetAllVehicles();
IReadOnlyCollection<IBlip> GetAllBlips();
IReadOnlyCollection<ICheckpoint> GetAllCheckpoints();
IReadOnlyCollection<IVirtualEntity> GetAllVirtualEntities();
IReadOnlyCollection<IVirtualEntityGroup> GetAllVirtualEntityGroups();
IReadOnlyCollection<IPed> GetAllPeds();
IReadOnlyCollection<IObject> GetAllNetworkObjects();
IReadOnlyCollection<IColShape> GetAllColShapes();
IReadOnlyCollection<IMarker> GetAllMarkers();
IReadOnlyCollection<ITextLabel> GetAllTextLabels();
IReadOnlyCollection<ILocalObject> GetAllLocalObjects();
IReadOnlyCollection<ILocalVehicle> GetAllLocalVehicles();
IReadOnlyCollection<ILocalPed> GetAllLocalPeds();
bool IsFullScreen { get; }
IBlip GetBlipByGameId(uint gameId);
ICheckpoint GetCheckpointByGameID(uint gameId);
bool IsWebViewGpuAccelerationActive { get; }
IWorldObject GetWorldObjectByScriptID(BaseObjectType type, uint scriptId);
IVirtualEntityGroup CreateVirtualEntityGroup(uint streamingDistance);
IVirtualEntity CreateVirtualEntity(IVirtualEntityGroup group, Position position, uint streamingDistance, Dictionary<string, object> dataDict);
ILocalPed CreateLocalPed(uint modelHash, int dimension, Position position, Rotation rotation, bool useStreaming, uint streamingDistance);
ILocalVehicle CreateLocalVehicle(uint modelHash, int dimension, Position position, Rotation rotation, bool useStreaming, uint streamingDistance);
IMarker CreateMarker(MarkerType type, Position pos, Rgba color, bool useStreaming, uint streamingDistance);
ITextLabel CreateTextLabel(string name, string fontName, float fontSize, float scale, Position pos, Rotation rot, Rgba color, float outlineWidth, Rgba outlineColor, bool useStreaming, uint streamingDistance);
IntPtr CreateColShapeCirclePtr(out uint id, Position position, float radius);
IColShape CreateColShapeCircle(Position position, float radius);
IntPtr CreateColShapeCubePtr(out uint id, Position pos1, Position pos2);
IColShape CreateColShapeCube(Position pos1, Position pos2);
IntPtr CreateColShapeCylinderPtr(out uint id, Position position, float radius, float height);
IColShape CreateColShapeCylinder(Position position, float radius, float height);
IntPtr CreateColShapePolygonPtr(out uint id, float minZ, float maxZ, Vector2[] points);
IColShape CreateColShapePolygon(float minZ, float maxZ, Vector2[] points);
IntPtr CreateColShapeRectanglePtr(out uint id, float x1, float y1, float x2, float y2, float z);
IColShape CreateColShapeRectangle(float x1, float y1, float x2, float y2, float z);
IntPtr CreateColShapeSpherePtr(out uint id, Vector3 position, float radius);
IColShape CreateColShapeSphere(Vector3 position, float radius);
IFont RegisterFont(string path);
uint GetPoolSize(string pool);
uint GetPoolCount(string pool);
uint[] GetPoolEntities(string pool);
uint[] GetVoicePlayers();
void RemoveVoicePlayer(uint playerRemoteId);
float GetVoiceSpatialVolume(uint playerRemoteId);
void SetVoiceSpatialVolume(uint playerRemoteId, float volume);
float GetVoiceNonSpatialVolume(uint playerRemoteId);
void SetVoiceNonSpatialVolume(uint playerRemoteId, float volume);
void AddVoiceFilter(uint playerRemoteId, IAudioFilter filter);
void RemoveVoiceFilter(uint playerRemoteId);
IAudioFilter GetVoiceFilter(uint playerRemoteId);
void UpdateClipContext(Dictionary<string, string> context);
ulong ServerTime { get; }
bool ReloadVehiclePhysics(uint modelHash);
List<SafeTimer> RunningTimers { get; }
Interior GetInterior(uint interiorId);
}
}