From 33f695dda3a43ff83ed646edf96f1a116cc346c0 Mon Sep 17 00:00:00 2001 From: Till Schreiber Date: Sun, 8 Sep 2024 17:39:43 +0200 Subject: [PATCH 1/2] fix(server): fix passenger list by entering on vehicle --- api/AltV.Net/Core.Events.cs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/api/AltV.Net/Core.Events.cs b/api/AltV.Net/Core.Events.cs index 92266988..c36bd325 100644 --- a/api/AltV.Net/Core.Events.cs +++ b/api/AltV.Net/Core.Events.cs @@ -724,24 +724,6 @@ public void OnPlayerEnteringVehicle(IntPtr vehiclePointer, IntPtr playerPointer, return; } - if (VehiclePassengers.TryGetValue(vehiclePointer, out var passengers)) - { - if (passengers.Exists(x => x.PlayerPointer == playerPointer)) - { - var playerSeat = passengers.First(x => x.PlayerPointer == playerPointer); - playerSeat.Seat = seat; - } - else - { - passengers.Add(new InternalPlayerSeat { PlayerPointer = playerPointer, Seat = seat }); - } - } - else - { - VehiclePassengers[vehiclePointer] = new List - { new() { PlayerPointer = playerPointer, Seat = seat } }; - } - OnPlayerEnteringVehicleEvent(vehicle, player, seat); } From e275d6b2739dbac1aa91885d404f6004dd18c6d1 Mon Sep 17 00:00:00 2001 From: Till Schreiber Date: Sun, 8 Sep 2024 20:17:47 +0200 Subject: [PATCH 2/2] Doxoh/refactore core access (#27) * remove Alt.Core access for everyone * add StopServer and GetWeaponModelInfo * add SetPassword, and VoiceServerSettings * change client * finish * small fix --- api/AltV.Net.Async/AltAsync.BaseObject.cs | 2 +- api/AltV.Net.Async/AltAsync.Entity.cs | 6 +- api/AltV.Net.Async/AltAsync.Off.cs | 4 +- api/AltV.Net.Async/AltAsync.On.cs | 136 +-- api/AltV.Net.Async/AltAsync.Ped.cs | 2 +- api/AltV.Net.Async/AltAsync.Player.cs | 10 +- api/AltV.Net.Async/AltAsync.RegisterEvents.cs | 4 +- api/AltV.Net.Async/AltAsync.Vehicle.cs | 4 +- api/AltV.Net.Async/AltAsync.VirtualEntity.cs | 2 +- api/AltV.Net.Async/AltAsync.cs | 250 ++-- api/AltV.Net.Async/AltThreadSafe.Player.cs | 23 +- .../Elements/Entities/AsyncPlayer.cs | 12 +- .../MValueConst.Locked.NoRefs.cs | 56 +- api/AltV.Net.Async/MValueConst.Locked.cs | 70 +- api/AltV.Net.Client.Async/AltAsync.cs | 26 +- api/AltV.Net.Client.Async/AsyncResource.cs | 14 +- api/AltV.Net.Client/Alt.Create.cs | 58 +- api/AltV.Net.Client/Alt.Events.cs | 534 ++++----- api/AltV.Net.Client/Alt.GlobalMeta.cs | 20 +- api/AltV.Net.Client/Alt.Globals.cs | 216 ++-- api/AltV.Net.Client/Alt.MValue.cs | 14 +- api/AltV.Net.Client/Alt.cs | 114 +- api/AltV.Net.Client/Core.Events.cs | 2 +- api/AltV.Net.Client/Core.cs | 2 +- .../Elements/Entities/Entity.cs | 2 +- .../Elements/Entities/LocalObject.cs | 38 +- .../Elements/Entities/Object.cs | 2 +- .../Elements/Entities/Player.cs | 6 +- .../Elements/Pools/AudioFilterPool.cs | 2 +- .../Elements/Pools/AudioOutputAttachedPool.cs | 2 +- .../Elements/Pools/AudioOutputFrontendPool.cs | 2 +- .../Elements/Pools/AudioOutputPool.cs | 2 +- .../Elements/Pools/AudioOutputWorldPool.cs | 2 +- .../Elements/Pools/AudioPool.cs | 2 +- .../Elements/Pools/BlipPool.cs | 2 +- .../Elements/Pools/CheckpointPool.cs | 2 +- .../Elements/Pools/ColShapePool.cs | 2 +- .../Elements/Pools/FontPool.cs | 2 +- .../Elements/Pools/HttpClientPool.cs | 2 +- .../Elements/Pools/LocalObjectPool.cs | 2 +- .../Elements/Pools/LocalPedPool.cs | 2 +- .../Elements/Pools/LocalVehiclePool.cs | 2 +- .../Elements/Pools/MarkerPool.cs | 2 +- .../Elements/Pools/ObjectPool.cs | 2 +- api/AltV.Net.Client/Elements/Pools/PedPool.cs | 2 +- .../Elements/Pools/PlayerPool.cs | 4 +- .../Elements/Pools/RmlDocumentPool.cs | 2 +- .../Elements/Pools/TextLabelPool.cs | 2 +- .../Elements/Pools/VehiclePool.cs | 2 +- .../Elements/Pools/VirtualEntityGroupPool.cs | 2 +- .../Elements/Pools/VirtualEntityPool.cs | 2 +- .../Elements/Pools/WebSocketClientPool.cs | 2 +- .../Elements/Pools/WebViewPool.cs | 2 +- api/AltV.Net.Client/ICore.cs | 1 + api/AltV.Net.Client/ModuleWrapper.cs | 2 +- api/AltV.Net.Example/SampleResource.cs | 35 +- api/AltV.Net.Mock.Example/.gitignore | 4 - .../AltV.Net.Mock.Example.csproj | 20 - api/AltV.Net.Mock.Example/Program.cs | 34 - api/AltV.Net.Mock/AltV.Net.Mock.csproj | 38 - api/AltV.Net.Mock/MockAltV.cs | 76 -- api/AltV.Net.Mock/MockAssemblyLoader.cs | 8 - api/AltV.Net.Mock/MockBlip.cs | 83 -- api/AltV.Net.Mock/MockBlipFactory.cs | 21 - api/AltV.Net.Mock/MockBlipPool.cs | 17 - api/AltV.Net.Mock/MockCheckpoint.Events.cs | 17 - api/AltV.Net.Mock/MockCheckpoint.cs | 60 - api/AltV.Net.Mock/MockCheckpointFactory.cs | 22 - api/AltV.Net.Mock/MockCheckpointPool.cs | 17 - api/AltV.Net.Mock/MockClientEvents.cs | 127 -- api/AltV.Net.Mock/MockColShape.cs | 56 - api/AltV.Net.Mock/MockColShapeFactory.cs | 21 - api/AltV.Net.Mock/MockColShapePool.cs | 17 - api/AltV.Net.Mock/MockConnectionInfo.cs | 48 - .../MockConnectionInfoFactory.cs | 22 - api/AltV.Net.Mock/MockConnectionInfoPool.cs | 17 - api/AltV.Net.Mock/MockCore.cs | 1051 ----------------- api/AltV.Net.Mock/MockDecorator.cs | 73 -- api/AltV.Net.Mock/MockEntities.cs | 51 - api/AltV.Net.Mock/MockEntity.cs | 207 ---- api/AltV.Net.Mock/MockMarker.cs | 12 - api/AltV.Net.Mock/MockMarkerFactory.cs | 21 - api/AltV.Net.Mock/MockMarkerPool.cs | 17 - api/AltV.Net.Mock/MockObject.cs | 13 - api/AltV.Net.Mock/MockObjectFactory.cs | 21 - api/AltV.Net.Mock/MockObjectPool.cs | 23 - api/AltV.Net.Mock/MockPed.cs | 12 - api/AltV.Net.Mock/MockPedFactory.cs | 21 - api/AltV.Net.Mock/MockPedPool.cs | 23 - api/AltV.Net.Mock/MockPlayer.Events.cs | 85 -- api/AltV.Net.Mock/MockPlayer.cs | 12 - api/AltV.Net.Mock/MockPlayerFactory.cs | 21 - api/AltV.Net.Mock/MockPlayerPool.cs | 23 - api/AltV.Net.Mock/MockPoolManager.cs | 22 - api/AltV.Net.Mock/MockResourceLoader.cs | 17 - api/AltV.Net.Mock/MockVehicle.cs | 12 - api/AltV.Net.Mock/MockVehicleFactory.cs | 21 - api/AltV.Net.Mock/MockVehiclePool.cs | 23 - api/AltV.Net.Mock/MockVirtualEntity.cs | 57 - api/AltV.Net.Mock/MockVirtualEntityFactory.cs | 22 - api/AltV.Net.Mock/MockVirtualEntityGroup.cs | 17 - .../MockVirtualEntityGroupFactory.cs | 21 - .../MockVirtualEntityGroupPool.cs | 17 - api/AltV.Net.Mock/MockVirtualEntityPool.cs | 17 - api/AltV.Net.Mock/MockVoiceChannel.cs | 57 - api/AltV.Net.Mock/MockVoiceChannelFactory.cs | 21 - api/AltV.Net.Mock/MockVoiceChannelPool.cs | 17 - api/AltV.Net.Mock/MockWorldObject.cs | 14 - api/AltV.Net.Mock/license/license.txt | 21 - api/AltV.Net.Resources.Chat.Api/ChatModule.cs | 2 +- api/AltV.Net.Shared/AltShared.cs | 6 +- .../Elements/Args/MValueBuffer2.cs | 4 +- .../Elements/Args/MValueWriter2.cs | 8 +- .../Events/HashSetEventHandler.cs | 2 +- api/AltV.Net.Shared/Function.Create.cs | 136 +-- api/AltV.Net.Shared/Function.cs | 6 +- .../FunctionParser/FunctionTypeInfo.cs | 2 +- api/AltV.Net.sln | 16 - api/AltV.Net/Alt.Assembly.cs | 2 +- api/AltV.Net/Alt.Blip.cs | 8 +- api/AltV.Net/Alt.Checkpoint.cs | 4 +- api/AltV.Net/Alt.ColShape.cs | 12 +- api/AltV.Net/Alt.Events.cs | 244 ++-- api/AltV.Net/Alt.Export.cs | 84 +- api/AltV.Net/Alt.ExportNative.cs | 84 +- api/AltV.Net/Alt.Function.cs | 72 +- api/AltV.Net/Alt.GetById.cs | 20 +- api/AltV.Net/Alt.GlobalMeta.cs | 16 +- api/AltV.Net/Alt.Import.cs | 20 +- api/AltV.Net/Alt.Log.Colored.cs | 2 +- api/AltV.Net/Alt.Log.cs | 8 +- api/AltV.Net/Alt.MValue.cs | 102 +- api/AltV.Net/Alt.Marker.cs | 4 +- api/AltV.Net/Alt.Object.cs | 4 +- api/AltV.Net/Alt.On.cs | 400 +++---- api/AltV.Net/Alt.Ped.cs | 6 +- api/AltV.Net/Alt.RegisterEvents.cs | 4 +- api/AltV.Net/Alt.Resource.cs | 12 +- api/AltV.Net/Alt.Vehicle.cs | 6 +- api/AltV.Net/Alt.VirtualEntity.cs | 4 +- api/AltV.Net/Alt.VoiceChannel.cs | 2 +- api/AltV.Net/Alt.cs | 188 +-- api/AltV.Net/Core.Events.cs | 22 +- api/AltV.Net/Core.cs | 4 +- api/AltV.Net/Elements/Args/MValueAdapters.cs | 10 +- api/AltV.Net/Elements/Entities/BaseObject.cs | 2 +- api/AltV.Net/Elements/Entities/Blip.cs | 4 +- api/AltV.Net/Elements/Entities/Checkpoint.cs | 4 +- api/AltV.Net/Elements/Entities/ColShape.cs | 2 +- .../Elements/Entities/ConnectionInfo.cs | 2 +- api/AltV.Net/Elements/Entities/Entity.cs | 4 +- api/AltV.Net/Elements/Entities/Marker.cs | 2 +- api/AltV.Net/Elements/Entities/Object.cs | 2 +- api/AltV.Net/Elements/Entities/Ped.cs | 2 +- api/AltV.Net/Elements/Entities/Player.cs | 16 +- api/AltV.Net/Elements/Entities/Vehicle.cs | 12 +- .../Elements/Entities/VirtualEntity.cs | 4 +- .../Elements/Entities/VirtualEntityGroup.cs | 2 +- .../Elements/Entities/VoiceChannel.cs | 2 +- .../Elements/MValueBufferExtensions.cs | 2 +- api/AltV.Net/Elements/Pools/BlipPool.cs | 2 +- api/AltV.Net/Elements/Pools/CheckpointPool.cs | 2 +- api/AltV.Net/Elements/Pools/ColShapePool.cs | 2 +- .../Elements/Pools/ConnectionInfoPool.cs | 2 +- api/AltV.Net/Elements/Pools/MarkerPool.cs | 2 +- api/AltV.Net/Elements/Pools/ObjectPool.cs | 2 +- api/AltV.Net/Elements/Pools/PedPool.cs | 2 +- api/AltV.Net/Elements/Pools/PlayerPool.cs | 2 +- api/AltV.Net/Elements/Pools/VehiclePool.cs | 2 +- .../Elements/Pools/VirtualEntityGroupPool.cs | 2 +- .../Elements/Pools/VirtualEntityPool.cs | 2 +- .../Elements/Pools/VoiceChannelPool.cs | 2 +- api/AltV.Net/ICore.cs | 23 + api/AltV.Net/ModuleWrapper.cs | 4 +- 174 files changed, 1721 insertions(+), 4424 deletions(-) delete mode 100644 api/AltV.Net.Mock.Example/.gitignore delete mode 100644 api/AltV.Net.Mock.Example/AltV.Net.Mock.Example.csproj delete mode 100644 api/AltV.Net.Mock.Example/Program.cs delete mode 100644 api/AltV.Net.Mock/AltV.Net.Mock.csproj delete mode 100644 api/AltV.Net.Mock/MockAltV.cs delete mode 100644 api/AltV.Net.Mock/MockAssemblyLoader.cs delete mode 100644 api/AltV.Net.Mock/MockBlip.cs delete mode 100644 api/AltV.Net.Mock/MockBlipFactory.cs delete mode 100644 api/AltV.Net.Mock/MockBlipPool.cs delete mode 100644 api/AltV.Net.Mock/MockCheckpoint.Events.cs delete mode 100644 api/AltV.Net.Mock/MockCheckpoint.cs delete mode 100644 api/AltV.Net.Mock/MockCheckpointFactory.cs delete mode 100644 api/AltV.Net.Mock/MockCheckpointPool.cs delete mode 100644 api/AltV.Net.Mock/MockClientEvents.cs delete mode 100644 api/AltV.Net.Mock/MockColShape.cs delete mode 100644 api/AltV.Net.Mock/MockColShapeFactory.cs delete mode 100644 api/AltV.Net.Mock/MockColShapePool.cs delete mode 100644 api/AltV.Net.Mock/MockConnectionInfo.cs delete mode 100644 api/AltV.Net.Mock/MockConnectionInfoFactory.cs delete mode 100644 api/AltV.Net.Mock/MockConnectionInfoPool.cs delete mode 100644 api/AltV.Net.Mock/MockCore.cs delete mode 100644 api/AltV.Net.Mock/MockDecorator.cs delete mode 100644 api/AltV.Net.Mock/MockEntities.cs delete mode 100644 api/AltV.Net.Mock/MockEntity.cs delete mode 100644 api/AltV.Net.Mock/MockMarker.cs delete mode 100644 api/AltV.Net.Mock/MockMarkerFactory.cs delete mode 100644 api/AltV.Net.Mock/MockMarkerPool.cs delete mode 100644 api/AltV.Net.Mock/MockObject.cs delete mode 100644 api/AltV.Net.Mock/MockObjectFactory.cs delete mode 100644 api/AltV.Net.Mock/MockObjectPool.cs delete mode 100644 api/AltV.Net.Mock/MockPed.cs delete mode 100644 api/AltV.Net.Mock/MockPedFactory.cs delete mode 100644 api/AltV.Net.Mock/MockPedPool.cs delete mode 100644 api/AltV.Net.Mock/MockPlayer.Events.cs delete mode 100644 api/AltV.Net.Mock/MockPlayer.cs delete mode 100644 api/AltV.Net.Mock/MockPlayerFactory.cs delete mode 100644 api/AltV.Net.Mock/MockPlayerPool.cs delete mode 100644 api/AltV.Net.Mock/MockPoolManager.cs delete mode 100644 api/AltV.Net.Mock/MockResourceLoader.cs delete mode 100644 api/AltV.Net.Mock/MockVehicle.cs delete mode 100644 api/AltV.Net.Mock/MockVehicleFactory.cs delete mode 100644 api/AltV.Net.Mock/MockVehiclePool.cs delete mode 100644 api/AltV.Net.Mock/MockVirtualEntity.cs delete mode 100644 api/AltV.Net.Mock/MockVirtualEntityFactory.cs delete mode 100644 api/AltV.Net.Mock/MockVirtualEntityGroup.cs delete mode 100644 api/AltV.Net.Mock/MockVirtualEntityGroupFactory.cs delete mode 100644 api/AltV.Net.Mock/MockVirtualEntityGroupPool.cs delete mode 100644 api/AltV.Net.Mock/MockVirtualEntityPool.cs delete mode 100644 api/AltV.Net.Mock/MockVoiceChannel.cs delete mode 100644 api/AltV.Net.Mock/MockVoiceChannelFactory.cs delete mode 100644 api/AltV.Net.Mock/MockVoiceChannelPool.cs delete mode 100644 api/AltV.Net.Mock/MockWorldObject.cs delete mode 100644 api/AltV.Net.Mock/license/license.txt diff --git a/api/AltV.Net.Async/AltAsync.BaseObject.cs b/api/AltV.Net.Async/AltAsync.BaseObject.cs index 655d82d7..d00286bc 100644 --- a/api/AltV.Net.Async/AltAsync.BaseObject.cs +++ b/api/AltV.Net.Async/AltAsync.BaseObject.cs @@ -19,7 +19,7 @@ public static Task GetTypeAsync(this IBaseObject baseObject) => [Obsolete("Use async entities instead")] public static async Task SetMetaDataAsync(this IBaseObject baseObject, string key, object value) { - Alt.Core.CreateMValue(out var mValue, value); + Alt.CoreImpl.CreateMValue(out var mValue, value); await AltVAsync.Schedule(() => baseObject.SetMetaData(key, in mValue)); mValue.Dispose(); } diff --git a/api/AltV.Net.Async/AltAsync.Entity.cs b/api/AltV.Net.Async/AltAsync.Entity.cs index 83f0ec3e..9a9ec570 100644 --- a/api/AltV.Net.Async/AltAsync.Entity.cs +++ b/api/AltV.Net.Async/AltAsync.Entity.cs @@ -24,7 +24,7 @@ public static Task GetRotationAsync(this IEntity entity) => [Obsolete("Use async entities instead")] public static async Task SetSyncedMetaDataAsync(this IEntity entity, string key, object value) { - Alt.Core.CreateMValue(out var mValue, value); + Alt.CoreImpl.CreateMValue(out var mValue, value); await AltVAsync.Schedule(() => entity.SetSyncedMetaData(key, mValue)); mValue.Dispose(); } @@ -40,7 +40,7 @@ public static Task GetSyncedMetaDataAsync(this IEntity entity, string key) [Obsolete("Use async entities instead")] public static async Task SetStreamSyncedMetaDataAsync(this IEntity entity, string key, object value) { - Alt.Core.CreateMValue(out var mValue, value); + Alt.CoreImpl.CreateMValue(out var mValue, value); await AltVAsync.Schedule(() => entity.SetStreamSyncedMetaData(key, mValue)); mValue.Dispose(); } @@ -56,7 +56,7 @@ public static Task GetStreamSyncedMetaDataAsync(this IEntity entity, strin [Obsolete("Use async entities instead")] public static Task DeleteSyncedMetaDataAsync(this IEntity entity, string key) => AltVAsync.Schedule(() => entity.DeleteSyncedMetaData(key)); - + [Obsolete("Use async entities instead")] public static Task DeleteStreamSyncedMetaDataAsync(this IEntity entity, string key) => AltVAsync.Schedule(() => entity.DeleteStreamSyncedMetaData(key)); diff --git a/api/AltV.Net.Async/AltAsync.Off.cs b/api/AltV.Net.Async/AltAsync.Off.cs index 88bc2830..155d79bb 100644 --- a/api/AltV.Net.Async/AltAsync.Off.cs +++ b/api/AltV.Net.Async/AltAsync.Off.cs @@ -3,9 +3,9 @@ namespace AltV.Net.Async public partial class AltAsync { public static void OffServer(string eventName, Function function) => - Core.OffServer(eventName, function); + CoreImpl.OffServer(eventName, function); public static void OffClient(string eventName, Function function) => - Core.OffClient(eventName, function); + CoreImpl.OffClient(eventName, function); } } \ No newline at end of file diff --git a/api/AltV.Net.Async/AltAsync.On.cs b/api/AltV.Net.Async/AltAsync.On.cs index 6357fdf9..7e82f85e 100644 --- a/api/AltV.Net.Async/AltAsync.On.cs +++ b/api/AltV.Net.Async/AltAsync.On.cs @@ -6,248 +6,248 @@ namespace AltV.Net.Async public static partial class AltAsync { public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, - Action action) => Core.OnServer(eventName, Function.Create(Core, action)); + Action action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, - Action action) => Core.OnServer(eventName, Function.Create(Core, action)); + Action action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer( string eventName, Action action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, - Func action) => Core.OnServer(eventName, Function.Create(Core, action)); + Func action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, - Func action) => Core.OnServer(eventName, Function.Create(Core, action)); + Func action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer( string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer( string eventName, Func action) => - Core.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Action action) => Core.OnClient(eventName, Function.Create(Core, action)); + Action action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Action action) => Core.OnClient(eventName, Function.Create(Core, action)); + Action action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient( string eventName, Action action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Func action) => Core.OnClient(eventName, Function.Create(Core, action)); + Func action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Func action) => Core.OnClient(eventName, Function.Create(Core, action)); + Func action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient( string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient( string eventName, Func action) => - Core.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); } } \ No newline at end of file diff --git a/api/AltV.Net.Async/AltAsync.Ped.cs b/api/AltV.Net.Async/AltAsync.Ped.cs index 6bd4ea84..b34ca850 100644 --- a/api/AltV.Net.Async/AltAsync.Ped.cs +++ b/api/AltV.Net.Async/AltAsync.Ped.cs @@ -8,7 +8,7 @@ namespace AltV.Net.Async public static partial class AltAsync { public static Task CreatePed(uint model, Position pos, Rotation rot, uint streamingDistance = 0) => AltVAsync.Schedule(() => - Alt.Core.CreatePed(model, pos, rot, streamingDistance)); + Alt.CoreImpl.CreatePed(model, pos, rot, streamingDistance)); public static Task CreatePed(PedModel model, Position pos, Rotation rot, uint streamingDistance = 0) => CreatePed((uint)model, pos, rot, streamingDistance); diff --git a/api/AltV.Net.Async/AltAsync.Player.cs b/api/AltV.Net.Async/AltAsync.Player.cs index 41cdaf93..d6cb23f3 100644 --- a/api/AltV.Net.Async/AltAsync.Player.cs +++ b/api/AltV.Net.Async/AltAsync.Player.cs @@ -88,8 +88,8 @@ public static async Task GetVehicleAsync(this IPlayer player) unsafe { player.CheckIfEntityExists(); - var vehiclePtr = Alt.Core.Library.Shared.Player_GetVehicle(player.PlayerNativePointer); - return Alt.Core.PoolManager.Vehicle.Get(vehiclePtr); + var vehiclePtr = Alt.CoreImpl.Library.Shared.Player_GetVehicle(player.PlayerNativePointer); + return Alt.CoreImpl.PoolManager.Vehicle.Get(vehiclePtr); } }); } @@ -156,7 +156,7 @@ await AltVAsync.Schedule(() => unsafe { player.CheckIfEntityExists(); - Alt.Core.Library.Server.Player_Kick(player.PlayerNativePointer, reasonPtr); + Alt.CoreImpl.Library.Server.Player_Kick(player.PlayerNativePointer, reasonPtr); } }); Marshal.FreeHGlobal(reasonPtr); @@ -167,12 +167,12 @@ public static async Task EmitAsync(this IPlayer player, string eventName, params { var size = args.Length; var mValues = new MValueConst[size]; - Alt.Core.CreateMValues(mValues, args); + Alt.CoreImpl.CreateMValues(mValues, args); var eventNamePtr = MemoryUtils.StringToHGlobalUtf8(eventName); await AltVAsync.Schedule(() => { player.CheckIfEntityExists(); - Alt.Core.TriggerClientEvent(player, eventNamePtr, mValues); + Alt.CoreImpl.TriggerClientEvent(player, eventNamePtr, mValues); }); Marshal.FreeHGlobal(eventNamePtr); for (var i = 0; i < size; i++) diff --git a/api/AltV.Net.Async/AltAsync.RegisterEvents.cs b/api/AltV.Net.Async/AltAsync.RegisterEvents.cs index 2161f1cf..a9b9eb01 100644 --- a/api/AltV.Net.Async/AltAsync.RegisterEvents.cs +++ b/api/AltV.Net.Async/AltAsync.RegisterEvents.cs @@ -727,11 +727,11 @@ public static void RegisterEvents(object target) break; case AsyncServerEventAttribute @event: var serverEventName = @event.Name ?? eventMethod.Name; - Core.OnServer(serverEventName, Function.Create(Core, eventMethodDelegate)); + CoreImpl.OnServer(serverEventName, Function.Create(CoreImpl, eventMethodDelegate)); break; case AsyncClientEventAttribute @event: var clientEventName = @event.Name ?? eventMethod.Name; - Core.OnClient(clientEventName, Function.Create(Core, eventMethodDelegate)); + CoreImpl.OnClient(clientEventName, Function.Create(CoreImpl, eventMethodDelegate)); break; } }); diff --git a/api/AltV.Net.Async/AltAsync.Vehicle.cs b/api/AltV.Net.Async/AltAsync.Vehicle.cs index cf6eeb49..10df42a9 100644 --- a/api/AltV.Net.Async/AltAsync.Vehicle.cs +++ b/api/AltV.Net.Async/AltAsync.Vehicle.cs @@ -14,7 +14,7 @@ namespace AltV.Net.Async public static partial class AltAsync { public static Task CreateVehicle(uint model, Position pos, Rotation rot, uint streamingDistance = 0) => AltVAsync.Schedule(() => - Alt.Core.CreateVehicle(model, pos, rot, streamingDistance)); + Alt.CreateVehicle(model, pos, rot, streamingDistance)); public static Task CreateVehicle(VehicleModel model, Position pos, Rotation rot, uint streamingDistance = 0) => CreateVehicle((uint) model, pos, rot, streamingDistance); @@ -163,7 +163,7 @@ await AltVAsync.Schedule(() => unsafe { vehicle.CheckIfEntityExists(); - Alt.Core.Library.Server.Vehicle_SetNumberplateText(vehicle.VehicleNativePointer, numberPlateTextPtr); + Alt.CoreImpl.Library.Server.Vehicle_SetNumberplateText(vehicle.VehicleNativePointer, numberPlateTextPtr); } }); Marshal.FreeHGlobal(numberPlateTextPtr); diff --git a/api/AltV.Net.Async/AltAsync.VirtualEntity.cs b/api/AltV.Net.Async/AltAsync.VirtualEntity.cs index 10af810c..62c796f1 100644 --- a/api/AltV.Net.Async/AltAsync.VirtualEntity.cs +++ b/api/AltV.Net.Async/AltAsync.VirtualEntity.cs @@ -8,7 +8,7 @@ namespace AltV.Net.Async; public partial class AltAsync { public static Task CreateVirtualEntityGroup(uint streamingDistance) =>AltVAsync.Schedule(() => - Alt.Core.CreateVirtualEntityGroup(streamingDistance)); + Alt.CreateVirtualEntityGroup(streamingDistance)); public static Task CreateVirtualEntity(IVirtualEntityGroup group, Position position, uint streamingDistance, Dictionary dataDict) => diff --git a/api/AltV.Net.Async/AltAsync.cs b/api/AltV.Net.Async/AltAsync.cs index 0307aa58..d37f25dd 100644 --- a/api/AltV.Net.Async/AltAsync.cs +++ b/api/AltV.Net.Async/AltAsync.cs @@ -13,362 +13,362 @@ namespace AltV.Net.Async { public static partial class AltAsync { - internal static AsyncCore Core; + internal static AsyncCore CoreImpl; internal static AltVAsync AltVAsync; public static event CheckpointAsyncDelegate OnCheckpoint { - add => Core.CheckpointAsyncEventHandler.Add(value); - remove => Core.CheckpointAsyncEventHandler.Remove(value); + add => CoreImpl.CheckpointAsyncEventHandler.Add(value); + remove => CoreImpl.CheckpointAsyncEventHandler.Remove(value); } public static event BaseObjectCreateAsyncDelegate OnBaseObjectCreate { - add => Core.BaseObjectCreateAsyncEventHandler.Add(value); - remove => Core.BaseObjectCreateAsyncEventHandler.Remove(value); + add => CoreImpl.BaseObjectCreateAsyncEventHandler.Add(value); + remove => CoreImpl.BaseObjectCreateAsyncEventHandler.Remove(value); } public static event BaseObjectRemoveAsyncDelegate OnBaseObjectRemove { - add => Core.BaseObjectRemoveAsyncEventHandler.Add(value); - remove => Core.BaseObjectRemoveAsyncEventHandler.Remove(value); + add => CoreImpl.BaseObjectRemoveAsyncEventHandler.Add(value); + remove => CoreImpl.BaseObjectRemoveAsyncEventHandler.Remove(value); } public static event PlayerConnectAsyncDelegate OnPlayerConnect { - add => Core.PlayerConnectAsyncEventHandler.Add(value); - remove => Core.PlayerConnectAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerConnectAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerConnectAsyncEventHandler.Remove(value); } public static event PlayerDamageAsyncDelegate OnPlayerDamage { - add => Core.PlayerDamageAsyncEventHandler.Add(value); - remove => Core.PlayerDamageAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerDamageAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerDamageAsyncEventHandler.Remove(value); } public static event PlayerDeadAsyncDelegate OnPlayerDead { - add => Core.PlayerDeadAsyncEventHandler.Add(value); - remove => Core.PlayerDeadAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerDeadAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerDeadAsyncEventHandler.Remove(value); } public static event PlayerHealAsyncDelegate OnPlayerHeal { - add => Core.PlayerHealAsyncEventHandler.Add(value); - remove => Core.PlayerHealAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerHealAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerHealAsyncEventHandler.Remove(value); } public static event ExplosionAsyncDelegate OnExplosion { - add => Core.ExplosionAsyncEventHandler.Add(value); - remove => Core.ExplosionAsyncEventHandler.Remove(value); + add => CoreImpl.ExplosionAsyncEventHandler.Add(value); + remove => CoreImpl.ExplosionAsyncEventHandler.Remove(value); } public static event WeaponDamageAsyncDelegate OnWeaponDamage { - add => Core.WeaponDamageAsyncEventHandler.Add(value); - remove => Core.WeaponDamageAsyncEventHandler.Remove(value); + add => CoreImpl.WeaponDamageAsyncEventHandler.Add(value); + remove => CoreImpl.WeaponDamageAsyncEventHandler.Remove(value); } public static event PlayerChangeVehicleSeatAsyncDelegate OnPlayerChangeVehicleSeat { - add => Core.PlayerChangeVehicleSeatAsyncEventHandler.Add(value); - remove => Core.PlayerChangeVehicleSeatAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerChangeVehicleSeatAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerChangeVehicleSeatAsyncEventHandler.Remove(value); } public static event PlayerEnterVehicleAsyncDelegate OnPlayerEnterVehicle { - add => Core.PlayerEnterVehicleAsyncEventHandler.Add(value); - remove => Core.PlayerEnterVehicleAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerEnterVehicleAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerEnterVehicleAsyncEventHandler.Remove(value); } public static event PlayerEnteringVehicleAsyncDelegate OnPlayerEnteringVehicle { - add => Core.PlayerEnteringVehicleAsyncEventHandler.Add(value); - remove => Core.PlayerEnteringVehicleAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerEnteringVehicleAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerEnteringVehicleAsyncEventHandler.Remove(value); } public static event PlayerLeaveVehicleAsyncDelegate OnPlayerLeaveVehicle { - add => Core.PlayerLeaveVehicleAsyncEventHandler.Add(value); - remove => Core.PlayerLeaveVehicleAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerLeaveVehicleAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerLeaveVehicleAsyncEventHandler.Remove(value); } public static event PlayerDisconnectAsyncDelegate OnPlayerDisconnect { - add => Core.PlayerDisconnectAsyncEventHandler.Add(value); - remove => Core.PlayerDisconnectAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerDisconnectAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerDisconnectAsyncEventHandler.Remove(value); } public static event PlayerRemoveAsyncDelegate OnPlayerRemove { - add => Core.PlayerRemoveAsyncEventHandler.Add(value); - remove => Core.PlayerRemoveAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerRemoveAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerRemoveAsyncEventHandler.Remove(value); } public static event VehicleRemoveAsyncDelegate OnVehicleRemove { - add => Core.VehicleRemoveAsyncEventHandler.Add(value); - remove => Core.VehicleRemoveAsyncEventHandler.Remove(value); + add => CoreImpl.VehicleRemoveAsyncEventHandler.Add(value); + remove => CoreImpl.VehicleRemoveAsyncEventHandler.Remove(value); } public static event PedRemoveAsyncDelegate OnPedRemove { - add => Core.PedRemoveAsyncEventHandler.Add(value); - remove => Core.PedRemoveAsyncEventHandler.Remove(value); + add => CoreImpl.PedRemoveAsyncEventHandler.Add(value); + remove => CoreImpl.PedRemoveAsyncEventHandler.Remove(value); } public static event PlayerClientEventAsyncDelegate OnPlayerEvent { - add => Core.PlayerClientEventAsyncEventHandler.Add(value); - remove => Core.PlayerClientEventAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerClientEventAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerClientEventAsyncEventHandler.Remove(value); } public static event ConsoleCommandAsyncDelegate OnConsoleCommand { - add => Core.ConsoleCommandAsyncEventHandler.Add(value); - remove => Core.ConsoleCommandAsyncEventHandler.Remove(value); + add => CoreImpl.ConsoleCommandAsyncEventHandler.Add(value); + remove => CoreImpl.ConsoleCommandAsyncEventHandler.Remove(value); } public static event MetaDataChangeAsyncDelegate OnMetaDataChange { - add => Core.MetaDataChangeAsyncEventHandler.Add(value); - remove => Core.MetaDataChangeAsyncEventHandler.Remove(value); + add => CoreImpl.MetaDataChangeAsyncEventHandler.Add(value); + remove => CoreImpl.MetaDataChangeAsyncEventHandler.Remove(value); } public static event MetaDataChangeAsyncDelegate OnSyncedMetaDataChange { - add => Core.SyncedMetaDataChangeAsyncEventHandler.Add(value); - remove => Core.SyncedMetaDataChangeAsyncEventHandler.Remove(value); + add => CoreImpl.SyncedMetaDataChangeAsyncEventHandler.Add(value); + remove => CoreImpl.SyncedMetaDataChangeAsyncEventHandler.Remove(value); } public static event ColShapeAsyncDelegate OnColShape { - add => Core.ColShapeAsyncEventHandler.Add(value); - remove => Core.ColShapeAsyncEventHandler.Remove(value); + add => CoreImpl.ColShapeAsyncEventHandler.Add(value); + remove => CoreImpl.ColShapeAsyncEventHandler.Remove(value); } public static event VehicleDestroyAsyncDelegate OnVehicleDestroy { - add => Core.VehicleDestroyAsyncEventHandler.Add(value); - remove => Core.VehicleDestroyAsyncEventHandler.Remove(value); + add => CoreImpl.VehicleDestroyAsyncEventHandler.Add(value); + remove => CoreImpl.VehicleDestroyAsyncEventHandler.Remove(value); } public static event FireAsyncDelegate OnFire { - add => Core.FireAsyncEventHandler.Add(value); - remove => Core.FireAsyncEventHandler.Remove(value); + add => CoreImpl.FireAsyncEventHandler.Add(value); + remove => CoreImpl.FireAsyncEventHandler.Remove(value); } public static event StartProjectileAsyncDelegate OnStartProjectile { - add => Core.StartProjectileAsyncEventHandler.Add(value); - remove => Core.StartProjectileAsyncEventHandler.Remove(value); + add => CoreImpl.StartProjectileAsyncEventHandler.Add(value); + remove => CoreImpl.StartProjectileAsyncEventHandler.Remove(value); } public static event PlayerWeaponChangeAsyncDelegate OnPlayerWeaponChange { - add => Core.PlayerWeaponChangeAsyncEventHandler.Add(value); - remove => Core.PlayerWeaponChangeAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerWeaponChangeAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerWeaponChangeAsyncEventHandler.Remove(value); } public static event NetOwnerChangeAsyncDelegate OnNetworkOwnerChange { - add => Core.NetOwnerChangeAsyncEventHandler.Add(value); - remove => Core.NetOwnerChangeAsyncEventHandler.Remove(value); + add => CoreImpl.NetOwnerChangeAsyncEventHandler.Add(value); + remove => CoreImpl.NetOwnerChangeAsyncEventHandler.Remove(value); } public static event VehicleAttachAsyncDelegate OnVehicleAttach { - add => Core.VehicleAttachAsyncEventHandler.Add(value); - remove => Core.VehicleAttachAsyncEventHandler.Remove(value); + add => CoreImpl.VehicleAttachAsyncEventHandler.Add(value); + remove => CoreImpl.VehicleAttachAsyncEventHandler.Remove(value); } public static event VehicleDetachAsyncDelegate OnVehicleDetach { - add => Core.VehicleDetachAsyncEventHandler.Add(value); - remove => Core.VehicleDetachAsyncEventHandler.Remove(value); + add => CoreImpl.VehicleDetachAsyncEventHandler.Add(value); + remove => CoreImpl.VehicleDetachAsyncEventHandler.Remove(value); } public static event VehicleDamageAsyncDelegate OnVehicleDamage { - add => Core.VehicleDamageAsyncEventHandler.Add(value); - remove => Core.VehicleDamageAsyncEventHandler.Remove(value); + add => CoreImpl.VehicleDamageAsyncEventHandler.Add(value); + remove => CoreImpl.VehicleDamageAsyncEventHandler.Remove(value); } public static event VehicleHornAsyncDelegate OnVehicleHorn { - add => Core.VehicleHornAsyncEventHandler.Add(value); - remove => Core.VehicleHornAsyncEventHandler.Remove(value); + add => CoreImpl.VehicleHornAsyncEventHandler.Add(value); + remove => CoreImpl.VehicleHornAsyncEventHandler.Remove(value); } public static event ConnectionQueueAddAsyncDelegate OnConnectionQueueAdd { - add => Core.ConnectionQueueAddAsyncEventHandler.Add(value); - remove => Core.ConnectionQueueAddAsyncEventHandler.Remove(value); + add => CoreImpl.ConnectionQueueAddAsyncEventHandler.Add(value); + remove => CoreImpl.ConnectionQueueAddAsyncEventHandler.Remove(value); } public static event ConnectionQueueRemoveAsyncDelegate OnConnectionQueueRemove { - add => Core.ConnectionQueueRemoveAsyncEventHandler.Add(value); - remove => Core.ConnectionQueueRemoveAsyncEventHandler.Remove(value); + add => CoreImpl.ConnectionQueueRemoveAsyncEventHandler.Add(value); + remove => CoreImpl.ConnectionQueueRemoveAsyncEventHandler.Remove(value); } public static event ServerStartedAsyncDelegate OnServerStarted { - add => Core.ServerStartedAsyncEventHandler.Add(value); - remove => Core.ServerStartedAsyncEventHandler.Remove(value); + add => CoreImpl.ServerStartedAsyncEventHandler.Add(value); + remove => CoreImpl.ServerStartedAsyncEventHandler.Remove(value); } public static event PlayerRequestControlAsyncDelegate OnPlayerRequestControl { - add => Core.PlayerRequestControlAsyncEventHandler.Add(value); - remove => Core.PlayerRequestControlAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerRequestControlAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerRequestControlAsyncEventHandler.Remove(value); } public static event PlayerChangeAnimationAsyncDelegate OnPlayerChangeAnimation { - add => Core.PlayerChangeAnimationAsyncEventHandler.Add(value); - remove => Core.PlayerChangeAnimationAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerChangeAnimationAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerChangeAnimationAsyncEventHandler.Remove(value); } public static event PlayerChangeInteriorAsyncDelegate OnPlayerChangeInterior { - add => Core.PlayerChangeInteriorAsyncEventHandler.Add(value); - remove => Core.PlayerChangeInteriorAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerChangeInteriorAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerChangeInteriorAsyncEventHandler.Remove(value); } public static event PlayerDimensionChangeAsyncDelegate OnPlayerDimensionChange { - add => Core.PlayerDimensionChangeAsyncEventHandler.Add(value); - remove => Core.PlayerDimensionChangeAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerDimensionChangeAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerDimensionChangeAsyncEventHandler.Remove(value); } public static event VehicleSirenAsyncDelegate OnVehicleSiren { - add => Core.VehicleSirenAsyncEventHandler.Add(value); - remove => Core.VehicleSirenAsyncEventHandler.Remove(value); + add => CoreImpl.VehicleSirenAsyncEventHandler.Add(value); + remove => CoreImpl.VehicleSirenAsyncEventHandler.Remove(value); } public static event PlayerSpawnAsyncDelegate OnPlayerSpawn { - add => Core.PlayerSpawnAsyncEventHandler.Add(value); - remove => Core.PlayerSpawnAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerSpawnAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerSpawnAsyncEventHandler.Remove(value); } public static event RequestSyncedSceneAsyncEventDelegate OnRequestSyncedScene { - add => Core.RequestSyncedSceneAsyncEventHandler.Add(value); - remove => Core.RequestSyncedSceneAsyncEventHandler.Remove(value); + add => CoreImpl.RequestSyncedSceneAsyncEventHandler.Add(value); + remove => CoreImpl.RequestSyncedSceneAsyncEventHandler.Remove(value); } public static event StartSyncedSceneAsyncEventDelegate OnStartSyncedScene { - add => Core.StartSyncedSceneAsyncEventHandler.Add(value); - remove => Core.StartSyncedSceneAsyncEventHandler.Remove(value); + add => CoreImpl.StartSyncedSceneAsyncEventHandler.Add(value); + remove => CoreImpl.StartSyncedSceneAsyncEventHandler.Remove(value); } public static event StopSyncedSceneAsyncEventDelegate OnStopSyncedScene { - add => Core.StopSyncedSceneAsyncEventHandler.Add(value); - remove => Core.StopSyncedSceneAsyncEventHandler.Remove(value); + add => CoreImpl.StopSyncedSceneAsyncEventHandler.Add(value); + remove => CoreImpl.StopSyncedSceneAsyncEventHandler.Remove(value); } public static event UpdateSyncedSceneAsyncEventDelegate OnUpdateSyncedScene { - add => Core.UpdateSyncedSceneAsyncEventHandler.Add(value); - remove => Core.UpdateSyncedSceneAsyncEventHandler.Remove(value); + add => CoreImpl.UpdateSyncedSceneAsyncEventHandler.Add(value); + remove => CoreImpl.UpdateSyncedSceneAsyncEventHandler.Remove(value); } public static event ClientRequestObjectAsyncEventDelegate OnClientRequestObject { - add => Core.ClientRequestObjectAsyncEventHandler.Add(value); - remove => Core.ClientRequestObjectAsyncEventHandler.Remove(value); + add => CoreImpl.ClientRequestObjectAsyncEventHandler.Add(value); + remove => CoreImpl.ClientRequestObjectAsyncEventHandler.Remove(value); } public static event ClientDeleteObjectAsyncEventDelegate OnClientDeleteObject { - add => Core.ClientDeleteObjectAsyncEventHandler.Add(value); - remove => Core.ClientDeleteObjectAsyncEventHandler.Remove(value); + add => CoreImpl.ClientDeleteObjectAsyncEventHandler.Add(value); + remove => CoreImpl.ClientDeleteObjectAsyncEventHandler.Remove(value); } public static event GivePedScriptedTaskAsyncDelegate OnGivePedScriptedTask { - add => Core.GivePedScriptedTaskAsyncEventHandler.Add(value); - remove => Core.GivePedScriptedTaskAsyncEventHandler.Remove(value); + add => CoreImpl.GivePedScriptedTaskAsyncEventHandler.Add(value); + remove => CoreImpl.GivePedScriptedTaskAsyncEventHandler.Remove(value); } public static event PedDamageAsyncDelegate OnPedDamage { - add => Core.PedDamageAsyncEventHandler.Add(value); - remove => Core.PedDamageAsyncEventHandler.Remove(value); + add => CoreImpl.PedDamageAsyncEventHandler.Add(value); + remove => CoreImpl.PedDamageAsyncEventHandler.Remove(value); } public static event PedDeadAsyncDelegate OnPedDead { - add => Core.PedDeadAsyncEventHandler.Add(value); - remove => Core.PedDeadAsyncEventHandler.Remove(value); + add => CoreImpl.PedDeadAsyncEventHandler.Add(value); + remove => CoreImpl.PedDeadAsyncEventHandler.Remove(value); } public static event PedHealAsyncDelegate OnPedHeal { - add => Core.PedHealAsyncEventHandler.Add(value); - remove => Core.PedHealAsyncEventHandler.Remove(value); + add => CoreImpl.PedHealAsyncEventHandler.Add(value); + remove => CoreImpl.PedHealAsyncEventHandler.Remove(value); } public static event PlayerStartTalkingAsyncDelegate OnPlayerStartTalking { - add => Core.PlayerStartTalkingAsyncEventHandler.Add(value); - remove => Core.PlayerStartTalkingAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerStartTalkingAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerStartTalkingAsyncEventHandler.Remove(value); } public static event PlayerStopTalkingAsyncDelegate OnPlayerStopTalking { - add => Core.PlayerStopTalkingAsyncEventHandler.Add(value); - remove => Core.PlayerStopTalkingAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerStopTalkingAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerStopTalkingAsyncEventHandler.Remove(value); } public static event ScriptRpcAsyncDelegate OnScriptRpc { - add => Core.ScriptRpcAsyncEventHandler.Add(value); - remove => Core.ScriptRpcAsyncEventHandler.Remove(value); + add => CoreImpl.ScriptRpcAsyncEventHandler.Add(value); + remove => CoreImpl.ScriptRpcAsyncEventHandler.Remove(value); } public static event ScriptRpcAnswerAsyncDelegate OnScriptRpcAnswer { - add => Core.ScriptRpcAnswerAsyncEventHandler.Add(value); - remove => Core.ScriptRpcAnswerAsyncEventHandler.Remove(value); + add => CoreImpl.ScriptRpcAnswerAsyncEventHandler.Add(value); + remove => CoreImpl.ScriptRpcAnswerAsyncEventHandler.Remove(value); } public static event PlayerConnectDeniedAsyncDelegate OnPlayerConnectDenied { - add => Core.PlayerConnectDeniedAsyncEventHandler.Add(value); - remove => Core.PlayerConnectDeniedAsyncEventHandler.Remove(value); + add => CoreImpl.PlayerConnectDeniedAsyncEventHandler.Add(value); + remove => CoreImpl.PlayerConnectDeniedAsyncEventHandler.Remove(value); } public static event ResourceEventAsyncDelegate OnResourceStart { - add => Core.ResourceStartAsyncEventHandler.Add(value); - remove => Core.ResourceStartAsyncEventHandler.Remove(value); + add => CoreImpl.ResourceStartAsyncEventHandler.Add(value); + remove => CoreImpl.ResourceStartAsyncEventHandler.Remove(value); } public static event ResourceEventAsyncDelegate OnResourceStop { - add => Core.ResourceStopAsyncEventHandler.Add(value); - remove => Core.ResourceStopAsyncEventHandler.Remove(value); + add => CoreImpl.ResourceStopAsyncEventHandler.Add(value); + remove => CoreImpl.ResourceStopAsyncEventHandler.Remove(value); } public static event ResourceEventAsyncDelegate OnResourceError { - add => Core.ResourceErrorAsyncEventHandler.Add(value); - remove => Core.ResourceErrorAsyncEventHandler.Remove(value); + add => CoreImpl.ResourceErrorAsyncEventHandler.Add(value); + remove => CoreImpl.ResourceErrorAsyncEventHandler.Remove(value); } public static async void Log(string message) { var messagePtr = MemoryUtils.StringToHGlobalUtf8(message); - await Do(() => Alt.Core.LogInfo(messagePtr)); + await Do(() => Alt.CoreImpl.LogInfo(messagePtr)); Marshal.FreeHGlobal(messagePtr); } @@ -376,9 +376,9 @@ public static async void Emit(string eventName, params object[] args) { var size = args.Length; var mValues = new MValueConst[size]; - Alt.Core.CreateMValues(mValues, args); + Alt.CoreImpl.CreateMValues(mValues, args); var eventNamePtr = MemoryUtils.StringToHGlobalUtf8(eventName); - await Do(() => Alt.Core.TriggerLocalEvent(eventNamePtr, mValues)); + await Do(() => Alt.CoreImpl.TriggerLocalEvent(eventNamePtr, mValues)); Marshal.FreeHGlobal(eventNamePtr); for (var i = 0; i < size; i++) { @@ -390,9 +390,9 @@ public static async void EmitAllClients(string eventName, params object[] args) { var size = args.Length; var mValues = new MValueConst[size]; - Alt.Core.CreateMValues(mValues, args); + Alt.CoreImpl.CreateMValues(mValues, args); var eventNamePtr = MemoryUtils.StringToHGlobalUtf8(eventName); - await Do(() => Alt.Core.TriggerClientEventForAll(eventNamePtr, mValues)); + await Do(() => Alt.CoreImpl.TriggerClientEventForAll(eventNamePtr, mValues)); Marshal.FreeHGlobal(eventNamePtr); for (var i = 0; i < size; i++) { @@ -404,9 +404,9 @@ public static async void EmitUnreliableAllClients(string eventName, params objec { var size = args.Length; var mValues = new MValueConst[size]; - Alt.Core.CreateMValues(mValues, args); + Alt.CoreImpl.CreateMValues(mValues, args); var eventNamePtr = MemoryUtils.StringToHGlobalUtf8(eventName); - await Do(() => Alt.Core.TriggerClientEventUnreliableForAll(eventNamePtr, mValues)); + await Do(() => Alt.CoreImpl.TriggerClientEventUnreliableForAll(eventNamePtr, mValues)); Marshal.FreeHGlobal(eventNamePtr); for (var i = 0; i < size; i++) { @@ -431,7 +431,7 @@ internal static void Setup(AltVAsync altVAsync) internal static void Setup(AsyncCore core) { - Core = core; + CoreImpl = core; } public static Task Do(Action action) diff --git a/api/AltV.Net.Async/AltThreadSafe.Player.cs b/api/AltV.Net.Async/AltThreadSafe.Player.cs index 471f1d20..5c9bc04c 100644 --- a/api/AltV.Net.Async/AltThreadSafe.Player.cs +++ b/api/AltV.Net.Async/AltThreadSafe.Player.cs @@ -88,18 +88,13 @@ public static bool GetPositionLocked(this IPlayer player, ref Position position) { lock (player) { - unsafe + if (!player.Exists) { - if (!player.Exists) - { - return false; - } - - var pos = Vector3.Zero; - Alt.Core.Library.Shared.WorldObject_GetPosition(player.WorldObjectNativePointer, &pos); - position = pos; - return true; + return false; } + + position = player.Position; + return true; } } @@ -114,7 +109,7 @@ public static bool EmitLockedWithContext(this IPlayer player, string eventName, { if (player.Exists) { - Alt.Core.TriggerClientEvent(player, eventNamePtr, mValues); + Alt.CoreImpl.TriggerClientEvent(player, eventNamePtr, mValues); } else { @@ -143,7 +138,7 @@ public static bool EmitUnreliableLockedWithContext(this IPlayer player, string e { if (player.Exists) { - Alt.Core.TriggerClientEventUnreliable(player, eventNamePtr, mValues); + Alt.CoreImpl.TriggerClientEventUnreliable(player, eventNamePtr, mValues); } else { @@ -172,7 +167,7 @@ public static bool EmitLocked(this IPlayer player, string eventName, params obje { if (player.Exists) { - Alt.Core.TriggerClientEvent(player, eventNamePtr, mValues); + Alt.CoreImpl.TriggerClientEvent(player, eventNamePtr, mValues); } else { @@ -201,7 +196,7 @@ public static bool EmitUnreliableLocked(this IPlayer player, string eventName, p { if (player.Exists) { - Alt.Core.TriggerClientEventUnreliable(player, eventNamePtr, mValues); + Alt.CoreImpl.TriggerClientEventUnreliable(player, eventNamePtr, mValues); } else { diff --git a/api/AltV.Net.Async/Elements/Entities/AsyncPlayer.cs b/api/AltV.Net.Async/Elements/Entities/AsyncPlayer.cs index 9c412a7b..1ef1cef3 100644 --- a/api/AltV.Net.Async/Elements/Entities/AsyncPlayer.cs +++ b/api/AltV.Net.Async/Elements/Entities/AsyncPlayer.cs @@ -580,7 +580,7 @@ public void Spawn(Position position, uint delayMs = 0) Player.Spawn(position, delayMs); } } - + public void Spawn(uint model, Position position, uint delayMs = 0) { lock (Player) @@ -589,7 +589,7 @@ public void Spawn(uint model, Position position, uint delayMs = 0) Player.Spawn(model, position, delayMs); } } - + public void Spawn(PedModel model, Position position, uint delayMs = 0) { lock (Player) @@ -726,7 +726,7 @@ public void Emit(string eventName, params object[] args) { if (Player.Exists) { - Alt.Core.TriggerClientEvent(Player, eventNamePtr, mValues); + Alt.CoreImpl.TriggerClientEvent(Player, eventNamePtr, mValues); } } @@ -749,7 +749,7 @@ public ushort EmitRPC(string name, params object[] args) { if (Player.Exists) { - result = Alt.Core.TriggerClientRPC(Player, eventNamePtr, mValues); + result = Alt.CoreImpl.TriggerClientRPC(Player, eventNamePtr, mValues); } } @@ -771,7 +771,7 @@ public void EmitRPCAnswer(ushort answerId, object answer, string error) { if (Player.Exists) { - Alt.Core.TriggerClientRPCAnswer(Player, answerId, mValue, errorPtr); + Alt.CoreImpl.TriggerClientRPCAnswer(Player, answerId, mValue, errorPtr); } } @@ -795,7 +795,7 @@ public void EmitUnreliable(string eventName, params object[] args) { if (Player.Exists) { - Alt.Core.TriggerClientEventUnreliable(Player, eventNamePtr, mValues); + Alt.CoreImpl.TriggerClientEventUnreliable(Player, eventNamePtr, mValues); } } diff --git a/api/AltV.Net.Async/MValueConst.Locked.NoRefs.cs b/api/AltV.Net.Async/MValueConst.Locked.NoRefs.cs index 45275b9a..7bc0b7eb 100644 --- a/api/AltV.Net.Async/MValueConst.Locked.NoRefs.cs +++ b/api/AltV.Net.Async/MValueConst.Locked.NoRefs.cs @@ -20,7 +20,7 @@ public static void CreateLocked(IPlayer player, out MValueConst mValue) return; } - Alt.Core.CreateMValueBaseObject(out mValue, player); + Alt.CoreImpl.CreateMValueBaseObject(out mValue, player); } } @@ -34,7 +34,7 @@ public static void CreateLocked(IVehicle vehicle, out MValueConst mValue) return; } - Alt.Core.CreateMValueBaseObject(out mValue, vehicle); + Alt.CoreImpl.CreateMValueBaseObject(out mValue, vehicle); } } @@ -48,7 +48,7 @@ public static void CreateLocked(IBlip blip, out MValueConst mValue) return; } - Alt.Core.CreateMValueBaseObject(out mValue, blip); + Alt.CoreImpl.CreateMValueBaseObject(out mValue, blip); } } @@ -62,7 +62,7 @@ public static void CreateLocked(IPed ped, out MValueConst mValue) return; } - Alt.Core.CreateMValueBaseObject(out mValue, ped); + Alt.CoreImpl.CreateMValueBaseObject(out mValue, ped); } } @@ -76,7 +76,7 @@ public static void CreateLocked(ICheckpoint checkpoint, out MValueConst mValue) return; } - Alt.Core.CreateMValueBaseObject(out mValue, checkpoint); + Alt.CoreImpl.CreateMValueBaseObject(out mValue, checkpoint); } } @@ -112,47 +112,47 @@ public static void CreateFromObjectLocked(object obj, out MValueConst mValue) CreateLocked(checkpoint, out mValue); return; case bool value: - Alt.Core.CreateMValueBool(out mValue, value); + Alt.CoreImpl.CreateMValueBool(out mValue, value); return; case int value: - Alt.Core.CreateMValueInt(out mValue, value); + Alt.CoreImpl.CreateMValueInt(out mValue, value); return; case uint value: - Alt.Core.CreateMValueUInt(out mValue, value); + Alt.CoreImpl.CreateMValueUInt(out mValue, value); return; case long value: - Alt.Core.CreateMValueInt(out mValue, value); + Alt.CoreImpl.CreateMValueInt(out mValue, value); return; case ulong value: - Alt.Core.CreateMValueUInt(out mValue, value); + Alt.CoreImpl.CreateMValueUInt(out mValue, value); return; case double value: - Alt.Core.CreateMValueDouble(out mValue, value); + Alt.CoreImpl.CreateMValueDouble(out mValue, value); return; case float value: - Alt.Core.CreateMValueDouble(out mValue, value); + Alt.CoreImpl.CreateMValueDouble(out mValue, value); return; case string value: - Alt.Core.CreateMValueString(out mValue, value); + Alt.CoreImpl.CreateMValueString(out mValue, value); return; case MValueConst value: mValue = value; return; case MValueConst[] value: - Alt.Core.CreateMValueList(out mValue, value, (ulong) value.Length); + Alt.CoreImpl.CreateMValueList(out mValue, value, (ulong) value.Length); return; case Invoker value: - Alt.Core.CreateMValueFunction(out mValue, value.NativePointer); + Alt.CoreImpl.CreateMValueFunction(out mValue, value.NativePointer); return; case MValueFunctionCallback value: - Alt.Core.CreateMValueFunction(out mValue, Alt.Core.Resource.CSharpResourceImpl.CreateInvoker(value)); + Alt.CoreImpl.CreateMValueFunction(out mValue, Alt.CoreImpl.Resource.CSharpResourceImpl.CreateInvoker(value)); return; case Function function: - Alt.Core.CreateMValueFunction(out mValue, - Alt.Core.Resource.CSharpResourceImpl.CreateInvoker(function.Call)); + Alt.CoreImpl.CreateMValueFunction(out mValue, + Alt.CoreImpl.Resource.CSharpResourceImpl.CreateInvoker(function.Call)); return; case byte[] byteArray: - Alt.Core.CreateMValueByteArray(out mValue, byteArray); + Alt.CoreImpl.CreateMValueByteArray(out mValue, byteArray); break; case IDictionary dictionary: dictKeys = new string[dictionary.Count]; @@ -178,7 +178,7 @@ public static void CreateFromObjectLocked(object obj, out MValueConst mValue) dictValues[i++] = elementMValue; } - Alt.Core.CreateMValueDict(out mValue, dictKeys, dictValues, (ulong) dictionary.Count); + Alt.CoreImpl.CreateMValueDict(out mValue, dictKeys, dictValues, (ulong) dictionary.Count); for (int j = 0, dictLength = dictionary.Count; j < dictLength; j++) { dictValues[j].Dispose(); @@ -194,7 +194,7 @@ public static void CreateFromObjectLocked(object obj, out MValueConst mValue) listValues[i++] = elementMValue; } - Alt.Core.CreateMValueList(out mValue, listValues, length); + Alt.CoreImpl.CreateMValueList(out mValue, listValues, length); for (ulong j = 0; j < length; j++) { listValues[j].Dispose(); @@ -216,7 +216,7 @@ public static void CreateFromObjectLocked(object obj, out MValueConst mValue) dictValues[i++] = elementMValue; } - Alt.Core.CreateMValueDict(out mValue, dictKeys, dictValues, (ulong) dictionary.Count); + Alt.CoreImpl.CreateMValueDict(out mValue, dictKeys, dictValues, (ulong) dictionary.Count); for (int j = 0, dictLength = dictValues.Length; j < dictLength; j++) { dictValues[j].Dispose(); @@ -233,22 +233,22 @@ public static void CreateFromObjectLocked(object obj, out MValueConst mValue) writer.ToMValue(out mValue); return; case Position position: - Alt.Core.CreateMValueVector3(out mValue, position); + Alt.CoreImpl.CreateMValueVector3(out mValue, position); return; case Rotation rotation: - Alt.Core.CreateMValueVector3(out mValue, rotation); + Alt.CoreImpl.CreateMValueVector3(out mValue, rotation); return; case Rgba rgba: - Alt.Core.CreateMValueRgba(out mValue, rgba); + Alt.CoreImpl.CreateMValueRgba(out mValue, rgba); return; case short value: - Alt.Core.CreateMValueInt(out mValue, value); + Alt.CoreImpl.CreateMValueInt(out mValue, value); return; case ushort value: - Alt.Core.CreateMValueUInt(out mValue, value); + Alt.CoreImpl.CreateMValueUInt(out mValue, value); return; case Vector3 position: - Alt.Core.CreateMValueVector3(out mValue, position); + Alt.CoreImpl.CreateMValueVector3(out mValue, position); return; default: var type = obj?.GetType(); diff --git a/api/AltV.Net.Async/MValueConst.Locked.cs b/api/AltV.Net.Async/MValueConst.Locked.cs index 3f7ef029..13489ea2 100644 --- a/api/AltV.Net.Async/MValueConst.Locked.cs +++ b/api/AltV.Net.Async/MValueConst.Locked.cs @@ -13,7 +13,7 @@ public static class MValueConstLocked { public static void CreateLocked(ISharedBaseObject baseObject, out MValueConst mValue) { - Alt.Core.CreateMValueBaseObject(out mValue, baseObject); + Alt.CoreImpl.CreateMValueBaseObject(out mValue, baseObject); } public static void CreateFromObjectLocked(object obj, out MValueConst mValue) @@ -36,47 +36,47 @@ public static void CreateFromObjectLocked(object obj, out MValueConst mValue) CreateLocked(baseObject, out mValue); return; case bool value: - Alt.Core.CreateMValueBool(out mValue, value); + Alt.CoreImpl.CreateMValueBool(out mValue, value); return; case int value: - Alt.Core.CreateMValueInt(out mValue, value); + Alt.CoreImpl.CreateMValueInt(out mValue, value); return; case uint value: - Alt.Core.CreateMValueUInt(out mValue, value); + Alt.CoreImpl.CreateMValueUInt(out mValue, value); return; case long value: - Alt.Core.CreateMValueInt(out mValue, value); + Alt.CoreImpl.CreateMValueInt(out mValue, value); return; case ulong value: - Alt.Core.CreateMValueUInt(out mValue, value); + Alt.CoreImpl.CreateMValueUInt(out mValue, value); return; case double value: - Alt.Core.CreateMValueDouble(out mValue, value); + Alt.CoreImpl.CreateMValueDouble(out mValue, value); return; case float value: - Alt.Core.CreateMValueDouble(out mValue, value); + Alt.CoreImpl.CreateMValueDouble(out mValue, value); return; case string value: - Alt.Core.CreateMValueString(out mValue, value); + Alt.CoreImpl.CreateMValueString(out mValue, value); return; case MValueConst value: mValue = value; return; case MValueConst[] value: - Alt.Core.CreateMValueList(out mValue, value, (ulong) value.Length); + Alt.CoreImpl.CreateMValueList(out mValue, value, (ulong) value.Length); return; case Invoker value: - Alt.Core.CreateMValueFunction(out mValue, value.NativePointer); + Alt.CoreImpl.CreateMValueFunction(out mValue, value.NativePointer); return; case MValueFunctionCallback value: - Alt.Core.CreateMValueFunction(out mValue, Alt.Core.Resource.CSharpResourceImpl.CreateInvoker(value)); + Alt.CoreImpl.CreateMValueFunction(out mValue, Alt.CoreImpl.Resource.CSharpResourceImpl.CreateInvoker(value)); return; case Net.Function function: - Alt.Core.CreateMValueFunction(out mValue, - Alt.Core.Resource.CSharpResourceImpl.CreateInvoker(function.Call)); + Alt.CoreImpl.CreateMValueFunction(out mValue, + Alt.CoreImpl.Resource.CSharpResourceImpl.CreateInvoker(function.Call)); return; case byte[] byteArray: - Alt.Core.CreateMValueByteArray(out mValue, byteArray); + Alt.CoreImpl.CreateMValueByteArray(out mValue, byteArray); break; case IDictionary dictionary: dictKeys = new string[dictionary.Count]; @@ -98,11 +98,11 @@ public static void CreateFromObjectLocked(object obj, out MValueConst mValue) i = 0; foreach (var value in dictionary.Values) { - Alt.Core.CreateMValue(out var elementMValue, value); + Alt.CoreImpl.CreateMValue(out var elementMValue, value); dictValues[i++] = elementMValue; } - - Alt.Core.CreateMValueDict(out mValue, dictKeys, dictValues, (ulong) dictionary.Count); + + Alt.CoreImpl.CreateMValueDict(out mValue, dictKeys, dictValues, (ulong) dictionary.Count); for (int j = 0, dictLength = dictionary.Count; j < dictLength; j++) { dictValues[j].Dispose(); @@ -114,11 +114,11 @@ public static void CreateFromObjectLocked(object obj, out MValueConst mValue) i = 0; foreach (var value in collection) { - Alt.Core.CreateMValue(out var elementMValue, value); + Alt.CoreImpl.CreateMValue(out var elementMValue, value); listValues[i++] = elementMValue; } - - Alt.Core.CreateMValueList(out mValue, listValues, length); + + Alt.CoreImpl.CreateMValueList(out mValue, listValues, length); for (ulong j = 0; j < length; j++) { listValues[j].Dispose(); @@ -136,55 +136,55 @@ public static void CreateFromObjectLocked(object obj, out MValueConst mValue) i = 0; foreach (var value in dictionary.Values) { - Alt.Core.CreateMValue(out var elementMValue, value); + Alt.CoreImpl.CreateMValue(out var elementMValue, value); dictValues[i++] = elementMValue; } - - Alt.Core.CreateMValueDict(out mValue, dictKeys, dictValues, (ulong) dictionary.Count); + + Alt.CoreImpl.CreateMValueDict(out mValue, dictKeys, dictValues, (ulong) dictionary.Count); for (int j = 0, dictLength = dictValues.Length; j < dictLength; j++) { dictValues[j].Dispose(); } return; case IWritable writable: - writer = new MValueWriter2(Alt.Core); + writer = Alt.CreateMValueWriter(); writable.OnWrite(writer); writer.ToMValue(out mValue); return; case IMValueConvertible convertible: - writer = new MValueWriter2(Alt.Core); + writer = Alt.CreateMValueWriter(); convertible.GetAdapter().ToMValue(obj, writer); writer.ToMValue(out mValue); return; case Position position: - Alt.Core.CreateMValueVector3(out mValue, position); + Alt.CoreImpl.CreateMValueVector3(out mValue, position); return; case Rotation rotation: - Alt.Core.CreateMValueVector3(out mValue, rotation); + Alt.CoreImpl.CreateMValueVector3(out mValue, rotation); return; case Rgba rgba: - Alt.Core.CreateMValueRgba(out mValue, rgba); + Alt.CoreImpl.CreateMValueRgba(out mValue, rgba); return; case short value: - Alt.Core.CreateMValueInt(out mValue, value); + Alt.CoreImpl.CreateMValueInt(out mValue, value); return; case ushort value: - Alt.Core.CreateMValueUInt(out mValue, value); + Alt.CoreImpl.CreateMValueUInt(out mValue, value); return; case Vector3 position: - Alt.Core.CreateMValueVector3(out mValue, position); + Alt.CoreImpl.CreateMValueVector3(out mValue, position); return; case Vector2 value: - Alt.Core.CreateMValueVector2(out mValue, value); + Alt.CoreImpl.CreateMValueVector2(out mValue, value); return; default: var type = obj?.GetType(); - if (type != null && Alt.Core.IsMValueConvertible(obj.GetType())) + if (type != null && Alt.CoreImpl.IsMValueConvertible(obj.GetType())) { Alt.ToMValue(obj, type, out mValue); return; } - + Alt.Log("can't convert type:" + type); mValue = MValueConst.Nil; return; diff --git a/api/AltV.Net.Client.Async/AltAsync.cs b/api/AltV.Net.Client.Async/AltAsync.cs index 5f754f65..51152fab 100644 --- a/api/AltV.Net.Client.Async/AltAsync.cs +++ b/api/AltV.Net.Client.Async/AltAsync.cs @@ -58,27 +58,27 @@ internal static void Setup(AltVAsync altVAsync) AltVAsync = altVAsync; } - // internal static void Setup(AsyncCore core) - // { - // Core = core; - // } + //internal static void Setup(Core core) + //{ + // CoreImpl = core; + //} public static Task Do(Action action) { CheckIfAsyncResource(); return AltVAsync.Schedule(action); } - + public static Task Do(Task task) { throw new ArgumentException("AltAsync.Do should never have async code inside"); } - + public static Task Do(Func task) { throw new ArgumentException("AltAsync.Do should never have async code inside"); } - + public static void RunOnMainThreadBlocking(Action action, SemaphoreSlim semaphoreSlim) { CheckIfAsyncResource(); @@ -125,27 +125,27 @@ public class MainThreadContext : IAsyncDisposable { public async ValueTask DisposeAsync() { - if (!Alt.Core.IsMainThread()) throw new Exception("ReturnToMainThread using block was exited on a non-main thread"); + if (!Alt.CoreImpl.IsMainThread()) throw new Exception("ReturnToMainThread using block was exited on a non-main thread"); await Task.Run(() => {}); // jump to bg thread } private MainThreadContext() { } - + internal static readonly MainThreadContext Instance = new(); } public static async Task ReturnToMainThread() { - if (Alt.Core.IsMainThread()) return MainThreadContext.Instance; + if (Alt.CoreImpl.IsMainThread()) return MainThreadContext.Instance; var source = new TaskCompletionSource(); RunOnMainThread(() => source.SetResult()); await source.Task; return MainThreadContext.Instance; } - - + + public static async Task WaitFor(Func fn, uint timeout = 2000, uint interval = 0) { var checkUntil = DateTime.Now.AddMilliseconds(timeout); @@ -164,7 +164,7 @@ public static async Task WaitFor(Func fn, uint timeout = 2000, uint interv source.SetException(new TimeoutException("Failed to wait for callback")); Alt.ClearInterval(handle); }, interval); - + await source.Task; } } diff --git a/api/AltV.Net.Client.Async/AsyncResource.cs b/api/AltV.Net.Client.Async/AsyncResource.cs index e593eb24..89446e2f 100644 --- a/api/AltV.Net.Client.Async/AsyncResource.cs +++ b/api/AltV.Net.Client.Async/AsyncResource.cs @@ -1,5 +1,7 @@ using System.Runtime.Loader; using AltV.Net.CApi; +using AltV.Net.Client.Elements.Interfaces; +using AltV.Net.Client.Elements.Pools; namespace AltV.Net.Client.Async { @@ -60,17 +62,5 @@ public override void OnTick() // return new AsyncColShapePool(colShapeFactory); // } // - // public override Core GetCore(IntPtr nativePointer, IntPtr resourcePointer, AssemblyLoadContext assemblyLoadContext, ILibrary library, IBaseBaseObjectPool baseBaseObjectPool, - // IBaseEntityPool baseEntityPool, - // IEntityPool playerPool, - // IEntityPool vehiclePool, - // IBaseObjectPool blipPool, - // IBaseObjectPool checkpointPool, - // IBaseObjectPool voiceChannelPool, - // IBaseObjectPool colShapePool, - // INativeResourcePool nativeResourcePool) - // { - // return new AsyncCore(nativePointer, resourcePointer, assemblyLoadContext, library, baseBaseObjectPool, baseEntityPool, playerPool, vehiclePool, blipPool, checkpointPool, voiceChannelPool, colShapePool, nativeResourcePool); - // } } } \ No newline at end of file diff --git a/api/AltV.Net.Client/Alt.Create.cs b/api/AltV.Net.Client/Alt.Create.cs index 17816ea0..a249a7a9 100644 --- a/api/AltV.Net.Client/Alt.Create.cs +++ b/api/AltV.Net.Client/Alt.Create.cs @@ -10,56 +10,56 @@ namespace AltV.Net.Client { public partial class Alt { - public static IBlip CreatePointBlip(Position position) => Core.CreatePointBlip(position); - public static IBlip CreateRadiusBlip(Position position, float radius) => Core.CreateRadiusBlip(position, radius); - public static IBlip CreateAreaBlip(Position position, int width, int height) => Core.CreateAreaBlip(position, width, height); - public static IWebView CreateWebView(string url, bool isOverlay = false, Vector2? pos = null, Vector2? size = null) => Core.CreateWebView(url, isOverlay, pos, size); - public static IWebView CreateWebView(string url, uint propHash, string targetTexture) => Core.CreateWebView(url, propHash, targetTexture); - public static IRmlDocument CreateRmlDocument(string url) => Core.CreateRmlDocument(url); - public static IAudio CreateAudio(string source, float volume, bool isRadio = false, bool clearCache = true, string basePath = "") => Core.CreateAudio(source, volume, isRadio, clearCache, basePath); - public static IAudioFilter CreateAudioFilter(uint hash) => Core.CreateAudioFilter(hash); - public static IAudioOutputFrontend CreateAudioOutputFrontend(uint categoryHash) => Core.CreateAudioOutputFrontend(categoryHash); - public static IAudioOutputWorld CreateAudioOutputWorld(uint categoryHash, Position pos) => Core.CreateAudioOutputWorld(categoryHash, pos); - public static IAudioOutputAttached CreateAudioOutputAttached(uint categoryHash, IWorldObject worldObject) => Core.CreateAudioOutputAttached(categoryHash, worldObject); - public static ILocalObject CreateLocalObject(uint modelHash, Position position, Rotation rotation, bool noOffset = false, bool dynamic = false, bool useStreaming = false, uint streamingDistance = 0) => Core.CreateLocalObject(modelHash, position, rotation, noOffset, dynamic, useStreaming, streamingDistance); - public static IHttpClient CreateHttpClient() => Core.CreateHttpClient(); - public static IWebSocketClient CreateWebSocketClient(string url) => Core.CreateWebSocketClient(url); + public static IBlip CreatePointBlip(Position position) => CoreImpl.CreatePointBlip(position); + public static IBlip CreateRadiusBlip(Position position, float radius) => CoreImpl.CreateRadiusBlip(position, radius); + public static IBlip CreateAreaBlip(Position position, int width, int height) => CoreImpl.CreateAreaBlip(position, width, height); + public static IWebView CreateWebView(string url, bool isOverlay = false, Vector2? pos = null, Vector2? size = null) => CoreImpl.CreateWebView(url, isOverlay, pos, size); + public static IWebView CreateWebView(string url, uint propHash, string targetTexture) => CoreImpl.CreateWebView(url, propHash, targetTexture); + public static IRmlDocument CreateRmlDocument(string url) => CoreImpl.CreateRmlDocument(url); + public static IAudio CreateAudio(string source, float volume, bool isRadio = false, bool clearCache = true, string basePath = "") => CoreImpl.CreateAudio(source, volume, isRadio, clearCache, basePath); + public static IAudioFilter CreateAudioFilter(uint hash) => CoreImpl.CreateAudioFilter(hash); + public static IAudioOutputFrontend CreateAudioOutputFrontend(uint categoryHash) => CoreImpl.CreateAudioOutputFrontend(categoryHash); + public static IAudioOutputWorld CreateAudioOutputWorld(uint categoryHash, Position pos) => CoreImpl.CreateAudioOutputWorld(categoryHash, pos); + public static IAudioOutputAttached CreateAudioOutputAttached(uint categoryHash, IWorldObject worldObject) => CoreImpl.CreateAudioOutputAttached(categoryHash, worldObject); + public static ILocalObject CreateLocalObject(uint modelHash, Position position, Rotation rotation, bool noOffset = false, bool dynamic = false, bool useStreaming = false, uint streamingDistance = 0) => CoreImpl.CreateLocalObject(modelHash, position, rotation, noOffset, dynamic, useStreaming, streamingDistance); + public static IHttpClient CreateHttpClient() => CoreImpl.CreateHttpClient(); + public static IWebSocketClient CreateWebSocketClient(string url) => CoreImpl.CreateWebSocketClient(url); public static ICheckpoint CreateCheckpoint(CheckpointType type, Vector3 pos, Vector3 nextPos, float radius, - float height, Rgba color, Rgba iconColor, uint streamingDistance) => Core.CreateCheckpoint(type, pos, nextPos, radius, height, color, iconColor, streamingDistance); + float height, Rgba color, Rgba iconColor, uint streamingDistance) => CoreImpl.CreateCheckpoint(type, pos, nextPos, radius, height, color, iconColor, streamingDistance); - public static IVirtualEntityGroup CreateVirtualEntityGroup(uint streamingDistance) => Core.CreateVirtualEntityGroup(streamingDistance); + public static IVirtualEntityGroup CreateVirtualEntityGroup(uint streamingDistance) => CoreImpl.CreateVirtualEntityGroup(streamingDistance); public static IVirtualEntity CreateVirtualEntity(IVirtualEntityGroup group, Position position, - uint streamingDistance, Dictionary dataDict) => Core.CreateVirtualEntity(group, position, streamingDistance, dataDict); + uint streamingDistance, Dictionary dataDict) => CoreImpl.CreateVirtualEntity(group, position, streamingDistance, dataDict); public static ILocalPed CreateLocalPed(uint modelHash, int dimension, Position position, Rotation rotation, bool useStreaming, uint streamingDistance) => - Core.CreateLocalPed(modelHash, dimension, position, rotation, useStreaming, streamingDistance); + CoreImpl.CreateLocalPed(modelHash, dimension, position, rotation, useStreaming, streamingDistance); public static ILocalPed CreateLocalPed(PedModel modelHash, int dimension, Position position, Rotation rotation, bool useStreaming, uint streamingDistance) => - Core.CreateLocalPed((uint)modelHash, dimension, position, rotation, useStreaming, streamingDistance); + CoreImpl.CreateLocalPed((uint)modelHash, dimension, position, rotation, useStreaming, streamingDistance); public static ILocalVehicle CreateLocalVehicle(uint modelHash, int dimension, Position position, Rotation rotation, bool useStreaming, uint streamingDistance) => - Core.CreateLocalVehicle(modelHash, dimension, position, rotation, useStreaming, streamingDistance); + CoreImpl.CreateLocalVehicle(modelHash, dimension, position, rotation, useStreaming, streamingDistance); public static ILocalVehicle CreateLocalVehicle(VehicleModel modelHash, int dimension, Position position, Rotation rotation, bool useStreaming, uint streamingDistance) => - Core.CreateLocalVehicle((uint)modelHash, dimension, position, rotation, useStreaming, streamingDistance); + CoreImpl.CreateLocalVehicle((uint)modelHash, dimension, position, rotation, useStreaming, streamingDistance); public static IMarker CreateMarker(MarkerType type, Position pos, Rgba color, bool useStreaming, - uint streamingDistance) => Core.CreateMarker(type, pos, color, useStreaming, streamingDistance); + uint streamingDistance) => CoreImpl.CreateMarker(type, pos, color, useStreaming, streamingDistance); public static ITextLabel CreateTextLabel(string name, string fontName, float fontSize, float scale, Position pos, Rotation rot, Rgba color, float outlineWidth, Rgba outlineColor, bool useStreaming, - uint streamingDistance) => Core.CreateTextLabel(name, fontName, fontSize, scale, pos, + uint streamingDistance) => CoreImpl.CreateTextLabel(name, fontName, fontSize, scale, pos, rot, color, outlineWidth, outlineColor, useStreaming, streamingDistance); - public static IColShape CreateColShapeCircle(Position position, float radius) => Core.CreateColShapeCircle(position, radius); - public static IColShape CreateColShapeCube(Position pos1, Position pos2) => Core.CreateColShapeCube(pos1, pos2); - public static IColShape CreateColShapeCylinder(Position position, float radius, float height) => Core.CreateColShapeCylinder(position, radius, height); - public static IColShape CreateColShapePolygon(float minZ, float maxZ, Vector2[] points) => Core.CreateColShapePolygon(minZ, maxZ, points); - public static IColShape CreateColShapeRectangle(float x1, float y1, float x2, float y2, float z) => Core.CreateColShapeRectangle(x1, y1, x2, y2, z); - public static IColShape CreateColShapeSphere(Vector3 position, float radius) => Core.CreateColShapeSphere(position, radius); + public static IColShape CreateColShapeCircle(Position position, float radius) => CoreImpl.CreateColShapeCircle(position, radius); + public static IColShape CreateColShapeCube(Position pos1, Position pos2) => CoreImpl.CreateColShapeCube(pos1, pos2); + public static IColShape CreateColShapeCylinder(Position position, float radius, float height) => CoreImpl.CreateColShapeCylinder(position, radius, height); + public static IColShape CreateColShapePolygon(float minZ, float maxZ, Vector2[] points) => CoreImpl.CreateColShapePolygon(minZ, maxZ, points); + public static IColShape CreateColShapeRectangle(float x1, float y1, float x2, float y2, float z) => CoreImpl.CreateColShapeRectangle(x1, y1, x2, y2, z); + public static IColShape CreateColShapeSphere(Vector3 position, float radius) => CoreImpl.CreateColShapeSphere(position, radius); } } \ No newline at end of file diff --git a/api/AltV.Net.Client/Alt.Events.cs b/api/AltV.Net.Client/Alt.Events.cs index d0f4417b..299425df 100644 --- a/api/AltV.Net.Client/Alt.Events.cs +++ b/api/AltV.Net.Client/Alt.Events.cs @@ -10,484 +10,484 @@ public partial class Alt { public static event TickDelegate OnTick { - add => CoreImpl.TickEventHandler.Add(value); - remove => CoreImpl.TickEventHandler.Remove(value); + add => ((Core)CoreImpl).TickEventHandler.Add(value); + remove => ((Core)CoreImpl).TickEventHandler.Remove(value); } public static event ConsoleCommandDelegate OnConsoleCommand { - add => CoreImpl.ConsoleCommandEventHandler.Add(value); - remove => CoreImpl.ConsoleCommandEventHandler.Remove(value); + add => ((Core)CoreImpl).ConsoleCommandEventHandler.Add(value); + remove => ((Core)CoreImpl).ConsoleCommandEventHandler.Remove(value); } public static event PlayerSpawnDelegate OnPlayerSpawn { - add => CoreImpl.SpawnEventHandler.Add(value); - remove => CoreImpl.SpawnEventHandler.Remove(value); + add => ((Core)CoreImpl).SpawnEventHandler.Add(value); + remove => ((Core)CoreImpl).SpawnEventHandler.Remove(value); } public static event PlayerDisconnectDelegate OnPlayerDisconnect { - add => CoreImpl.DisconnectEventHandler.Add(value); - remove => CoreImpl.DisconnectEventHandler.Remove(value); + add => ((Core)CoreImpl).DisconnectEventHandler.Add(value); + remove => ((Core)CoreImpl).DisconnectEventHandler.Remove(value); } public static event PlayerEnterVehicleDelegate OnPlayerEnterVehicle { - add => CoreImpl.EnterVehicleEventHandler.Add(value); - remove => CoreImpl.EnterVehicleEventHandler.Remove(value); + add => ((Core)CoreImpl).EnterVehicleEventHandler.Add(value); + remove => ((Core)CoreImpl).EnterVehicleEventHandler.Remove(value); } public static event GameEntityCreateDelegate OnGameEntityCreate { - add => CoreImpl.GameEntityCreateEventHandler.Add(value); - remove => CoreImpl.GameEntityCreateEventHandler.Remove(value); + add => ((Core)CoreImpl).GameEntityCreateEventHandler.Add(value); + remove => ((Core)CoreImpl).GameEntityCreateEventHandler.Remove(value); } public static event GameEntityDestroyDelegate OnGameEntityDestroy { - add => CoreImpl.GameEntityDestroyEventHandler.Add(value); - remove => CoreImpl.GameEntityDestroyEventHandler.Remove(value); + add => ((Core)CoreImpl).GameEntityDestroyEventHandler.Add(value); + remove => ((Core)CoreImpl).GameEntityDestroyEventHandler.Remove(value); } public static event AnyResourceErrorDelegate OnAnyResourceError { - add => CoreImpl.AnyResourceErrorEventHandler.Add(value); - remove => CoreImpl.AnyResourceErrorEventHandler.Remove(value); + add => ((Core)CoreImpl).AnyResourceErrorEventHandler.Add(value); + remove => ((Core)CoreImpl).AnyResourceErrorEventHandler.Remove(value); } public static event AnyResourceStartDelegate OnAnyResourceStart { - add => CoreImpl.AnyResourceStartEventHandler.Add(value); - remove => CoreImpl.AnyResourceStartEventHandler.Remove(value); + add => ((Core)CoreImpl).AnyResourceStartEventHandler.Add(value); + remove => ((Core)CoreImpl).AnyResourceStartEventHandler.Remove(value); } public static event AnyResourceStopDelegate OnAnyResourceStop { - add => CoreImpl.AnyResourceStopEventHandler.Add(value); - remove => CoreImpl.AnyResourceStopEventHandler.Remove(value); + add => ((Core)CoreImpl).AnyResourceStopEventHandler.Add(value); + remove => ((Core)CoreImpl).AnyResourceStopEventHandler.Remove(value); } public static event KeyUpDelegate OnKeyUp { - add => CoreImpl.KeyUpEventHandler.Add(value); - remove => CoreImpl.KeyUpEventHandler.Remove(value); + add => ((Core)CoreImpl).KeyUpEventHandler.Add(value); + remove => ((Core)CoreImpl).KeyUpEventHandler.Remove(value); } public static event KeyDownDelegate OnKeyDown { - add => CoreImpl.KeyDownEventHandler.Add(value); - remove => CoreImpl.KeyDownEventHandler.Remove(value); + add => ((Core)CoreImpl).KeyDownEventHandler.Add(value); + remove => ((Core)CoreImpl).KeyDownEventHandler.Remove(value); } public static event ConnectionCompleteDelegate OnConnectionComplete { - add => CoreImpl.ConnectionCompleteEventHandler.Add(value); - remove => CoreImpl.ConnectionCompleteEventHandler.Remove(value); + add => ((Core)CoreImpl).ConnectionCompleteEventHandler.Add(value); + remove => ((Core)CoreImpl).ConnectionCompleteEventHandler.Remove(value); } public static event PlayerChangeVehicleSeatDelegate OnPlayerChangeVehicleSeat { - add => CoreImpl.PlayerChangeVehicleSeatEventHandler.Add(value); - remove => CoreImpl.PlayerChangeVehicleSeatEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerChangeVehicleSeatEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerChangeVehicleSeatEventHandler.Remove(value); } public static event PlayerLeaveVehicleDelegate OnPlayerLeaveVehicle { - add => CoreImpl.PlayerLeaveVehicleEventHandler.Add(value); - remove => CoreImpl.PlayerLeaveVehicleEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerLeaveVehicleEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerLeaveVehicleEventHandler.Remove(value); } public static event PlayerWeaponShootDelegate OnPlayerWeaponShoot { - add => CoreImpl.PlayerWeaponShootEventHandler.Add(value); - remove => CoreImpl.PlayerWeaponShootEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerWeaponShootEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerWeaponShootEventHandler.Remove(value); } public static event PlayerWeaponChangeDelegate OnPlayerWeaponChange { - add => CoreImpl.PlayerWeaponChangeEventHandler.Add(value); - remove => CoreImpl.PlayerWeaponChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerWeaponChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerWeaponChangeEventHandler.Remove(value); } public static event GlobalMetaChangeDelegate OnGlobalMetaChange { - add => CoreImpl.GlobalMetaChangeEventHandler.Add(value); - remove => CoreImpl.GlobalMetaChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).GlobalMetaChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).GlobalMetaChangeEventHandler.Remove(value); } public static event GlobalSyncedMetaChangeDelegate OnGlobalSyncedMetaChange { - add => CoreImpl.GlobalSyncedMetaChangeEventHandler.Add(value); - remove => CoreImpl.GlobalSyncedMetaChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).GlobalSyncedMetaChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).GlobalSyncedMetaChangeEventHandler.Remove(value); } public static event LocalMetaChangeDelegate OnLocalMetaChange { - add => CoreImpl.LocalMetaChangeEventHandler.Add(value); - remove => CoreImpl.LocalMetaChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).LocalMetaChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).LocalMetaChangeEventHandler.Remove(value); } public static event StreamSyncedMetaChangeDelegate OnStreamSyncedMetaChange { - add => CoreImpl.StreamSyncedMetaChangeEventHandler.Add(value); - remove => CoreImpl.StreamSyncedMetaChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).StreamSyncedMetaChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).StreamSyncedMetaChangeEventHandler.Remove(value); } public static event SyncedMetaChangeDelegate OnSyncedMetaChange { - add => CoreImpl.SyncedMetaChangeEventHandler.Add(value); - remove => CoreImpl.SyncedMetaChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).SyncedMetaChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).SyncedMetaChangeEventHandler.Remove(value); } public static event TaskChangeDelegate OnTaskChange { - add => CoreImpl.TaskChangeEventHandler.Add(value); - remove => CoreImpl.TaskChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).TaskChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).TaskChangeEventHandler.Remove(value); } public static event WindowResolutionChangeDelegate OnWindowResolutionChange { - add => CoreImpl.WindowResolutionChangeEventHandler.Add(value); - remove => CoreImpl.WindowResolutionChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).WindowResolutionChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).WindowResolutionChangeEventHandler.Remove(value); } public static event WindowFocusChangeDelegate OnWindowFocusChange { - add => CoreImpl.WindowFocusChangeEventHandler.Add(value); - remove => CoreImpl.WindowFocusChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).WindowFocusChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).WindowFocusChangeEventHandler.Remove(value); } public static event RemoveEntityDelegate OnRemoveEntity { - add => CoreImpl.RemoveEntityEventHandler.Add(value); - remove => CoreImpl.RemoveEntityEventHandler.Remove(value); + add => ((Core)CoreImpl).RemoveEntityEventHandler.Add(value); + remove => ((Core)CoreImpl).RemoveEntityEventHandler.Remove(value); } public static event NetOwnerChangeDelegate OnNetOwnerChange { - add => CoreImpl.NetOwnerChangeEventHandler.Add(value); - remove => CoreImpl.NetOwnerChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).NetOwnerChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).NetOwnerChangeEventHandler.Remove(value); } public static event PlayerChangeAnimationDelegate OnPLayerChangeAnimation { - add => CoreImpl.PlayerChangeAnimationEventHandler.Add(value); - remove => CoreImpl.PlayerChangeAnimationEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerChangeAnimationEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerChangeAnimationEventHandler.Remove(value); } public static event PlayerChangeInteriorDelegate OnPlayerChangeInterior { - add => CoreImpl.PlayerChangeInteriorEventHandler.Add(value); - remove => CoreImpl.PlayerChangeInteriorEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerChangeInteriorEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerChangeInteriorEventHandler.Remove(value); } public static event WeaponDamageDelegate OnWeaponDamage { - add => CoreImpl.WeaponDamageEventHandler.Add(value); - remove => CoreImpl.WeaponDamageEventHandler.Remove(value); + add => ((Core)CoreImpl).WeaponDamageEventHandler.Add(value); + remove => ((Core)CoreImpl).WeaponDamageEventHandler.Remove(value); } public static event WorldObjectPositionChangeDelegate OnWorldObjectPositionChange { - add => CoreImpl.WorldObjectPositionChangeEventHandler.Add(value); - remove => CoreImpl.WorldObjectPositionChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).WorldObjectPositionChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).WorldObjectPositionChangeEventHandler.Remove(value); } public static event WorldObjectStreamInDelegate OnWorldObjectStreamIn { - add => CoreImpl.WorldObjectStreamInEventHandler.Add(value); - remove => CoreImpl.WorldObjectStreamInEventHandler.Remove(value); + add => ((Core)CoreImpl).WorldObjectStreamInEventHandler.Add(value); + remove => ((Core)CoreImpl).WorldObjectStreamInEventHandler.Remove(value); } public static event WorldObjectStreamOutDelegate OnWorldObjectStreamOut { - add => CoreImpl.WorldObjectStreamOutEventHandler.Add(value); - remove => CoreImpl.WorldObjectStreamOutEventHandler.Remove(value); + add => ((Core)CoreImpl).WorldObjectStreamOutEventHandler.Add(value); + remove => ((Core)CoreImpl).WorldObjectStreamOutEventHandler.Remove(value); } public static event ColShapeDelegate OnColShape { - add => CoreImpl.ColShapeEventHandler.Add(value); - remove => CoreImpl.ColShapeEventHandler.Remove(value); + add => ((Core)CoreImpl).ColShapeEventHandler.Add(value); + remove => ((Core)CoreImpl).ColShapeEventHandler.Remove(value); } public static event CheckpointDelegate OnCheckpoint { - add => CoreImpl.CheckpointEventHandler.Add(value); - remove => CoreImpl.CheckpointEventHandler.Remove(value); + add => ((Core)CoreImpl).CheckpointEventHandler.Add(value); + remove => ((Core)CoreImpl).CheckpointEventHandler.Remove(value); } public static event MetaChangeDelegate OnMetaChange { - add => CoreImpl.MetaChangeEventHandler.Add(value); - remove => CoreImpl.MetaChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).MetaChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).MetaChangeEventHandler.Remove(value); } public static event PlayerStartEnterVehicleDelegate OnPlayerStartEnterVehicle { - add => CoreImpl.PlayerStartEnterVehicleEventHandler.Add(value); - remove => CoreImpl.PlayerStartEnterVehicleEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerStartEnterVehicleEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerStartEnterVehicleEventHandler.Remove(value); } public static event PlayerStartLeaveVehicleDelegate OnPlayerStartLeaveVehicle { - add => CoreImpl.PlayerStartLeaveVehicleEventHandler.Add(value); - remove => CoreImpl.PlayerStartLeaveVehicleEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerStartLeaveVehicleEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerStartLeaveVehicleEventHandler.Remove(value); } public static event EntityHitEntityDelegate OnEntityHitEntity { - add => CoreImpl.EntityHitEntityEventHandler.Add(value); - remove => CoreImpl.EntityHitEntityEventHandler.Remove(value); + add => ((Core)CoreImpl).EntityHitEntityEventHandler.Add(value); + remove => ((Core)CoreImpl).EntityHitEntityEventHandler.Remove(value); } public static event PlayerBulletHitDelegate OnPlayerBulletHit { - add => CoreImpl.PlayerBulletHitEventHandler.Add(value); - remove => CoreImpl.PlayerBulletHitEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerBulletHitEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerBulletHitEventHandler.Remove(value); } public static event VoiceConnectionDelegate OnVoiceConnection { - add => CoreImpl.VoiceConnectionEventHandler.Add(value); - remove => CoreImpl.VoiceConnectionEventHandler.Remove(value); + add => ((Core)CoreImpl).VoiceConnectionEventHandler.Add(value); + remove => ((Core)CoreImpl).VoiceConnectionEventHandler.Remove(value); } public static event ScriptRPCAnswerDelegate OnScriptRPCAnswer { - add => CoreImpl.ScriptRPCAnswerHandler.Add(value); - remove => CoreImpl.ScriptRPCAnswerHandler.Remove(value); + add => ((Core)CoreImpl).ScriptRPCAnswerHandler.Add(value); + remove => ((Core)CoreImpl).ScriptRPCAnswerHandler.Remove(value); } public static event ScriptRPCDelegate OnScriptRPC { - add => CoreImpl.ScriptRPCHandler.Add(value); - remove => CoreImpl.ScriptRPCHandler.Remove(value); - } - - public static Function OnServer(string eventName, Function function) => CoreImpl.AddServerEventListener(eventName, function); - - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Action function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static Function OnServer(string eventName, Func function) => CoreImpl.AddServerEventListener(eventName, Function.Create(Core, function)); - public static bool OffServer(string eventName, Function function) => CoreImpl.RemoveServerEventListener(eventName, function); - - public static Function OnClient(string eventName, Function function) => CoreImpl.AddClientEventListener(eventName, function); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Action function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static Function OnClient(string eventName, Func function) => CoreImpl.AddClientEventListener(eventName, Function.Create(Core, function)); - public static bool OffClient(string eventName, Function function) => CoreImpl.RemoveClientEventListener(eventName, function); + add => ((Core)CoreImpl).ScriptRPCHandler.Add(value); + remove => ((Core)CoreImpl).ScriptRPCHandler.Remove(value); + } + + public static Function OnServer(string eventName, Function function) => ((Core)CoreImpl).AddServerEventListener(eventName, function); + + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Action function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnServer(string eventName, Func function) => ((Core)CoreImpl).AddServerEventListener(eventName, Function.Create(CoreImpl, function)); + public static bool OffServer(string eventName, Function function) => ((Core)CoreImpl).RemoveServerEventListener(eventName, function); + + public static Function OnClient(string eventName, Function function) => ((Core)CoreImpl).AddClientEventListener(eventName, function); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Action function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static Function OnClient(string eventName, Func function) => ((Core)CoreImpl).AddClientEventListener(eventName, Function.Create(CoreImpl, function)); + public static bool OffClient(string eventName, Function function) => ((Core)CoreImpl).RemoveClientEventListener(eventName, function); #region WebView - public static Function On(this IWebView webView, string eventName, Function function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, function); + public static Function On(this IWebView webView, string eventName, Function function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, function); public static Function On(this IWebView webView, string eventName, Action function) => - CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebView webView, string eventName, Action function) => - CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebView webView, string eventName, Action function) => - CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Action function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Action function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebView webView, string eventName, Func function) => - CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebView webView, string eventName, Func function) => - CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebView webView, string eventName, Func function) => CoreImpl.AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(Core, function)); - public static bool Off(this IWebView webView, string eventName, Function function) => CoreImpl.RemoveWebViewEventListener(webView.WebViewNativePointer, eventName, function); + ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebView webView, string eventName, Func function) => ((Core)CoreImpl).AddWebViewEventListener(webView.WebViewNativePointer, eventName, Function.Create(CoreImpl, function)); + public static bool Off(this IWebView webView, string eventName, Function function) => ((Core)CoreImpl).RemoveWebViewEventListener(webView.WebViewNativePointer, eventName, function); #endregion #region RmlElement - public static Function OnRmlEvent(this IRmlElement rmlElement, string eventName, Action> function) => CoreImpl.AddRmlElementEventListener(rmlElement.RmlElementNativePointer, eventName, Function.Create(Core, function)); - public static bool OffRmlEvent(this IRmlElement rmlElement, string eventName, Function function) => CoreImpl.RemoveRmlElementEventListener(rmlElement.RmlElementNativePointer, eventName, function); + public static Function OnRmlEvent(this IRmlElement rmlElement, string eventName, Action> function) => ((Core)CoreImpl).AddRmlElementEventListener(rmlElement.RmlElementNativePointer, eventName, Function.Create(CoreImpl, function)); + public static bool OffRmlEvent(this IRmlElement rmlElement, string eventName, Function function) => ((Core)CoreImpl).RemoveRmlElementEventListener(rmlElement.RmlElementNativePointer, eventName, function); #endregion #region Websocket - public static Function On(this IWebSocketClient webSocketClient, string eventName, Function function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, function); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Function function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, function); public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Action function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => - CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => CoreImpl.AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(Core, function)); - public static bool Off(this IWebSocketClient webSocketClient, string eventName, Function function) => CoreImpl.RemoveWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, function); + ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IWebSocketClient webSocketClient, string eventName, Func function) => ((Core)CoreImpl).AddWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, Function.Create(CoreImpl, function)); + public static bool Off(this IWebSocketClient webSocketClient, string eventName, Function function) => ((Core)CoreImpl).RemoveWebSocketEventListener(webSocketClient.WebSocketClientNativePointer, eventName, function); #endregion #region Audio - public static Function On(this IAudio audio, string eventName, Function function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, function); + public static Function On(this IAudio audio, string eventName, Function function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, function); public static Function On(this IAudio audio, string eventName, Action function) => - CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IAudio audio, string eventName, Action function) => - CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IAudio audio, string eventName, Action function) => - CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Action function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Action function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IAudio audio, string eventName, Func function) => - CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); + ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); public static Function On(this IAudio audio, string eventName, Func function) => - CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static Function On(this IAudio audio, string eventName, Func function) => CoreImpl.AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(Core, function)); - public static bool Off(this IAudio audio, string eventName, Function function) => CoreImpl.RemoveAudioEventListener(audio.AudioNativePointer, eventName, function); + ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static Function On(this IAudio audio, string eventName, Func function) => ((Core)CoreImpl).AddAudioEventListener(audio.AudioNativePointer, eventName, Function.Create(CoreImpl, function)); + public static bool Off(this IAudio audio, string eventName, Function function) => ((Core)CoreImpl).RemoveAudioEventListener(audio.AudioNativePointer, eventName, function); #endregion } diff --git a/api/AltV.Net.Client/Alt.GlobalMeta.cs b/api/AltV.Net.Client/Alt.GlobalMeta.cs index 3f943eb8..68a9e167 100644 --- a/api/AltV.Net.Client/Alt.GlobalMeta.cs +++ b/api/AltV.Net.Client/Alt.GlobalMeta.cs @@ -5,17 +5,17 @@ namespace AltV.Net.Client { public partial class Alt { - public static void SetMetaData(string key, object value) => Core.SetMetaData(key, value); + public static void SetMetaData(string key, object value) => CoreImpl.SetMetaData(key, value); - public static bool HasMetaData(string key) => Core.HasMetaData(key); + public static bool HasMetaData(string key) => CoreImpl.HasMetaData(key); - public static void DeleteMetaData(string key) => Core.DeleteMetaData(key); + public static void DeleteMetaData(string key) => CoreImpl.DeleteMetaData(key); - public static bool HasLocalMetaData(string key) => Core.HasLocalMetaData(key); + public static bool HasLocalMetaData(string key) => CoreImpl.HasLocalMetaData(key); public static bool GetMetaData(string key, out int result) { - Core.GetMetaData(key, out var mValue); + CoreImpl.GetMetaData(key, out var mValue); using (mValue) { if (mValue.type != MValueConst.Type.Int) @@ -32,7 +32,7 @@ public static bool GetMetaData(string key, out int result) public static bool GetMetaData(string key, out uint result) { - Core.GetMetaData(key, out var mValue); + CoreImpl.GetMetaData(key, out var mValue); using (mValue) { if (mValue.type != MValueConst.Type.Uint) @@ -49,7 +49,7 @@ public static bool GetMetaData(string key, out uint result) public static bool GetMetaData(string key, out float result) { - Core.GetMetaData(key, out var mValue); + CoreImpl.GetMetaData(key, out var mValue); using (mValue) { if (mValue.type != MValueConst.Type.Double) @@ -66,7 +66,7 @@ public static bool GetMetaData(string key, out float result) public static bool GetMetaData(string key, out T result) { - Core.GetMetaData(key, out var mValue); + CoreImpl.GetMetaData(key, out var mValue); using (mValue) { @@ -85,7 +85,7 @@ public static bool GetMetaData(string key, out T result) public static bool GetSyncedMetaData(string key, out T result) { - Core.GetSyncedMetaData(key, out var mValue); + CoreImpl.GetSyncedMetaData(key, out var mValue); using (mValue) { @@ -104,7 +104,7 @@ public static bool GetSyncedMetaData(string key, out T result) public static bool GetLocalMetaData(string key, out T result) { - Core.GetLocalMetaData(key, out var mValue); + CoreImpl.GetLocalMetaData(key, out var mValue); using (mValue) { diff --git a/api/AltV.Net.Client/Alt.Globals.cs b/api/AltV.Net.Client/Alt.Globals.cs index bec53a7f..69e567ac 100644 --- a/api/AltV.Net.Client/Alt.Globals.cs +++ b/api/AltV.Net.Client/Alt.Globals.cs @@ -7,120 +7,120 @@ namespace AltV.Net.Client { public static partial class Alt { - public static Vector3 ScreenToWorld(Vector2 position) => Core.ScreenToWorld(position); - public static Vector3 ScreenToWorld(float x, float y) => Core.ScreenToWorld(new Vector2(x, y)); - public static Vector2 WorldToScreen(Vector3 position) => Core.WorldToScreen(position); - public static Vector2 WorldToScreen(float x, float y, float z) => Core.WorldToScreen(new Vector3(x, y, z)); - public static void ShowCursor(bool state) => Core.ShowCursor(state); - public static bool IsCursorVisible => Core.IsCursorVisible; - public static void AddGxtText(uint key, string value) => Core.AddGxtText(key, value); - public static void AddGxtText(string key, string value) => Core.AddGxtText(Hash(key), value); - public static string GetGxtText(uint key) => Core.GetGxtText(key); - public static string GetGxtText(string key) => Core.GetGxtText(Hash(key)); - public static void RemoveGxtText(uint key) => Core.RemoveGxtText(key); - public static void RemoveGxtText(string key) => Core.RemoveGxtText(Hash(key)); - public static bool BeginScaleformMovieMethodMinimap(string methodName) => Core.BeginScaleformMovieMethodMinimap(methodName); - public static void SetMinimapComponentPosition(string name, char alignX, char alignY, float posX, float posY, float sizeX, float sizeY) => Core.SetMinimapComponentPosition(name, alignX, alignY, posX, posY, sizeX, sizeY); - public static void SetMinimapComponentPosition(string name, char alignX, char alignY, Vector2 pos, Vector2 size) => Core.SetMinimapComponentPosition(name, alignX, alignY, pos.X, pos.Y, size.X, size.Y); - public static void CopyToClipboard(string content) => Core.CopyToClipboard(content); - public static bool GetPermissionState(Permission permission) => Core.GetPermissionState(permission); - public static bool IsTextureExistInArchetype(uint modelHash, string targetTextureName) => Core.IsTextureExistInArchetype(modelHash, targetTextureName); - public static bool IsTextureExistInArchetype(string modelName, string targetTextureName) => Core.IsTextureExistInArchetype(Hash(modelName), targetTextureName); - public static bool IsPointOnScreen(Vector3 position) => Core.IsPointOnScreen(position); - public static bool IsFullScreen() => Core.IsFullScreen; - public static void LoadRmlFont(string path, string name, bool italic = false, bool bold = false) => Core.LoadRmlFont(path, name, italic, bold); - public static void LoadModel(uint modelHash) => Core.LoadModel(modelHash); - public static void LoadModel(string modelName) => Core.LoadModel(Hash(modelName)); - public static void LoadModelAsync(uint modelHash) => Core.LoadModelAsync(modelHash); - public static void LoadModelAsync(string modelName) => Core.LoadModelAsync(Hash(modelName)); - public static bool LoadYtyp(string ytypName) => Core.LoadYtyp(ytypName); - public static bool UnloadYtyp(string ytypName) => Core.UnloadYtyp(ytypName); - public static void RequestIpl(string iplName) => Core.RequestIpl(iplName); - public static void RemoveIpl(string iplName) => Core.RemoveIpl(iplName); - public static bool IsKeyDown(Key key) => Core.IsKeyDown(key); - public static bool IsKeyToggled(Key key) => Core.IsKeyToggled(key); - public static bool DoesConfigFlagExist(string flagName) => Core.DoesConfigFlagExist(flagName); - public static bool GetConfigFlag(string flagName) => Core.GetConfigFlag(flagName); - public static void SetConfigFlag(string flagName, bool value) => Core.SetConfigFlag(flagName, value); - public static Vector2 GetCursorPos(bool normalized) => Core.GetCursorPos(normalized); - public static void SetCursorPos(Vector2 pos, bool normalized) => Core.SetCursorPos(pos, normalized); - public static string GetStatType(string stat) => Core.GetStatType(stat); - public static void ResetStat(string stat) => Core.ResetStat(stat); - public static void GetStat(string stat, out int value) => Core.GetStat(stat, out value); - public static void GetStat(string stat, out long value) => Core.GetStat(stat, out value); - public static void GetStat(string stat, out float value) => Core.GetStat(stat, out value); - public static void GetStat(string stat, out bool value) => Core.GetStat(stat, out value); - public static void GetStat(string stat, out string value) => Core.GetStat(stat, out value); - public static void GetStat(string stat, out byte value) => Core.GetStat(stat, out value); - public static void GetStat(string stat, out ushort value) => Core.GetStat(stat, out value); - public static void GetStat(string stat, out uint value) => Core.GetStat(stat, out value); - public static void GetStat(string stat, out ulong value) => Core.GetStat(stat, out value); - public static void SetStat(string stat, int value) => Core.SetStat(stat, value); - public static void SetStat(string stat, long value) => Core.SetStat(stat, value); - public static void SetStat(string stat, float value) => Core.SetStat(stat, value); - public static void SetStat(string stat, bool value) => Core.SetStat(stat, value); - public static void SetStat(string stat, string value) => Core.SetStat(stat, value); - public static void SetStat(string stat, byte value) => Core.SetStat(stat, value); - public static void SetStat(string stat, ushort value) => Core.SetStat(stat, value); - public static void SetStat(string stat, uint value) => Core.SetStat(stat, value); - public static void SetStat(string stat, ulong value) => Core.SetStat(stat, value); - public static void ClearPedProp(int scriptId, byte component) => Core.ClearPedProp(scriptId, component); - public static void SetPedDlcProp(int scriptId, uint dlc, byte component, byte drawable, byte texture) => Core.SetPedDlcProp(scriptId, dlc, component, drawable, texture); - public static void SetPedDlcClothes(int scriptId, uint dlc, byte component, byte drawable, byte texture, byte palette) => Core.SetPedDlcClothes(scriptId, dlc, component, drawable, texture, palette); - public static void SetRotationVelocity(int scriptId, Rotation velocity) => Core.SetRotationVelocity(scriptId, velocity); - public static void SetWatermarkPosition(WatermarkPosition position) => Core.SetWatermarkPosition(position); - public static string StringToSha256(string value) => Core.StringToSha256(value); - public static void SetWeatherCycle(byte[] weathers, byte[] multipliers) => Core.SetWeatherCycle(weathers, multipliers); - public static void SetWeatherSyncActive(bool state) => Core.SetWeatherSyncActive(state); - public static string GetHeadshotBase64(byte id) => Core.GetHeadshotBase64(id); - public static Task TakeScreenshot() => Core.TakeScreenshot(); - public static Task TakeScreenshotGameOnly() => Core.TakeScreenshotGameOnly(); - public static void RegisterFont(string path) => Core.RegisterFont(path); + public static Vector3 ScreenToWorld(Vector2 position) => CoreImpl.ScreenToWorld(position); + public static Vector3 ScreenToWorld(float x, float y) => CoreImpl.ScreenToWorld(new Vector2(x, y)); + public static Vector2 WorldToScreen(Vector3 position) => CoreImpl.WorldToScreen(position); + public static Vector2 WorldToScreen(float x, float y, float z) => CoreImpl.WorldToScreen(new Vector3(x, y, z)); + public static void ShowCursor(bool state) => CoreImpl.ShowCursor(state); + public static bool IsCursorVisible => CoreImpl.IsCursorVisible; + public static void AddGxtText(uint key, string value) => CoreImpl.AddGxtText(key, value); + public static void AddGxtText(string key, string value) => CoreImpl.AddGxtText(Hash(key), value); + public static string GetGxtText(uint key) => CoreImpl.GetGxtText(key); + public static string GetGxtText(string key) => CoreImpl.GetGxtText(Hash(key)); + public static void RemoveGxtText(uint key) => CoreImpl.RemoveGxtText(key); + public static void RemoveGxtText(string key) => CoreImpl.RemoveGxtText(Hash(key)); + public static bool BeginScaleformMovieMethodMinimap(string methodName) => CoreImpl.BeginScaleformMovieMethodMinimap(methodName); + public static void SetMinimapComponentPosition(string name, char alignX, char alignY, float posX, float posY, float sizeX, float sizeY) => CoreImpl.SetMinimapComponentPosition(name, alignX, alignY, posX, posY, sizeX, sizeY); + public static void SetMinimapComponentPosition(string name, char alignX, char alignY, Vector2 pos, Vector2 size) => CoreImpl.SetMinimapComponentPosition(name, alignX, alignY, pos.X, pos.Y, size.X, size.Y); + public static void CopyToClipboard(string content) => CoreImpl.CopyToClipboard(content); + public static bool GetPermissionState(Permission permission) => CoreImpl.GetPermissionState(permission); + public static bool IsTextureExistInArchetype(uint modelHash, string targetTextureName) => CoreImpl.IsTextureExistInArchetype(modelHash, targetTextureName); + public static bool IsTextureExistInArchetype(string modelName, string targetTextureName) => CoreImpl.IsTextureExistInArchetype(Hash(modelName), targetTextureName); + public static bool IsPointOnScreen(Vector3 position) => CoreImpl.IsPointOnScreen(position); + public static bool IsFullScreen() => CoreImpl.IsFullScreen; + public static void LoadRmlFont(string path, string name, bool italic = false, bool bold = false) => CoreImpl.LoadRmlFont(path, name, italic, bold); + public static void LoadModel(uint modelHash) => CoreImpl.LoadModel(modelHash); + public static void LoadModel(string modelName) => CoreImpl.LoadModel(Hash(modelName)); + public static void LoadModelAsync(uint modelHash) => CoreImpl.LoadModelAsync(modelHash); + public static void LoadModelAsync(string modelName) => CoreImpl.LoadModelAsync(Hash(modelName)); + public static bool LoadYtyp(string ytypName) => CoreImpl.LoadYtyp(ytypName); + public static bool UnloadYtyp(string ytypName) => CoreImpl.UnloadYtyp(ytypName); + public static void RequestIpl(string iplName) => CoreImpl.RequestIpl(iplName); + public static void RemoveIpl(string iplName) => CoreImpl.RemoveIpl(iplName); + public static bool IsKeyDown(Key key) => CoreImpl.IsKeyDown(key); + public static bool IsKeyToggled(Key key) => CoreImpl.IsKeyToggled(key); + public static bool DoesConfigFlagExist(string flagName) => CoreImpl.DoesConfigFlagExist(flagName); + public static bool GetConfigFlag(string flagName) => CoreImpl.GetConfigFlag(flagName); + public static void SetConfigFlag(string flagName, bool value) => CoreImpl.SetConfigFlag(flagName, value); + public static Vector2 GetCursorPos(bool normalized) => CoreImpl.GetCursorPos(normalized); + public static void SetCursorPos(Vector2 pos, bool normalized) => CoreImpl.SetCursorPos(pos, normalized); + public static string GetStatType(string stat) => CoreImpl.GetStatType(stat); + public static void ResetStat(string stat) => CoreImpl.ResetStat(stat); + public static void GetStat(string stat, out int value) => CoreImpl.GetStat(stat, out value); + public static void GetStat(string stat, out long value) => CoreImpl.GetStat(stat, out value); + public static void GetStat(string stat, out float value) => CoreImpl.GetStat(stat, out value); + public static void GetStat(string stat, out bool value) => CoreImpl.GetStat(stat, out value); + public static void GetStat(string stat, out string value) => CoreImpl.GetStat(stat, out value); + public static void GetStat(string stat, out byte value) => CoreImpl.GetStat(stat, out value); + public static void GetStat(string stat, out ushort value) => CoreImpl.GetStat(stat, out value); + public static void GetStat(string stat, out uint value) => CoreImpl.GetStat(stat, out value); + public static void GetStat(string stat, out ulong value) => CoreImpl.GetStat(stat, out value); + public static void SetStat(string stat, int value) => CoreImpl.SetStat(stat, value); + public static void SetStat(string stat, long value) => CoreImpl.SetStat(stat, value); + public static void SetStat(string stat, float value) => CoreImpl.SetStat(stat, value); + public static void SetStat(string stat, bool value) => CoreImpl.SetStat(stat, value); + public static void SetStat(string stat, string value) => CoreImpl.SetStat(stat, value); + public static void SetStat(string stat, byte value) => CoreImpl.SetStat(stat, value); + public static void SetStat(string stat, ushort value) => CoreImpl.SetStat(stat, value); + public static void SetStat(string stat, uint value) => CoreImpl.SetStat(stat, value); + public static void SetStat(string stat, ulong value) => CoreImpl.SetStat(stat, value); + public static void ClearPedProp(int scriptId, byte component) => CoreImpl.ClearPedProp(scriptId, component); + public static void SetPedDlcProp(int scriptId, uint dlc, byte component, byte drawable, byte texture) => CoreImpl.SetPedDlcProp(scriptId, dlc, component, drawable, texture); + public static void SetPedDlcClothes(int scriptId, uint dlc, byte component, byte drawable, byte texture, byte palette) => CoreImpl.SetPedDlcClothes(scriptId, dlc, component, drawable, texture, palette); + public static void SetRotationVelocity(int scriptId, Rotation velocity) => CoreImpl.SetRotationVelocity(scriptId, velocity); + public static void SetWatermarkPosition(WatermarkPosition position) => CoreImpl.SetWatermarkPosition(position); + public static string StringToSha256(string value) => CoreImpl.StringToSha256(value); + public static void SetWeatherCycle(byte[] weathers, byte[] multipliers) => CoreImpl.SetWeatherCycle(weathers, multipliers); + public static void SetWeatherSyncActive(bool state) => CoreImpl.SetWeatherSyncActive(state); + public static string GetHeadshotBase64(byte id) => CoreImpl.GetHeadshotBase64(id); + public static Task TakeScreenshot() => CoreImpl.TakeScreenshot(); + public static Task TakeScreenshotGameOnly() => CoreImpl.TakeScreenshotGameOnly(); + public static void RegisterFont(string path) => CoreImpl.RegisterFont(path); - public static uint GetPoolSize(string pool) => Core.GetPoolSize(pool); - public static uint GetPoolCount(string pool) => Core.GetPoolCount(pool); - public static uint[] GetPoolEntities(string pool) => Core.GetPoolEntities(pool); + public static uint GetPoolSize(string pool) => CoreImpl.GetPoolSize(pool); + public static uint GetPoolCount(string pool) => CoreImpl.GetPoolCount(pool); + public static uint[] GetPoolEntities(string pool) => CoreImpl.GetPoolEntities(pool); - public static uint[] GetVoicePlayers() => Core.GetVoicePlayers(); - public static void RemoveVoicePlayer(uint playerRemoteId) => Core.RemoveVoicePlayer(playerRemoteId); - public static float GetVoiceSpatialVolume(uint playerRemoteId) => Core.GetVoiceSpatialVolume(playerRemoteId); - public static void SetVoiceSpatialVolume(uint playerRemoteId, float volume) => Core.SetVoiceSpatialVolume(playerRemoteId, volume); - public static float GetVoiceNonSpatialVolume(uint playerRemoteId) => Core.GetVoiceNonSpatialVolume(playerRemoteId); - public static void SetVoiceNonSpatialVolume(uint playerRemoteId, float volume) => Core.SetVoiceNonSpatialVolume(playerRemoteId, volume); + public static uint[] GetVoicePlayers() => CoreImpl.GetVoicePlayers(); + public static void RemoveVoicePlayer(uint playerRemoteId) => CoreImpl.RemoveVoicePlayer(playerRemoteId); + public static float GetVoiceSpatialVolume(uint playerRemoteId) => CoreImpl.GetVoiceSpatialVolume(playerRemoteId); + public static void SetVoiceSpatialVolume(uint playerRemoteId, float volume) => CoreImpl.SetVoiceSpatialVolume(playerRemoteId, volume); + public static float GetVoiceNonSpatialVolume(uint playerRemoteId) => CoreImpl.GetVoiceNonSpatialVolume(playerRemoteId); + public static void SetVoiceNonSpatialVolume(uint playerRemoteId, float volume) => CoreImpl.SetVoiceNonSpatialVolume(playerRemoteId, volume); - public static void AddVoiceFilter(uint playerRemoteId, IAudioFilter filter) => Core.AddVoiceFilter(playerRemoteId, filter); - public static void RemoveVoiceFilter(uint playerRemoteId) => Core.RemoveVoiceFilter(playerRemoteId); - public static IAudioFilter GetVoiceFilter(uint playerRemoteId) => Core.GetVoiceFilter(playerRemoteId); + public static void AddVoiceFilter(uint playerRemoteId, IAudioFilter filter) => CoreImpl.AddVoiceFilter(playerRemoteId, filter); + public static void RemoveVoiceFilter(uint playerRemoteId) => CoreImpl.RemoveVoiceFilter(playerRemoteId); + public static IAudioFilter GetVoiceFilter(uint playerRemoteId) => CoreImpl.GetVoiceFilter(playerRemoteId); - public static void UpdateClipContext(Dictionary context) => Core.UpdateClipContext(context); + public static void UpdateClipContext(Dictionary context) => CoreImpl.UpdateClipContext(context); - public static MapZoomData GetMapZoomData(uint id) => Core.GetMapZoomData(id); - public static MapZoomData GetMapZoomData(string alias) => Core.GetMapZoomData(alias); - public static void ResetAllMapZoomData() => Core.ResetAllMapZoomData(); - public static void LoadDefaultIpls() => Core.LoadDefaultIpls(); - public static bool MinimapIsRectangle { set => Core.MinimapIsRectangle = value; } - public static ushort Fps => Core.Fps; - public static ushort Ping => Core.Ping; - public static uint TotalPacketsLost => Core.TotalPacketsLost; - public static ulong TotalPacketsSent => Core.TotalPacketsSent; - public static Vector2 ScreenResolution => Core.ScreenResolution; - public static string LicenseHash => Core.LicenseHash; - public static string Locale => Core.Locale; - public static string ServerIp => Core.ServerIp; - public static ushort ServerPort => Core.ServerPort; - public static bool IsGameFocused => Core.IsGameFocused; - public static bool IsInStreamerMode => Core.IsInStreamerMode; - public static bool IsMenuOpened => Core.IsMenuOpened; - public static bool IsConsoleOpen => Core.IsConsoleOpen; - public static bool CamFrozen { get => Core.CamFrozen; set => Core.CamFrozen = value; } - public static Vector3 CamPos => Core.CamPos; - public static bool GameControlsEnabled { get => Core.GameControlsEnabled; set => Core.GameControlsEnabled = value; } - public static bool RmlControlsEnabled { get => Core.RmlControlsEnabled; set => Core.RmlControlsEnabled = value; } - public static bool VoiceControlsEnabled { get => Core.VoiceControlsEnabled; set => Core.VoiceControlsEnabled = value; } - public static int MsPerGameMinute { get => Core.MsPerGameMinute; set => Core.MsPerGameMinute = value; } + public static MapZoomData GetMapZoomData(uint id) => CoreImpl.GetMapZoomData(id); + public static MapZoomData GetMapZoomData(string alias) => CoreImpl.GetMapZoomData(alias); + public static void ResetAllMapZoomData() => CoreImpl.ResetAllMapZoomData(); + public static void LoadDefaultIpls() => CoreImpl.LoadDefaultIpls(); + public static bool MinimapIsRectangle { set => CoreImpl.MinimapIsRectangle = value; } + public static ushort Fps => CoreImpl.Fps; + public static ushort Ping => CoreImpl.Ping; + public static uint TotalPacketsLost => CoreImpl.TotalPacketsLost; + public static ulong TotalPacketsSent => CoreImpl.TotalPacketsSent; + public static Vector2 ScreenResolution => CoreImpl.ScreenResolution; + public static string LicenseHash => CoreImpl.LicenseHash; + public static string Locale => CoreImpl.Locale; + public static string ServerIp => CoreImpl.ServerIp; + public static ushort ServerPort => CoreImpl.ServerPort; + public static bool IsGameFocused => CoreImpl.IsGameFocused; + public static bool IsInStreamerMode => CoreImpl.IsInStreamerMode; + public static bool IsMenuOpened => CoreImpl.IsMenuOpened; + public static bool IsConsoleOpen => CoreImpl.IsConsoleOpen; + public static bool CamFrozen { get => CoreImpl.CamFrozen; set => CoreImpl.CamFrozen = value; } + public static Vector3 CamPos => CoreImpl.CamPos; + public static bool GameControlsEnabled { get => CoreImpl.GameControlsEnabled; set => CoreImpl.GameControlsEnabled = value; } + public static bool RmlControlsEnabled { get => CoreImpl.RmlControlsEnabled; set => CoreImpl.RmlControlsEnabled = value; } + public static bool VoiceControlsEnabled { get => CoreImpl.VoiceControlsEnabled; set => CoreImpl.VoiceControlsEnabled = value; } + public static int MsPerGameMinute { get => CoreImpl.MsPerGameMinute; set => CoreImpl.MsPerGameMinute = value; } - public static ulong ServerTime => Core.ServerTime; + public static ulong ServerTime => CoreImpl.ServerTime; - public static bool ReloadVehiclePhysics(uint modelHash) => Core.ReloadVehiclePhysics(modelHash); + public static bool ReloadVehiclePhysics(uint modelHash) => CoreImpl.ReloadVehiclePhysics(modelHash); } } \ No newline at end of file diff --git a/api/AltV.Net.Client/Alt.MValue.cs b/api/AltV.Net.Client/Alt.MValue.cs index 0f4fc11a..e8a080e2 100644 --- a/api/AltV.Net.Client/Alt.MValue.cs +++ b/api/AltV.Net.Client/Alt.MValue.cs @@ -6,37 +6,37 @@ public static partial class Alt { public static void RegisterMValueAdapter(IMValueAdapter adapter) { - Core.RegisterMValueAdapter(adapter); + CoreImpl.RegisterMValueAdapter(adapter); } public static bool ToMValue(object obj, Type type, out MValueConst mValue) { - return Core.ToMValue(obj, type, out mValue); + return CoreImpl.ToMValue(obj, type, out mValue); } public static bool FromMValue(in MValueConst mValue, Type type, out object obj) { - return Core.FromMValue(mValue, type, out obj); + return CoreImpl.FromMValue(mValue, type, out obj); } public static bool MValueFromObject(object obj, Type type, out object result) { - return Core.MValueFromObject(obj, type, out result); + return CoreImpl.MValueFromObject(obj, type, out result); } public static bool IsMValueConvertible(Type type) { - return Core.IsMValueConvertible(type); + return CoreImpl.IsMValueConvertible(type); } public static MValueWriter2 CreateMValueWriter() { - return new MValueWriter2(Core); + return new MValueWriter2(CoreImpl); } public static MValueBuffer2 CreateMValueBuffer(MValueConst[] values) { - return new MValueBuffer2(Core, values); + return new MValueBuffer2(CoreImpl, values); } } } \ No newline at end of file diff --git a/api/AltV.Net.Client/Alt.cs b/api/AltV.Net.Client/Alt.cs index 51d9f153..c9150b70 100644 --- a/api/AltV.Net.Client/Alt.cs +++ b/api/AltV.Net.Client/Alt.cs @@ -7,39 +7,39 @@ using AltV.Net.Elements.Entities; using AltV.Net.Shared; +[assembly: InternalsVisibleTo("AltV.Net.Client.Async")] namespace AltV.Net.Client { public static partial class Alt { - public static Core CoreImpl { get; internal set; } = null!; - public static ICore Core => CoreImpl; - public static INativeResource Resource => Core.Resource; + internal static ICore CoreImpl { get; set; } = null!; + public static INativeResource Resource => CoreImpl.Resource; public static ILogger Logger { get; internal set; } = null!; public static bool CacheEntities { get => AltShared.CacheEntities; set => AltShared.CacheEntities = value; } - public static IEnumerable GetRegisteredClientEvents() => Core.GetRegisteredClientEvents(); - public static IEnumerable GetRegisteredServerEvents() => Core.GetRegisteredServerEvents(); + public static IEnumerable GetRegisteredClientEvents() => CoreImpl.GetRegisteredClientEvents(); + public static IEnumerable GetRegisteredServerEvents() => CoreImpl.GetRegisteredServerEvents(); public static bool GetBaseObjectById(BaseObjectType type, uint id, [MaybeNullWhen(false)] out IBaseObject baseObject) { baseObject = default; - var ent = Core.GetBaseObjectById(type, id); + var ent = CoreImpl.GetBaseObjectById(type, id); if (ent is null) return false; baseObject = ent; return true; } - public static INatives Natives => Core.Natives; - public static ILocalPlayer LocalPlayer => Core.PoolManager.Player.LocalPlayer; - public static Discord Discord => Core.Discord; - public static DiscordUser? GetDiscordUser() => Core.GetDiscordUser(); - public static LocalStorage LocalStorage => Core.LocalStorage; - public static Voice Voice => Core.Voice; - public static FocusData FocusData => Core.FocusData; + public static INatives Natives => CoreImpl.Natives; + public static ILocalPlayer LocalPlayer => CoreImpl.PoolManager.Player.LocalPlayer; + public static Discord Discord => CoreImpl.Discord; + public static DiscordUser? GetDiscordUser() => CoreImpl.GetDiscordUser(); + public static LocalStorage LocalStorage => CoreImpl.LocalStorage; + public static Voice Voice => CoreImpl.Voice; + public static FocusData FocusData => CoreImpl.FocusData; - public static HandlingData? GetHandlingByModelHash(uint modelHash) => Core.GetHandlingByModelHash(modelHash); - public static WeaponData? GetWeaponDataByWeaponHash(uint weaponHash) => Core.GetWeaponDataByWeaponHash(weaponHash); - public static uint Hash(string key) => Core.Hash(key); + public static HandlingData? GetHandlingByModelHash(uint modelHash) => CoreImpl.GetHandlingByModelHash(modelHash); + public static WeaponData? GetWeaponDataByWeaponHash(uint weaponHash) => CoreImpl.GetWeaponDataByWeaponHash(weaponHash); + public static uint Hash(string key) => CoreImpl.Hash(key); public static void Log(string message) => Logger.LogInfo(message); public static void LogInfo(string message) => Logger.LogInfo(message); @@ -47,59 +47,59 @@ public static bool GetBaseObjectById(BaseObjectType type, uint id, [MaybeNullWhe public static void LogError(string message) => Logger.LogError(message); public static void LogDebug(string message) => Logger.LogDebug(message); - public static string Branch => Core.Branch; - public static string Version => Core.Version; - public static string SdkVersion => Core.SdkVersion; - public static string CApiVersion => Core.CApiVersion; - public static bool IsDebug => Core.IsDebug; + public static string Branch => CoreImpl.Branch; + public static string Version => CoreImpl.Version; + public static string SdkVersion => CoreImpl.SdkVersion; + public static string CApiVersion => CoreImpl.CApiVersion; + public static bool IsDebug => CoreImpl.IsDebug; - public static IReadOnlyCollection GetAllPlayers() => Core.GetAllPlayers(); - public static IReadOnlyCollection GetAllVehicles() => Core.GetAllVehicles(); - public static IReadOnlyCollection GetAllPeds() => Core.GetAllPeds(); - public static IReadOnlyCollection GetAllNetworkObjects() => Core.GetAllNetworkObjects(); - public static IReadOnlyCollection GetAllColShapes() => Core.GetAllColShapes(); - public static IReadOnlyCollection GetAllMarkers() => Core.GetAllMarkers(); - public static IReadOnlyCollection GetAllTextLabels() => Core.GetAllTextLabels(); - public static IReadOnlyCollection GetAllLocalObjects() => Core.GetAllLocalObjects(); - public static IReadOnlyCollection GetAllLocalVehicles() => Core.GetAllLocalVehicles(); - public static IReadOnlyCollection GetAllLocalPeds() => Core.GetAllLocalPeds(); - public static IReadOnlyCollection GetAllWorldObjects() => Core.GetAllWorldObjects(); - public static IReadOnlyCollection GetAllVirtualEntities() => Core.GetAllVirtualEntities(); - public static IReadOnlyCollection GetAllVirtualEntityGroups() => Core.GetAllVirtualEntityGroups(); + public static IReadOnlyCollection GetAllPlayers() => CoreImpl.GetAllPlayers(); + public static IReadOnlyCollection GetAllVehicles() => CoreImpl.GetAllVehicles(); + public static IReadOnlyCollection GetAllPeds() => CoreImpl.GetAllPeds(); + public static IReadOnlyCollection GetAllNetworkObjects() => CoreImpl.GetAllNetworkObjects(); + public static IReadOnlyCollection GetAllColShapes() => CoreImpl.GetAllColShapes(); + public static IReadOnlyCollection GetAllMarkers() => CoreImpl.GetAllMarkers(); + public static IReadOnlyCollection GetAllTextLabels() => CoreImpl.GetAllTextLabels(); + public static IReadOnlyCollection GetAllLocalObjects() => CoreImpl.GetAllLocalObjects(); + public static IReadOnlyCollection GetAllLocalVehicles() => CoreImpl.GetAllLocalVehicles(); + public static IReadOnlyCollection GetAllLocalPeds() => CoreImpl.GetAllLocalPeds(); + public static IReadOnlyCollection GetAllWorldObjects() => CoreImpl.GetAllWorldObjects(); + public static IReadOnlyCollection GetAllVirtualEntities() => CoreImpl.GetAllVirtualEntities(); + public static IReadOnlyCollection GetAllVirtualEntityGroups() => CoreImpl.GetAllVirtualEntityGroups(); public static IReadOnlyCollection GetAllEntities() => GetAllPlayers().Concat(GetAllVehicles()).Concat(GetAllLocalObjects()).Concat(GetAllWorldObjects()).ToList(); - public static void EmitServer(string eventName, params object[] args) => Core.TriggerServerEvent(eventName, args); - public static void EmitServerUnreliable(string eventName, params object[] args) => Core.TriggerServerEventUnreliable(eventName, args); - public static void EmitClient(string eventName, params object[] args) => Core.TriggerLocalEvent(eventName, args); + public static void EmitServer(string eventName, params object[] args) => CoreImpl.TriggerServerEvent(eventName, args); + public static void EmitServerUnreliable(string eventName, params object[] args) => CoreImpl.TriggerServerEventUnreliable(eventName, args); + public static void EmitClient(string eventName, params object[] args) => CoreImpl.TriggerLocalEvent(eventName, args); - public static ushort EmitRPC(string name, params object[] args) => Core.TriggerServerRPCEvent(name, args); - public static void EmitRPCAnswer(ushort answerId, object answer, string error) => Core.TriggerServerRPCAnswer(answerId, answer, error); + public static ushort EmitRPC(string name, params object[] args) => CoreImpl.TriggerServerRPCEvent(name, args); + public static void EmitRPCAnswer(ushort answerId, object answer, string error) => CoreImpl.TriggerServerRPCAnswer(answerId, answer, error); - public static bool HasResource(string name) => Core.HasResource(name); - public static INativeResource GetResource(string name) => Core.GetResource(name); - public static INativeResource[] GetAllResources() => Core.GetAllResources(); + public static bool HasResource(string name) => CoreImpl.HasResource(name); + public static INativeResource GetResource(string name) => CoreImpl.GetResource(name); + public static INativeResource[] GetAllResources() => CoreImpl.GetAllResources(); - public static uint SetTimeout(Action action, uint duration, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) => Core.SetTimeout(action, duration, filePath, lineNumber); - public static uint SetInterval(Action action, uint duration, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) => Core.SetInterval(action, duration, filePath, lineNumber); - public static uint NextTick(Action action, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) => Core.NextTick(action, filePath, lineNumber); - public static uint EveryTick(Action action, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) => Core.EveryTick(action, filePath, lineNumber); + public static uint SetTimeout(Action action, uint duration, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) => CoreImpl.SetTimeout(action, duration, filePath, lineNumber); + public static uint SetInterval(Action action, uint duration, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) => CoreImpl.SetInterval(action, duration, filePath, lineNumber); + public static uint NextTick(Action action, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) => CoreImpl.NextTick(action, filePath, lineNumber); + public static uint EveryTick(Action action, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) => CoreImpl.EveryTick(action, filePath, lineNumber); - public static void ClearTimer(uint id) => Core.ClearTimer(id); + public static void ClearTimer(uint id) => CoreImpl.ClearTimer(id); public static void ClearTimeout(uint id) => ClearTimer(id); public static void ClearInterval(uint id) => ClearTimer(id); public static void ClearNextTick(uint id) => ClearTimer(id); public static void ClearEveryTick(uint id) => ClearTimer(id); - 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 Vector3 PedBonesPosition(int scriptId, ushort boneId) => Core.PedBonesPosition(scriptId, boneId); - public static IBlip GetBlipByGameId(uint gameId) => Core.GetBlipByGameId(gameId); - public static ICheckpoint GetCheckpointByGameID(uint gameId) => Core.GetCheckpointByGameID(gameId); - public static bool IsWebViewGpuAccelerationActive => Core.IsWebViewGpuAccelerationActive; - public static IWorldObject GetWorldObjectByScriptID(BaseObjectType type, uint scriptId) => Core.GetWorldObjectByScriptID(type, scriptId); - public static VoiceConnectionState GetVoiceConnectionState() => Core.GetVoiceConnectionState(); + 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 Vector3 PedBonesPosition(int scriptId, ushort boneId) => CoreImpl.PedBonesPosition(scriptId, boneId); + public static IBlip GetBlipByGameId(uint gameId) => CoreImpl.GetBlipByGameId(gameId); + public static ICheckpoint GetCheckpointByGameID(uint gameId) => CoreImpl.GetCheckpointByGameID(gameId); + public static bool IsWebViewGpuAccelerationActive => CoreImpl.IsWebViewGpuAccelerationActive; + public static IWorldObject GetWorldObjectByScriptID(BaseObjectType type, uint scriptId) => CoreImpl.GetWorldObjectByScriptID(type, scriptId); + public static VoiceConnectionState GetVoiceConnectionState() => CoreImpl.GetVoiceConnectionState(); - public static int NetTime => Core.NetTime; + public static int NetTime => CoreImpl.NetTime; } } \ No newline at end of file diff --git a/api/AltV.Net.Client/Core.Events.cs b/api/AltV.Net.Client/Core.Events.cs index 7be66dd7..cb5c232d 100644 --- a/api/AltV.Net.Client/Core.Events.cs +++ b/api/AltV.Net.Client/Core.Events.cs @@ -411,7 +411,7 @@ public void OnWeaponDamage(IntPtr eventPointer, IntPtr entityPointer, { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPointer); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPointer); } } } diff --git a/api/AltV.Net.Client/Core.cs b/api/AltV.Net.Client/Core.cs index 10b5d456..71ef135a 100644 --- a/api/AltV.Net.Client/Core.cs +++ b/api/AltV.Net.Client/Core.cs @@ -1143,7 +1143,7 @@ public IVirtualEntity CreateVirtualEntity(IVirtualEntityGroup group, Position po for (var i = 0; i < dataDict.Count; i++) { var stringPtr = MemoryUtils.StringToHGlobalUtf8(dataDict.ElementAt(i).Key); - Alt.Core.CreateMValue(out var mValue, dataDict.ElementAt(i).Value); + Alt.CoreImpl.CreateMValue(out var mValue, dataDict.ElementAt(i).Value); keys[i] = stringPtr; values[i] = mValue.nativePointer; data.Add(stringPtr, mValue); diff --git a/api/AltV.Net.Client/Elements/Entities/Entity.cs b/api/AltV.Net.Client/Elements/Entities/Entity.cs index 5c741f01..bb4c61a8 100644 --- a/api/AltV.Net.Client/Elements/Entities/Entity.cs +++ b/api/AltV.Net.Client/Elements/Entities/Entity.cs @@ -50,7 +50,7 @@ public IPlayer? NetworkOwner CheckIfEntityExistsOrCached(); var ptr = Core.Library.Shared.Entity_GetNetOwner(EntityNativePointer); if (ptr == IntPtr.Zero) return null; - return Alt.Core.PoolManager.Player.Get(ptr); + return Alt.CoreImpl.PoolManager.Player.Get(ptr); } } } diff --git a/api/AltV.Net.Client/Elements/Entities/LocalObject.cs b/api/AltV.Net.Client/Elements/Entities/LocalObject.cs index 6c3ad0cf..7e545779 100644 --- a/api/AltV.Net.Client/Elements/Entities/LocalObject.cs +++ b/api/AltV.Net.Client/Elements/Entities/LocalObject.cs @@ -27,7 +27,7 @@ public static uint GetId(IntPtr objectPointer) { unsafe { - return Alt.Core.Library.Client.LocalObject_GetID(objectPointer); + return Alt.CoreImpl.Library.Client.LocalObject_GetID(objectPointer); } } @@ -62,7 +62,7 @@ public void ResetAlpha() unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_ResetAlpha(LocalObjectNativePointer); + Alt.CoreImpl.Library.Client.LocalObject_ResetAlpha(LocalObjectNativePointer); } } @@ -73,7 +73,7 @@ public bool IsDynamic unsafe { CheckIfEntityExists(); - return Alt.Core.Library.Client.LocalObject_IsDynamic(LocalObjectNativePointer) == 1; + return Alt.CoreImpl.Library.Client.LocalObject_IsDynamic(LocalObjectNativePointer) == 1; } } } @@ -86,7 +86,7 @@ public ushort LodDistance unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_SetLodDistance(LocalObjectNativePointer, value); + Alt.CoreImpl.Library.Client.LocalObject_SetLodDistance(LocalObjectNativePointer, value); } } } @@ -98,7 +98,7 @@ public bool Gravity unsafe { CheckIfEntityExists(); - return Alt.Core.Library.Client.LocalObject_HasGravity(LocalObjectNativePointer) == 1; + return Alt.CoreImpl.Library.Client.LocalObject_HasGravity(LocalObjectNativePointer) == 1; } } set @@ -106,7 +106,7 @@ public bool Gravity unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_ToggleGravity(LocalObjectNativePointer, value ? (byte)1 : (byte)0); + Alt.CoreImpl.Library.Client.LocalObject_ToggleGravity(LocalObjectNativePointer, value ? (byte)1 : (byte)0); } } } @@ -117,7 +117,7 @@ public void AttachToEntity(ISharedEntity entity, short bone, Position position, unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_AttachToEntity(LocalObjectNativePointer, entity.EntityNativePointer, bone, position, rotation, + Alt.CoreImpl.Library.Client.LocalObject_AttachToEntity(LocalObjectNativePointer, entity.EntityNativePointer, bone, position, rotation, useSoftPinning? (byte)1 : (byte)0, collision? (byte)1 : (byte)0, fixedRotation? (byte)1 : (byte)0); } } @@ -128,7 +128,7 @@ public void AttachToEntity(uint scriptId, short bone, Position position, Rotatio unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_AttachToEntity_ScriptId(LocalObjectNativePointer, scriptId, bone, position, rotation, + Alt.CoreImpl.Library.Client.LocalObject_AttachToEntity_ScriptId(LocalObjectNativePointer, scriptId, bone, position, rotation, useSoftPinning? (byte)1 : (byte)0, collision? (byte)1 : (byte)0, fixedRotation? (byte)1 : (byte)0); } } @@ -138,7 +138,7 @@ public void Detach(bool dynamic) unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_Detach(LocalObjectNativePointer, dynamic ? (byte)1 : (byte)0); + Alt.CoreImpl.Library.Client.LocalObject_Detach(LocalObjectNativePointer, dynamic ? (byte)1 : (byte)0); } } @@ -149,7 +149,7 @@ public bool Collision unsafe { CheckIfEntityExists(); - return Alt.Core.Library.Client.LocalObject_IsCollisionEnabled(LocalObjectNativePointer) == 1; + return Alt.CoreImpl.Library.Client.LocalObject_IsCollisionEnabled(LocalObjectNativePointer) == 1; } } } @@ -159,7 +159,7 @@ public void ToggleCollision(bool toggle, bool keepPhysics) unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_ToggleCollision(LocalObjectNativePointer, toggle ? (byte) 1 : (byte) 0, + Alt.CoreImpl.Library.Client.LocalObject_ToggleCollision(LocalObjectNativePointer, toggle ? (byte) 1 : (byte) 0, keepPhysics ? (byte) 1 : (byte) 0); } } @@ -169,7 +169,7 @@ public void PlaceOnGroundProperly() unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_PlaceOnGroundProperly(LocalObjectNativePointer); + Alt.CoreImpl.Library.Client.LocalObject_PlaceOnGroundProperly(LocalObjectNativePointer); } } @@ -178,7 +178,7 @@ public void SetPositionFrozen(bool state) unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_SetPositionFrozen(LocalObjectNativePointer, state ? (byte)1:(byte)0); + Alt.CoreImpl.Library.Client.LocalObject_SetPositionFrozen(LocalObjectNativePointer, state ? (byte)1:(byte)0); } } @@ -187,7 +187,7 @@ public void ActivatePhysics() unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_ActivatePhysics(LocalObjectNativePointer); + Alt.CoreImpl.Library.Client.LocalObject_ActivatePhysics(LocalObjectNativePointer); } } @@ -199,7 +199,7 @@ public byte TextureVariation unsafe { CheckIfEntityExists(); - Alt.Core.Library.Client.LocalObject_SetTextureVariation(LocalObjectNativePointer, value); + Alt.CoreImpl.Library.Client.LocalObject_SetTextureVariation(LocalObjectNativePointer, value); } } } @@ -211,7 +211,7 @@ public bool IsWorldObject unsafe { CheckIfEntityExists(); - return Alt.Core.Library.Client.LocalObject_IsWorldObject(LocalObjectNativePointer) == 1; + return Alt.CoreImpl.Library.Client.LocalObject_IsWorldObject(LocalObjectNativePointer) == 1; } } } @@ -223,7 +223,7 @@ public uint StreamingDistance unsafe { CheckIfEntityExists(); - return Alt.Core.Library.Client.LocalObject_GetStreamingDistance(LocalObjectNativePointer); + return Alt.CoreImpl.Library.Client.LocalObject_GetStreamingDistance(LocalObjectNativePointer); } } } @@ -235,7 +235,7 @@ public bool IsStreamedIn unsafe { CheckIfEntityExists(); - return Alt.Core.Library.Client.LocalObject_IsStreamedIn(LocalObjectNativePointer) == 1; + return Alt.CoreImpl.Library.Client.LocalObject_IsStreamedIn(LocalObjectNativePointer) == 1; } } } @@ -247,7 +247,7 @@ public bool UsesStreaming unsafe { CheckIfEntityExists(); - return Alt.Core.Library.Client.LocalObject_UsesStreaming(LocalObjectNativePointer) == 1; + return Alt.CoreImpl.Library.Client.LocalObject_UsesStreaming(LocalObjectNativePointer) == 1; } } } diff --git a/api/AltV.Net.Client/Elements/Entities/Object.cs b/api/AltV.Net.Client/Elements/Entities/Object.cs index e9969677..6cf8552c 100644 --- a/api/AltV.Net.Client/Elements/Entities/Object.cs +++ b/api/AltV.Net.Client/Elements/Entities/Object.cs @@ -21,7 +21,7 @@ public static uint GetId(IntPtr pointer) { unsafe { - return Alt.Core.Library.Shared.Object_GetID(pointer); + return Alt.CoreImpl.Library.Shared.Object_GetID(pointer); } } diff --git a/api/AltV.Net.Client/Elements/Entities/Player.cs b/api/AltV.Net.Client/Elements/Entities/Player.cs index 36173b5d..0b285344 100644 --- a/api/AltV.Net.Client/Elements/Entities/Player.cs +++ b/api/AltV.Net.Client/Elements/Entities/Player.cs @@ -57,7 +57,7 @@ public IAudioFilter GetFilter() var ptr = Core.Library.Client.Player_GetFilter(PlayerNativePointer); if (ptr == IntPtr.Zero) return null; - return Alt.Core.PoolManager.AudioFilter.Get(ptr); + return Alt.CoreImpl.PoolManager.AudioFilter.Get(ptr); } } @@ -85,7 +85,7 @@ public IVehicle? Vehicle var ptr = Core.Library.Shared.Player_GetVehicle(PlayerNativePointer); if (ptr == IntPtr.Zero) return null; - return Alt.Core.PoolManager.Vehicle.Get(ptr); + return Alt.CoreImpl.PoolManager.Vehicle.Get(ptr); } } } @@ -111,7 +111,7 @@ public string Name { CheckIfEntityExistsOrCached(); int size = 0; - var str = Alt.Core.Library.Shared.Player_GetName(this.PlayerNativePointer, &size); + var str = Alt.CoreImpl.Library.Shared.Player_GetName(this.PlayerNativePointer, &size); var stringResult = Marshal.PtrToStringUTF8(str, size); Core.Library.Shared.FreeString(str); return stringResult; diff --git a/api/AltV.Net.Client/Elements/Pools/AudioFilterPool.cs b/api/AltV.Net.Client/Elements/Pools/AudioFilterPool.cs index 7c9e5d0b..064401dd 100644 --- a/api/AltV.Net.Client/Elements/Pools/AudioFilterPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/AudioFilterPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.AudioFilter_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.AudioFilter_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/AudioOutputAttachedPool.cs b/api/AltV.Net.Client/Elements/Pools/AudioOutputAttachedPool.cs index e0d62973..49909185 100644 --- a/api/AltV.Net.Client/Elements/Pools/AudioOutputAttachedPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/AudioOutputAttachedPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.AudioAttachedOutput_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.AudioAttachedOutput_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/AudioOutputFrontendPool.cs b/api/AltV.Net.Client/Elements/Pools/AudioOutputFrontendPool.cs index 1e45ff69..b0744291 100644 --- a/api/AltV.Net.Client/Elements/Pools/AudioOutputFrontendPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/AudioOutputFrontendPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.AudioFrontendOutput_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.AudioFrontendOutput_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/AudioOutputPool.cs b/api/AltV.Net.Client/Elements/Pools/AudioOutputPool.cs index 975c4c2e..2a37d095 100644 --- a/api/AltV.Net.Client/Elements/Pools/AudioOutputPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/AudioOutputPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.AudioOutput_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.AudioOutput_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/AudioOutputWorldPool.cs b/api/AltV.Net.Client/Elements/Pools/AudioOutputWorldPool.cs index 95e19930..4e23b07a 100644 --- a/api/AltV.Net.Client/Elements/Pools/AudioOutputWorldPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/AudioOutputWorldPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.AudioWorldOutput_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.AudioWorldOutput_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/AudioPool.cs b/api/AltV.Net.Client/Elements/Pools/AudioPool.cs index 9824c9eb..8c5d9cba 100644 --- a/api/AltV.Net.Client/Elements/Pools/AudioPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/AudioPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Audio_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Audio_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/BlipPool.cs b/api/AltV.Net.Client/Elements/Pools/BlipPool.cs index 7a223a75..576b6788 100644 --- a/api/AltV.Net.Client/Elements/Pools/BlipPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/BlipPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Blip_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Blip_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/CheckpointPool.cs b/api/AltV.Net.Client/Elements/Pools/CheckpointPool.cs index 874ad1fa..1028c2aa 100644 --- a/api/AltV.Net.Client/Elements/Pools/CheckpointPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/CheckpointPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Checkpoint_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Checkpoint_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/ColShapePool.cs b/api/AltV.Net.Client/Elements/Pools/ColShapePool.cs index bcdf5c0d..046fd0fb 100644 --- a/api/AltV.Net.Client/Elements/Pools/ColShapePool.cs +++ b/api/AltV.Net.Client/Elements/Pools/ColShapePool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.ColShape_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.ColShape_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/FontPool.cs b/api/AltV.Net.Client/Elements/Pools/FontPool.cs index f7be2cd7..e2d1dcdd 100644 --- a/api/AltV.Net.Client/Elements/Pools/FontPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/FontPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Client.Font_GetID(entityPointer); + return Alt.CoreImpl.Library.Client.Font_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/HttpClientPool.cs b/api/AltV.Net.Client/Elements/Pools/HttpClientPool.cs index a900a96d..ed7e9cdf 100644 --- a/api/AltV.Net.Client/Elements/Pools/HttpClientPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/HttpClientPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.HttpClient_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.HttpClient_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/LocalObjectPool.cs b/api/AltV.Net.Client/Elements/Pools/LocalObjectPool.cs index b7cca16c..5b4b7efb 100644 --- a/api/AltV.Net.Client/Elements/Pools/LocalObjectPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/LocalObjectPool.cs @@ -13,7 +13,7 @@ protected override uint GetId(IntPtr objectPointer) { unsafe { - return Alt.Core.Library.Client.LocalObject_GetID(objectPointer); + return Alt.CoreImpl.Library.Client.LocalObject_GetID(objectPointer); } } } \ No newline at end of file diff --git a/api/AltV.Net.Client/Elements/Pools/LocalPedPool.cs b/api/AltV.Net.Client/Elements/Pools/LocalPedPool.cs index 0caa6956..8689ceb0 100644 --- a/api/AltV.Net.Client/Elements/Pools/LocalPedPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/LocalPedPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Client.LocalPed_GetID(entityPointer); + return Alt.CoreImpl.Library.Client.LocalPed_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/LocalVehiclePool.cs b/api/AltV.Net.Client/Elements/Pools/LocalVehiclePool.cs index a5ad6c77..f0a035ee 100644 --- a/api/AltV.Net.Client/Elements/Pools/LocalVehiclePool.cs +++ b/api/AltV.Net.Client/Elements/Pools/LocalVehiclePool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Client.LocalVehicle_GetID(entityPointer); + return Alt.CoreImpl.Library.Client.LocalVehicle_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/MarkerPool.cs b/api/AltV.Net.Client/Elements/Pools/MarkerPool.cs index 36a6f11e..f1f74510 100644 --- a/api/AltV.Net.Client/Elements/Pools/MarkerPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/MarkerPool.cs @@ -17,7 +17,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Marker_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Marker_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/ObjectPool.cs b/api/AltV.Net.Client/Elements/Pools/ObjectPool.cs index 44476ca9..4a2b96a5 100644 --- a/api/AltV.Net.Client/Elements/Pools/ObjectPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/ObjectPool.cs @@ -13,7 +13,7 @@ protected override uint GetId(IntPtr objectPointer) { unsafe { - return Alt.Core.Library.Shared.Object_GetID(objectPointer); + return Alt.CoreImpl.Library.Shared.Object_GetID(objectPointer); } } } \ No newline at end of file diff --git a/api/AltV.Net.Client/Elements/Pools/PedPool.cs b/api/AltV.Net.Client/Elements/Pools/PedPool.cs index 372c5c49..a6030f9c 100644 --- a/api/AltV.Net.Client/Elements/Pools/PedPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/PedPool.cs @@ -13,7 +13,7 @@ protected override uint GetId(IntPtr pedPointer) { unsafe { - return Alt.Core.Library.Shared.Ped_GetID (pedPointer); + return Alt.CoreImpl.Library.Shared.Ped_GetID (pedPointer); } } } \ No newline at end of file diff --git a/api/AltV.Net.Client/Elements/Pools/PlayerPool.cs b/api/AltV.Net.Client/Elements/Pools/PlayerPool.cs index 1cf31062..3a869b4a 100644 --- a/api/AltV.Net.Client/Elements/Pools/PlayerPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/PlayerPool.cs @@ -20,7 +20,7 @@ public void InitLocalPlayer(ICore core) var localPlayerPointer = core.Library.Client.Player_GetLocal(); var id = core.Library.Client.LocalPlayer_GetID(localPlayerPointer); - var localPlayer = ((IPlayerFactory) _entityFactory).GetLocalPlayer(Alt.Core, localPlayerPointer, id); + var localPlayer = ((IPlayerFactory) _entityFactory).GetLocalPlayer(Alt.CoreImpl, localPlayerPointer, id); this.Add(localPlayer); this.LocalPlayer = localPlayer; } @@ -30,7 +30,7 @@ protected sealed override uint GetId(IntPtr playerPointer) { unsafe { - return Alt.Core.Library.Shared.Player_GetID(playerPointer); + return Alt.CoreImpl.Library.Shared.Player_GetID(playerPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/RmlDocumentPool.cs b/api/AltV.Net.Client/Elements/Pools/RmlDocumentPool.cs index b3681bcc..12462973 100644 --- a/api/AltV.Net.Client/Elements/Pools/RmlDocumentPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/RmlDocumentPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.RmlDocument_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.RmlDocument_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/TextLabelPool.cs b/api/AltV.Net.Client/Elements/Pools/TextLabelPool.cs index 03a90141..220de9ad 100644 --- a/api/AltV.Net.Client/Elements/Pools/TextLabelPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/TextLabelPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.TextLabel_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.TextLabel_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/VehiclePool.cs b/api/AltV.Net.Client/Elements/Pools/VehiclePool.cs index 1a5769ca..7a3d6db8 100644 --- a/api/AltV.Net.Client/Elements/Pools/VehiclePool.cs +++ b/api/AltV.Net.Client/Elements/Pools/VehiclePool.cs @@ -13,7 +13,7 @@ protected override uint GetId(IntPtr vehiclePointer) { unsafe { - return Alt.Core.Library.Shared.Vehicle_GetID(vehiclePointer); + return Alt.CoreImpl.Library.Shared.Vehicle_GetID(vehiclePointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/VirtualEntityGroupPool.cs b/api/AltV.Net.Client/Elements/Pools/VirtualEntityGroupPool.cs index edeb4964..3b10e791 100644 --- a/api/AltV.Net.Client/Elements/Pools/VirtualEntityGroupPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/VirtualEntityGroupPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.VirtualEntity_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.VirtualEntity_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/VirtualEntityPool.cs b/api/AltV.Net.Client/Elements/Pools/VirtualEntityPool.cs index 8fcecbe1..faf5f831 100644 --- a/api/AltV.Net.Client/Elements/Pools/VirtualEntityPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/VirtualEntityPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.VirtualEntityGroup_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.VirtualEntityGroup_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/WebSocketClientPool.cs b/api/AltV.Net.Client/Elements/Pools/WebSocketClientPool.cs index 76e5bbf3..e58b9b52 100644 --- a/api/AltV.Net.Client/Elements/Pools/WebSocketClientPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/WebSocketClientPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.WebSocketClient_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.WebSocketClient_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/Elements/Pools/WebViewPool.cs b/api/AltV.Net.Client/Elements/Pools/WebViewPool.cs index e33415ca..7b4871ae 100644 --- a/api/AltV.Net.Client/Elements/Pools/WebViewPool.cs +++ b/api/AltV.Net.Client/Elements/Pools/WebViewPool.cs @@ -12,7 +12,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.WebView_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.WebView_GetID(entityPointer); } } } diff --git a/api/AltV.Net.Client/ICore.cs b/api/AltV.Net.Client/ICore.cs index 25a8e41a..57e2f79e 100644 --- a/api/AltV.Net.Client/ICore.cs +++ b/api/AltV.Net.Client/ICore.cs @@ -233,5 +233,6 @@ ILocalObject CreateLocalObject(uint modelHash, Position position, Rotation rotat ulong ServerTime { get; } bool ReloadVehiclePhysics(uint modelHash); + List RunningTimers { get; } } } \ No newline at end of file diff --git a/api/AltV.Net.Client/ModuleWrapper.cs b/api/AltV.Net.Client/ModuleWrapper.cs index edaeccd7..0279d30d 100644 --- a/api/AltV.Net.Client/ModuleWrapper.cs +++ b/api/AltV.Net.Client/ModuleWrapper.cs @@ -114,7 +114,7 @@ public static void MainWithAssembly(Assembly resourceAssembly, IntPtr resourcePo _core = client; Alt.CoreImpl = client; - AltShared.Core = client; + AltShared.CoreImpl = client; Alt.Log("Core initialized"); _core.GetAllPlayers(); diff --git a/api/AltV.Net.Example/SampleResource.cs b/api/AltV.Net.Example/SampleResource.cs index 96f46459..54445719 100644 --- a/api/AltV.Net.Example/SampleResource.cs +++ b/api/AltV.Net.Example/SampleResource.cs @@ -10,6 +10,7 @@ using AltV.Net.BenchmarkRunners; using AltV.Net.Resources.Chat.Api; using AltV.Net.Shared.Utils; +using Microsoft.Diagnostics.NETCore.Client; namespace AltV.Net.Example { @@ -77,9 +78,9 @@ public override void OnStart() var mValues = new MValueConst[1]; var mInnerValues = new MValueConst[1]; - Alt.Core.CreateMValueInt(out mInnerValues[0], 5); - Alt.Core.CreateMValueList(out mValues[0], mInnerValues, 1); - Alt.Core.CreateMValueList(out var mValueList, mValues, 1); + Alt.CreateMValueInt(out mInnerValues[0], 5); + Alt.CreateMValueList(out mValues[0], mInnerValues, 1); + Alt.CreateMValueList(out var mValueList, mValues, 1); var mValuesListGet = mValueList.GetList(); for (var i = 0; i < mValuesListGet.Length; i++) { @@ -256,7 +257,7 @@ async delegate(string s, string s1, long i1, string[] arg3, object[] arg4, IMyVe Alt.Log("result:" + result); }); - Alt.Emit("function_event", Function.Create(Alt.Core, delegate(string bla) + Alt.Emit("function_event", Alt.CreateFunction(delegate(string bla) { Console.WriteLine(bla + " " + (bla == null)); Alt.Log("parameter=" + bla); @@ -269,7 +270,7 @@ async delegate(string s, string s1, long i1, string[] arg3, object[] arg4, IMyVe Alt.Log("result:" + result); }); - Alt.Emit("function_event_action", Function.Create(Alt.Core, delegate(string bla) + Alt.Emit("function_event_action", Alt.CreateFunction(delegate(string bla) { Console.WriteLine(bla + " " + (bla == null)); Alt.Log("parameter=" + bla); @@ -317,13 +318,13 @@ async delegate(string s, string s1, long i1, string[] arg3, object[] arg4, IMyVe Alt.Export("GetBla", () => { Alt.Log("GetBla called"); }); - Alt.Import(Alt.Core.Resource.Name, "GetBla", out Action action); + Alt.Import(Alt.Resource.Name, "GetBla", out Action action); action(); Alt.Export("functionExport", delegate(string name) { Alt.Log("called with:" + name); }); - Alt.Import(Alt.Core.Resource.Name, "functionExport", out Action action2); + Alt.Import(Alt.Resource.Name, "functionExport", out Action action2); action2("123"); /*if (Alt.Import("Bla", "GetBla", out Action value)) @@ -432,7 +433,7 @@ public void asyncBla3(string myString) public void MyParser(IPlayer player, MValueConst[] mValueArray, Action func) { if (mValueArray.Length != 1) return; - var reader = new MValueBuffer2(Alt.Core, mValueArray); // todo move to Alt.CreateMValueBuffer + var reader = Alt.CreateMValueBuffer(mValueArray); // todo move to Alt.CreateMValueBuffer reader.GetNext(out MValueConst mValueConst); if (mValueConst.type != MValueConst.Type.String) return; func(player, mValueConst.GetString()); @@ -441,7 +442,7 @@ public void MyParser(IPlayer player, MValueConst[] mValueArray, Action func) { if (mValueArray.Length != 1) return; - var reader = new MValueBuffer2(Alt.Core, mValueArray); + var reader = Alt.CreateMValueBuffer(mValueArray); if (!reader.GetNext(out string value)) return; func(value); } @@ -450,9 +451,9 @@ public void MyServerEventParser(MValueConst[] mValueArray, Action func) public void MyServerEventParser2(MValueConst[] mValueArray, Action func) { if (mValueArray.Length != 1) return; - var reader = new MValueBuffer2(Alt.Core, mValueArray); + var reader = Alt.CreateMValueBuffer(mValueArray); if (!reader.GetNext(out MValueConst[] array)) return; - var valueReader = new MValueBuffer2(Alt.Core, array); + var valueReader = Alt.CreateMValueBuffer(array); if (!valueReader.GetNext(out string value)) return; func(value); } @@ -460,7 +461,7 @@ public void MyServerEventParser2(MValueConst[] mValueArray, Action func) public void MyServerEventParser3(MValueConst[] mValueArray, Action func) { if (mValueArray.Length != 1) return; - var reader = new MValueBuffer2(Alt.Core, mValueArray); + var reader = Alt.CreateMValueBuffer(mValueArray); if (!reader.GetNext(out IMyVehicle vehicle)) return; func(vehicle); } @@ -468,7 +469,7 @@ public void MyServerEventParser3(MValueConst[] mValueArray, Action f public void MyServerEventParserAsync(MValueConst[] mValueArray, Action func) { if (mValueArray.Length != 1) return; - var reader = new MValueBuffer2(Alt.Core, mValueArray); + var reader = Alt.CreateMValueBuffer(mValueArray); if (!reader.GetNext(out IMyVehicle vehicle)) return; Task.Run(() => func(vehicle)); } @@ -476,7 +477,7 @@ public void MyServerEventParserAsync(MValueConst[] mValueArray, Action func) { if (mValueArray.Length != 1) return; - var reader = new MValueBuffer2(Alt.Core, mValueArray); + var reader = Alt.CreateMValueBuffer(mValueArray); if (!reader.GetNext(out string value)) return; func(player, value); } @@ -484,10 +485,10 @@ public void MyParser4(IPlayer player, MValueConst[] mValueArray, Action func) { if (mValueArray.Length != 1) return; - var reader = new MValueBuffer2(Alt.Core, mValueArray); + var reader = Alt.CreateMValueBuffer(mValueArray); if (!reader.GetNext(out MValueConst[] values)) return; var strings = new string[values.Length]; - var valuesReader = new MValueBuffer2(Alt.Core, values); + var valuesReader = Alt.CreateMValueBuffer(values); var i = 0; while (valuesReader.GetNext(out string value)) { @@ -500,7 +501,7 @@ public void MyParser5(IPlayer player, MValueConst[] mValueArray, Action func) { if (mValueArray.Length != 1) return; - var reader = new MValueBuffer2(Alt.Core, mValueArray); + var reader = Alt.CreateMValueBuffer(mValueArray); if (!reader.GetNext(out IMyVehicle vehicle)) return; func(player, vehicle); } diff --git a/api/AltV.Net.Mock.Example/.gitignore b/api/AltV.Net.Mock.Example/.gitignore deleted file mode 100644 index a9023785..00000000 --- a/api/AltV.Net.Mock.Example/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.dylib -*.dll -*.so -resource \ No newline at end of file diff --git a/api/AltV.Net.Mock.Example/AltV.Net.Mock.Example.csproj b/api/AltV.Net.Mock.Example/AltV.Net.Mock.Example.csproj deleted file mode 100644 index 71e85a38..00000000 --- a/api/AltV.Net.Mock.Example/AltV.Net.Mock.Example.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - Exe - net6.0 - - - - - - - - - - - - - - - diff --git a/api/AltV.Net.Mock.Example/Program.cs b/api/AltV.Net.Mock.Example/Program.cs deleted file mode 100644 index 4269027d..00000000 --- a/api/AltV.Net.Mock.Example/Program.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using AltV.Net.Data; -using AltV.Net.Elements.Entities; -using AltV.Net.Example; - -namespace AltV.Net.Mock.Example -{ - class Program - { - static void Main(string[] args) - { - var mockAltV = - new MockAltV("resource/AltV.Net.Example.dll"); - Alt.EmitAllClients("bla"); - var player = mockAltV.ConnectPlayer("bla", "direct connect", iPlayer => - { - iPlayer.On("bla", objects => { }); - iPlayer.On((name, objects) => { }); - }); - Console.WriteLine(player.DequeueEvent().Name); - Alt.EmitAllClients("bla"); - Console.WriteLine(player.DequeueEvent().Name); - player.On("bla2", objects => { Alt.Log("ev:" + objects.Length); }); - player.Emit("bla2"); - Console.WriteLine(player.DequeueEvent().Name); - player.Damage(null, 1, 10, 5); - var checkpoint = Alt.CreateCheckpoint(1, Position.Zero, 10, 10, Rgba.Zero, 50); - checkpoint.EntityExit(player); - checkpoint.EntityExit(player); - player.Death(null, 1); - player.Disconnect("disconnect"); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/AltV.Net.Mock.csproj b/api/AltV.Net.Mock/AltV.Net.Mock.csproj deleted file mode 100644 index 71db69d7..00000000 --- a/api/AltV.Net.Mock/AltV.Net.Mock.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - net6.0 - AnyCPU - AltV.Net.Mock - AltMp - AltV .NET Core Server Mock Api - AltMp - https://github.com/altmp/coreclr-module - https://github.com/altmp/coreclr-module - git - altv gta bridge mock - 1.17.2-alpha - license.txt - Update dependencies - true - true - snupkg - - - - - true - \ - - - - - - - - - - latest - - - diff --git a/api/AltV.Net.Mock/MockAltV.cs b/api/AltV.Net.Mock/MockAltV.cs deleted file mode 100644 index 6fc15461..00000000 --- a/api/AltV.Net.Mock/MockAltV.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Runtime.Loader; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - //TODO: MValue_GetEntity is currently broken because the cpp code tries to access the getType method from entity - //TODO: we need a way now to create MValues that are giving back the correct values inside storage pointer but without using mvalue_get - //TODO: or create own mock cpp lib? maybe add an macro for building mock lib - public class MockAltV where TPlayer : IPlayer - where TVehicle : IVehicle - where TBlip : IBlip - where TCheckpoint : ICheckpoint - where TVoiceChannel : IVoiceChannel - where TPed : IPed - where TObject : IObject - where TVirtualEntity : IVirtualEntity - where TVirtualEntityGroup : IVirtualEntityGroup - where TMarker : IMarker - where TConnectionInfo : IConnectionInfo - where TColShape : IColShape - { - private readonly ICore core; - - public MockAltV(string entryPoint) - { - //var resource = new MockResourceLoader(IntPtr.Zero, string.Empty, entryPoint).Init(); - IResource resource = null; - var playerFactory = new MockPlayerFactory(resource.GetPlayerFactory()); - var vehicleFactory = new MockVehicleFactory(resource.GetVehicleFactory()); - var pedFactory = new MockPedFactory(resource.GetPedFactory()); - var objectFactory = new MockObjectFactory(resource.GetObjectFactory()); - var blipFactory = new MockBlipFactory(resource.GetBlipFactory()); - var checkpointFactory = new MockCheckpointFactory(resource.GetCheckpointFactory()); - var voiceChannelFactory = new MockVoiceChannelFactory(resource.GetVoiceChannelFactory()); - var colShapeFactory = new MockColShapeFactory(resource.GetColShapeFactory()); - var virtualEntityFactory = new MockVirtualEntityFactory(resource.GetVirtualEntityFactory()); - var virtualEntityGroupFactory = - new MockVirtualEntityGroupFactory(resource.GetVirtualEntityGroupFactory()); - var markerFactory = new MockMarkerFactory(resource.GetMarkerFactory()); - var connectionInfoFactory = - new MockConnectionInfoFactory(resource.GetConnectionInfoFactory()); - - var playerPool = new MockPlayerPool(playerFactory); - var vehiclePool = new MockVehiclePool(vehicleFactory); - var pedPool = new MockPedPool(pedFactory); - var objectPool = new MockObjectPool(objectFactory); - var blipPool = new MockBlipPool(blipFactory); - var checkpointPool = new MockCheckpointPool(checkpointFactory); - var voiceChannelPool = new MockVoiceChannelPool(voiceChannelFactory); - var colShapePool = new MockColShapePool(colShapeFactory); - var virtualEntityPool = new MockVirtualEntityPool(virtualEntityFactory); - var virtualEntityGroupPool = new MockVirtualEntityGroupPool(virtualEntityGroupFactory); - var markerPool = new MockMarkerPool(markerFactory); - var connectionInfoPool = new MockConnectionInfoPool(connectionInfoFactory); - - var baseObjectPool = - new MockPoolManager(playerPool, vehiclePool, pedPool, objectPool, blipPool, checkpointPool, - voiceChannelPool, colShapePool, virtualEntityPool, virtualEntityGroupPool, markerPool, - connectionInfoPool); - core = new MockCore(IntPtr.Zero, baseObjectPool, null); - resource.OnStart(); - } - - public IPlayer ConnectPlayer(string playerName, string reason, Action intercept = null) - { - var ptr = MockEntities.GetNextPtr(out var entityId); - var player = Alt.Core.PoolManager.Player.Create(core, ptr, entityId); - //player.Name = playerName; - intercept?.Invoke(player); - Alt.CoreImpl.OnPlayerConnect(ptr, reason); - return player; - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockAssemblyLoader.cs b/api/AltV.Net.Mock/MockAssemblyLoader.cs deleted file mode 100644 index 303ae208..00000000 --- a/api/AltV.Net.Mock/MockAssemblyLoader.cs +++ /dev/null @@ -1,8 +0,0 @@ -using AltV.Net.ResourceLoaders; - -namespace AltV.Net.Mock -{ - public class MockAssemblyLoader : AssemblyLoader - { - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockBlip.cs b/api/AltV.Net.Mock/MockBlip.cs deleted file mode 100644 index 2754ffef..00000000 --- a/api/AltV.Net.Mock/MockBlip.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Numerics; -using AltV.Net.Data; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockBlip : MockWorldObject, IBlip - { - public MockBlip(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, BaseObjectType.Blip, id) - { - } - - public IntPtr BlipNativePointer { get; } - public bool IsGlobal { get; set; } - - public void AddTargetPlayer(IPlayer player) - { - throw new NotImplementedException(); - } - - public void RemoveTargetPlayer(IPlayer player) - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetTargets() - { - throw new NotImplementedException(); - } - - public bool IsAttached { get; set; } - public IEntity AttachedTo { get; set; } - public byte BlipType { get; set; } - public uint Sprite { get; set; } - public uint Color { get; set; } - public bool Route { get; set; } - public Rgba RouteColor { get; set; } - public Vector2 ScaleXY { get; set; } - public uint Display { get; set; } - public Rgba SecondaryColor { get; set; } - public uint Alpha { get; set; } - public ushort FlashTimer { get; set; } - public ushort FlashInterval { get; set; } - public bool Friendly { get; set; } - public bool Bright { get; set; } - public ushort Number { get; set; } - public bool ShowCone { get; set; } - public bool Flashes { get; set; } - public bool FlashesAlternate { get; set; } - public bool ShortRange { get; set; } - public uint Priority { get; set; } - public float Rotation { get; set; } - public string GxtName { get; set; } - public string Name { get; set; } - public bool Pulse { get; set; } - public bool MissionCreator { get; set; } - public bool TickVisible { get; set; } - public bool HeadingIndicatorVisible { get; set; } - public bool OutlineIndicatorVisible { get; set; } - public bool CrewIndicatorVisible { get; set; } - public uint Category { get; set; } - public bool HighDetail { get; set; } - public bool Shrinked { get; set; } - - public void Fade(uint opacity, uint duration) - { - throw new NotImplementedException(); - } - - public void Destroy() - { - throw new NotImplementedException(); - } - - public bool Visible { get; set; } - public bool IsHiddenOnLegend { get; set; } - public bool IsMinimalOnEdge { get; set; } - public bool IsUseHeightIndicatorOnEdge { get; set; } - public bool IsShortHeightThreshold { get; set; } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockBlipFactory.cs b/api/AltV.Net.Mock/MockBlipFactory.cs deleted file mode 100644 index 3f08d951..00000000 --- a/api/AltV.Net.Mock/MockBlipFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockBlipFactory : IBaseObjectFactory where TEntity : IBlip - { - private readonly IBaseObjectFactory blipFactory; - - public MockBlipFactory(IBaseObjectFactory blipFactory) - { - this.blipFactory = blipFactory; - } - - public IBlip Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create((TEntity)blipFactory.Create(core, entityPointer, id), - new MockBlip(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockBlipPool.cs b/api/AltV.Net.Mock/MockBlipPool.cs deleted file mode 100644 index 66bd775a..00000000 --- a/api/AltV.Net.Mock/MockBlipPool.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockBlipPool : BlipPool - { - public MockBlipPool(IBaseObjectFactory blipFactory) : base(blipFactory) - { - } - - public override void OnRemove(IBlip entity) - { - MockEntities.FreeNoId(entity.NativePointer); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockCheckpoint.Events.cs b/api/AltV.Net.Mock/MockCheckpoint.Events.cs deleted file mode 100644 index 9370f17a..00000000 --- a/api/AltV.Net.Mock/MockCheckpoint.Events.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public static class MockCheckpointEvents - { - public static void EntityEnter(this ICheckpoint checkpoint, IEntity entity) - { - Alt.CoreImpl.OnCheckpoint(checkpoint.NativePointer, entity.NativePointer, entity.Type, true); - } - - public static void EntityExit(this ICheckpoint checkpoint, IEntity entity) - { - Alt.CoreImpl.OnCheckpoint(checkpoint.NativePointer, entity.NativePointer, entity.Type, false); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockCheckpoint.cs b/api/AltV.Net.Mock/MockCheckpoint.cs deleted file mode 100644 index 61adb4ec..00000000 --- a/api/AltV.Net.Mock/MockCheckpoint.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using AltV.Net.Data; -using AltV.Net.Elements.Args; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockCheckpoint : MockColShape, ICheckpoint - { - public MockCheckpoint(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, id) - { - } - - - public IntPtr CheckpointNativePointer { get; } - public byte CheckpointType { get; set; } - public float Height { get; set; } - public float Radius { get; set; } - public Rgba Color { get; set; } - - public Position NextPosition { get; set; } - public uint StreamingDistance { get; } - public bool Visible { get; set; } - public void SetStreamSyncedMetaData(string key, object value) - { - throw new NotImplementedException(); - } - - public void SetStreamSyncedMetaData(Dictionary metaData) - { - throw new NotImplementedException(); - } - - public void SetStreamSyncedMetaData(string key, in MValueConst value) - { - throw new NotImplementedException(); - } - - public void DeleteStreamSyncedMetaData(string key) - { - throw new NotImplementedException(); - } - - public bool HasStreamSyncedMetaData(string key) - { - throw new NotImplementedException(); - } - - public void GetStreamSyncedMetaData(string key, out MValueConst value) - { - throw new NotImplementedException(); - } - - public bool GetStreamSyncedMetaData(string key, out T result) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockCheckpointFactory.cs b/api/AltV.Net.Mock/MockCheckpointFactory.cs deleted file mode 100644 index e9e89376..00000000 --- a/api/AltV.Net.Mock/MockCheckpointFactory.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockCheckpointFactory : IBaseObjectFactory where TEntity : ICheckpoint - { - private readonly IBaseObjectFactory checkpointFactory; - - public MockCheckpointFactory(IBaseObjectFactory checkpointFactory) - { - this.checkpointFactory = checkpointFactory; - } - - public ICheckpoint Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create( - (TEntity)checkpointFactory.Create(core, entityPointer, id), - new MockCheckpoint(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockCheckpointPool.cs b/api/AltV.Net.Mock/MockCheckpointPool.cs deleted file mode 100644 index 4af9dea6..00000000 --- a/api/AltV.Net.Mock/MockCheckpointPool.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockCheckpointPool : CheckpointPool - { - public MockCheckpointPool(IBaseObjectFactory checkpointFactory) : base(checkpointFactory) - { - } - - public override void OnRemove(ICheckpoint entity) - { - MockEntities.FreeNoId(entity.NativePointer); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockClientEvents.cs b/api/AltV.Net.Mock/MockClientEvents.cs deleted file mode 100644 index ea0ea0d8..00000000 --- a/api/AltV.Net.Mock/MockClientEvents.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections.Generic; -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Args; -using AltV.Net.Native; - -namespace AltV.Net.Mock -{ - public static class MockClientEvents - { - public delegate void ClientAnyEventMockDelegate(string eventName, object[] args); - - public delegate void ClientEventMockDelegate(object[] args); - - public class ClientEvent - { - public readonly string Name; - - public readonly object[] Args; - - public ClientEvent(string name, object[] args) - { - Name = name; - Args = args; - } - } - - private static readonly Dictionary> ClientEvents = - new Dictionary>(); - - private static readonly Dictionary> PlayerEvents = - new Dictionary>(); - - private static readonly Dictionary> PlayerAnyEvents = - new Dictionary>(); - - public static ClientEvent DequeueEvent(this IPlayer player) - { - return ClientEvents.TryGetValue(player.NativePointer, out var events) ? events.Dequeue() : null; - } - - internal static void PushEvent(this IPlayer player, string eventName, object[] args) - { - if (!ClientEvents.TryGetValue(player.NativePointer, out _)) - { - ClientEvents.Add(player.NativePointer, new Queue()); - } - - ClientEvents[player.NativePointer].Enqueue(new ClientEvent(eventName, args)); - } - - internal static void PushEvent(this IPlayer player, string eventName, MValueConst[] args) - { - var obj = new object[args.Length]; - for (var i = 0; i < args.Length; i++) - { - obj[i] = args[i].ToObject(); - } - - player.PushEvent(eventName, obj); - if (PlayerEvents.TryGetValue(player.NativePointer, out var eventMockDelegates)) - { - if (eventMockDelegates.TryGetValue(eventName, out var @delegate)) - { - @delegate(obj); - } - } - - if (PlayerAnyEvents.TryGetValue(player.NativePointer, out var anyEventMockDelegates)) - { - foreach (var @delegate in anyEventMockDelegates) - { - @delegate(eventName, obj); - } - } - - //TODO: - /*var mValue = MValue.Nil; - AltNative.MValueCreate.MValue_CreateList(args, (ulong) args.Length, ref mValue); - var mValueArray = MValueArray.Nil; - AltNative.MValueGet.MValue_GetList(ref mValue, ref mValueArray);*/ - //Alt.Core.OnClientEvent(player.NativePointer, eventName, ref mValueArray); - } - - /// - /// Registers a event handler to this player that triggers on core to client events with the specified event name - /// - /// - /// - /// - public static void On(this IPlayer player, string eventName, ClientEventMockDelegate clientEventMockDelegate) - { - if (!PlayerEvents.TryGetValue(player.NativePointer, out var eventMockDelegates)) - { - PlayerEvents[player.NativePointer] = new Dictionary(); - } - - PlayerEvents[player.NativePointer][eventName] = clientEventMockDelegate; - } - - /// - /// Registers a event handler to this player that triggers on any server to client event for this player - /// - /// - /// - public static void On(this IPlayer player, ClientAnyEventMockDelegate clientEventMockDelegate) - { - if (!PlayerAnyEvents.TryGetValue(player.NativePointer, out var eventMockDelegates)) - { - PlayerAnyEvents[player.NativePointer] = new List(); - } - - PlayerAnyEvents[player.NativePointer].Add(clientEventMockDelegate); - } - - /// - /// Cancels all event handlers and queued events for this player, get called automatically when the player disconnects - /// - /// - public static void CancelEvents(this IPlayer player) - { - ClientEvents.Remove(player.NativePointer); - PlayerEvents.Remove(player.NativePointer); - PlayerAnyEvents.Remove(player.NativePointer); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockColShape.cs b/api/AltV.Net.Mock/MockColShape.cs deleted file mode 100644 index fddb889d..00000000 --- a/api/AltV.Net.Mock/MockColShape.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Numerics; -using AltV.Net.Data; -using AltV.Net.Elements.Entities; -using AltV.Net.Shared.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockColShape : MockWorldObject, IColShape - { - public MockColShape(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, - BaseObjectType.ColShape, id) - { - } - - public IntPtr ColShapeNativePointer { get; } - public ColShapeType ColShapeType { get; } - - public bool IsPlayersOnly { get; set; } - - public bool IsEntityIn(IEntity entity) - { - throw new NotImplementedException(); - } - - public void Destroy() - { - throw new NotImplementedException(); - } - - public bool IsEntityIn(ISharedEntity entity) - { - throw new NotImplementedException(); - } - - public bool IsEntityIdIn(uint id) - { - throw new NotImplementedException(); - } - - public bool IsPointIn(Vector3 point) - { - throw new NotImplementedException(); - } - - public bool IsPlayerIn(IPlayer entity) - { - throw new NotImplementedException(); - } - - public bool IsVehicleIn(IVehicle entity) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockColShapeFactory.cs b/api/AltV.Net.Mock/MockColShapeFactory.cs deleted file mode 100644 index 34afd513..00000000 --- a/api/AltV.Net.Mock/MockColShapeFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockColShapeFactory : IBaseObjectFactory where TEntity : IColShape - { - private readonly IBaseObjectFactory colShapeFactory; - - public MockColShapeFactory(IBaseObjectFactory colShapeFactory) - { - this.colShapeFactory = colShapeFactory; - } - - public IColShape Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create((TEntity)colShapeFactory.Create(core, entityPointer, id), - new MockColShape(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockColShapePool.cs b/api/AltV.Net.Mock/MockColShapePool.cs deleted file mode 100644 index 66914f5b..00000000 --- a/api/AltV.Net.Mock/MockColShapePool.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockColShapePool : ColShapePool - { - public MockColShapePool(IBaseObjectFactory colShapeFactory) : base(colShapeFactory) - { - } - - public override void OnRemove(IColShape entity) - { - MockEntities.FreeNoId(entity.NativePointer); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockConnectionInfo.cs b/api/AltV.Net.Mock/MockConnectionInfo.cs deleted file mode 100644 index b3769f7c..00000000 --- a/api/AltV.Net.Mock/MockConnectionInfo.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Threading.Tasks; -using AltV.Net.Data; -using AltV.Net.Elements.Args; -using AltV.Net.Elements.Entities; -using AltV.Net.Shared.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockConnectionInfo : MockWorldObject, IConnectionInfo - { - public MockConnectionInfo(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, - BaseObjectType.ConnectionInfo, id) - { - } - - public IntPtr ConnectionInfoNativePointer { get; } - public string Name { get; } - public ulong SocialId { get; } - public ulong HardwareIdHash { get; } - public ulong HardwareIdExHash { get; } - public string AuthToken { get; } - public bool IsDebug { get; } - public string Branch { get; } - public ushort VersionMajor { get; } - public ushort VersionMinor { get; } - public string CdnUrl { get; } - public ulong PasswordHash { get; } - public string Ip { get; } - public long DiscordUserId { get; } - public string SocialName { get; } - public string Text { get; set; } - public bool IsAccepted { get; } - - public void Accept(bool sendNames = true) - { - throw new NotImplementedException(); - } - - public void Decline(string reason) - { - throw new NotImplementedException(); - } - - public string CloudId { get; } - public CloudAuthResult CloudAuthResult { get; } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockConnectionInfoFactory.cs b/api/AltV.Net.Mock/MockConnectionInfoFactory.cs deleted file mode 100644 index 10fbd64d..00000000 --- a/api/AltV.Net.Mock/MockConnectionInfoFactory.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockConnectionInfoFactory : IBaseObjectFactory - where TEntity : IConnectionInfo - { - private readonly IBaseObjectFactory factory; - - public MockConnectionInfoFactory(IBaseObjectFactory factory) - { - this.factory = factory; - } - - public IConnectionInfo Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create((TEntity)factory.Create(core, entityPointer, id), - new MockConnectionInfo(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockConnectionInfoPool.cs b/api/AltV.Net.Mock/MockConnectionInfoPool.cs deleted file mode 100644 index b4fb6f18..00000000 --- a/api/AltV.Net.Mock/MockConnectionInfoPool.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockConnectionInfoPool : ConnectionInfoPool - { - public MockConnectionInfoPool(IBaseObjectFactory factory) : base(factory) - { - } - - public override void OnRemove(IConnectionInfo entity) - { - MockEntities.FreeNoId(entity.NativePointer); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockCore.cs b/api/AltV.Net.Mock/MockCore.cs deleted file mode 100644 index 8814dbde..00000000 --- a/api/AltV.Net.Mock/MockCore.cs +++ /dev/null @@ -1,1051 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Numerics; -using System.Runtime.InteropServices; -using AltV.Net.CApi; -using AltV.Net.Data; -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Args; -using AltV.Net.Native; -using AltV.Net.Shared; -using AltV.Net.Shared.Elements.Data; -using AltV.Net.Shared.Elements.Entities; -using AltV.Net.Shared.Enums; -using AltV.Net.Shared.Events; - -namespace AltV.Net.Mock -{ - public class MockCore : ICore - { - public IList UnansweredServerRpcRequest { get; } - public IList UnansweredClientRpcRequest { get; } - ISharedPoolManager ISharedCore.PoolManager => PoolManager; - public Dictionary> VehiclePassengers { get; } - public IPoolManager PoolManager { get; } - public EventStateManager EventStateManager { get; } - ISharedNativeResource ISharedCore.Resource => Resource; - - public IReadOnlyCollection GetAllPeds() - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllNetworkObjects() - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllColShapes() - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllMarkers() - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllConnectionInfos() - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllMetrics() - { - throw new NotImplementedException(); - } - - ISharedBaseObject ISharedCore.GetBaseObjectById(BaseObjectType type, uint id) - { - return GetBaseObjectById(type, id); - } - - public IntPtr NativePointer { get; } - public string SdkVersion { get; } - public string CApiVersion { get; } - - public ILibrary Library { get; } - public INativeResourcePool NativeResourcePool { get; } - - private readonly INativeResourcePool nativeResourcePool; - - public int NetTime => 0; - - public string RootDirectory => ""; - - public string Branch => ""; - - public string Version => ""; - - public INativeResource Resource => new NativeResource(null, IntPtr.Zero); - - internal MockCore(IntPtr nativePointer, IPoolManager poolManager, - INativeResourcePool nativeResourcePool) - { - this.NativePointer = nativePointer; - this.PoolManager = poolManager; - this.nativeResourcePool = nativeResourcePool; - } - - public void LogInfo(string message) - { - Console.WriteLine(message); - } - - public void LogDebug(string message) - { - Console.WriteLine(message); - } - - public void LogWarning(string message) - { - Console.WriteLine(message); - } - - public void LogError(string message) - { - Console.WriteLine(message); - } - - public void LogColored(string message) - { - Console.WriteLine(message); - } - - public void LogInfo(IntPtr message) - { - Console.WriteLine(Marshal.PtrToStringUTF8(message)); - } - - public void LogDebug(IntPtr message) - { - Console.WriteLine(Marshal.PtrToStringUTF8(message)); - } - - public void LogWarning(IntPtr message) - { - Console.WriteLine(Marshal.PtrToStringUTF8(message)); - } - - public void LogError(IntPtr message) - { - Console.WriteLine(Marshal.PtrToStringUTF8(message)); - } - - public void LogColored(IntPtr message) - { - Console.WriteLine(Marshal.PtrToStringUTF8(message)); - } - - public bool IsMainThread() - { - return true; - } - - public ulong HashPassword(string password) - { - throw new System.NotImplementedException(); - } - - public uint Hash(string hash) - { - throw new System.NotImplementedException(); - } - - /*public void TriggerClientEvent(IPlayer player, string eventName, params MValueConst[] args) - { - if (player == null) - { - foreach (var currPlayer in playerPool.GetAllEntities()) - { - currPlayer.Emit(eventName, args); - } - } - else - { - player.PushEvent(eventName, args); - } - - var mValue = MValue.Nil; - AltNative.MValueCreate.MValue_CreateList(args, (ulong) args.Length, ref mValue); - var mValueArray = MValueArray.Nil; - AltNative.MValueGet.MValue_GetList(ref mValue, ref mValueArray); - //Alt.CoreImpl.OnClientEvent(player?.NativePointer ?? IntPtr.Zero, eventName, ref mValueArray); - } - - public void TriggerClientEvent(IPlayer player, string eventName, ref MValue args) - { - var mValueArray = MValueArray.Nil; - AltNative.MValueGet.MValue_GetList(ref args, ref mValueArray); - //Alt.CoreImpl.OnClientEvent(player?.NativePointer ?? IntPtr.Zero, eventName, ref mValueArray); - } - - public void TriggerClientEvent(IPlayer player, string eventName, params object[] args) - { - TriggerClientEvent(player, eventName, MValue.CreateFromObjects(args)); - } - - public void TriggerServerEvent(IntPtr eventNamePtr, params MValue[] args) - { - TriggerServerEvent(Marshal.PtrToStringUTF8(eventNamePtr), args); - } - - public void TriggerServerEvent(IntPtr eventNamePtr, params object[] args) - { - TriggerServerEvent(Marshal.PtrToStringUTF8(eventNamePtr), args); - } - - public void TriggerServerEvent(IntPtr eventNamePtr, ref MValue args) - { - TriggerServerEvent(Marshal.PtrToStringUTF8(eventNamePtr), ref args); - } - - public void TriggerClientEvent(IPlayer player, IntPtr eventNamePtr, params MValue[] args) - { - TriggerClientEvent(player, Marshal.PtrToStringUTF8(eventNamePtr), args); - } - - public void TriggerClientEvent(IPlayer player, IntPtr eventNamePtr, params object[] args) - { - TriggerClientEvent(player, Marshal.PtrToStringUTF8(eventNamePtr), args); - } - - public void TriggerClientEvent(IPlayer player, IntPtr eventNamePtr, ref MValue args) - { - TriggerClientEvent(player, Marshal.PtrToStringUTF8(eventNamePtr), ref args); - }*/ - - public void TriggerClientEventForAll(string eventName, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForSome(IPlayer[] clients, IntPtr eventNamePtr, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForSome(IPlayer[] clients, string eventName, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForSome(IPlayer[] clients, IntPtr eventNamePtr, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForSome(IPlayer[] clients, string eventName, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForSome(IPlayer[] clients, IntPtr eventNamePtr, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForSome(IPlayer[] clients, string eventName, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliable(IPlayer player, IntPtr eventNamePtr, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliable(IPlayer player, string eventName, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliable(IPlayer player, IntPtr eventNamePtr, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliable(IPlayer player, string eventName, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliable(IPlayer player, IntPtr eventNamePtr, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliable(IPlayer player, string eventName, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForAll(IntPtr eventNamePtr, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForAll(string eventName, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForAll(IntPtr eventNamePtr, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForAll(string eventName, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForAll(IntPtr eventNamePtr, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForAll(string eventName, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForSome(IPlayer[] clients, IntPtr eventNamePtr, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForSome(IPlayer[] clients, string eventName, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForSome(IPlayer[] clients, IntPtr eventNamePtr, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForSome(IPlayer[] clients, string eventName, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForSome(IPlayer[] clients, IntPtr eventNamePtr, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventUnreliableForSome(IPlayer[] clients, string eventName, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientRPCAnswer(IPlayer target, ushort answerId, object answer, string error) - { - throw new NotImplementedException(); - } - - public void TriggerClientRPCAnswer(IPlayer player, ushort answerId, MValueConst answer, IntPtr errorPtr) - { - throw new NotImplementedException(); - } - - public void TriggerClientRPCAnswer(IPlayer target, ushort answerId, MValueConst answer, string error) - { - throw new NotImplementedException(); - } - - public ushort TriggerClientRPC(IPlayer target, string name, params object[] args) - { - throw new NotImplementedException(); - } - - public ushort TriggerClientRPC(IPlayer target, string eventName, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public ushort TriggerClientRPC(IPlayer target, IntPtr eventNamePtr, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public IVehicle CreateVehicle(uint model, Position pos, Rotation rotation, uint streamingDistance) - { - var ptr = MockEntities.GetNextPtr(out var entityId); - var vehicle = PoolManager.Vehicle.Create(this, ptr, entityId); - vehicle.Position = pos; - if (vehicle is MockVehicle mockVehicle) - { - mockVehicle.Position = pos; - mockVehicle.Rotation = rotation; - mockVehicle.Model = model; - } - - return vehicle; - } - - public IPed CreatePed(uint model, Position pos, Rotation rotation, uint streamingDistance) - { - var ptr = MockEntities.GetNextPtr(out var entityId); - var ped = PoolManager.Ped.Create(this, ptr, entityId); - ped.Position = pos; - if (ped is MockPed mockPed) - { - mockPed.Position = pos; - mockPed.Rotation = rotation; - mockPed.Model = model; - } - - return ped; - } - - public INativeResource[] GetAllResources() - { - throw new NotImplementedException(); - } - - public IntPtr CreateVehicleEntity(out uint id, uint model, Position pos, Rotation rotation, uint streamingDistance) - { - var ptr = MockEntities.GetNextPtr(out var entityId); - id = entityId; - return ptr; - } - - public IntPtr CreatePedEntity(out uint id, uint model, Position pos, Rotation rotation) - { - var ptr = MockEntities.GetNextPtr(out var entityId); - id = entityId; - return ptr; - } - - public IntPtr CreateNetworkObjectEntity(out uint id, uint model, Position pos, Rotation rotation, - byte alpha = 255, - byte textureVariation = 0, ushort lodDistance = 100) - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllPlayers() - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllVehicles() - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllBlips() - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllCheckpoints() - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllVirtualEntities() - { - throw new NotImplementedException(); - } - - public IReadOnlyCollection GetAllVirtualEntityGroups() - { - throw new NotImplementedException(); - } - - public ICheckpoint CreateCheckpoint(IPlayer player, byte type, Position pos, float radius, float height, - Rgba color, uint streamingDistance) - { - var ptr = MockEntities.GetNextPtr(out var id); - var checkpoint = PoolManager.Checkpoint.Create(this, ptr, id); - if (checkpoint is MockCheckpoint mockCheckpoint) - { - mockCheckpoint.Position = pos; - mockCheckpoint.CheckpointType = type; - mockCheckpoint.Radius = radius; - mockCheckpoint.Height = height; - mockCheckpoint.Color = color; - } - - return checkpoint; - } - - public IBlip CreateBlip(IPlayer player, byte type, Position pos) - { - var ptr = MockEntities.GetNextPtr(out var id); - var blip = PoolManager.Blip.Create(this, ptr, id); - if (blip is MockBlip mockBlip) - { - mockBlip.Position = pos; - mockBlip.BlipType = type; - } - - return blip; - } - - public IBlip CreateBlip(IPlayer player, byte type, IEntity entityAttach) - { - var ptr = MockEntities.GetNextPtr(out var id); - var blip = PoolManager.Blip.Create(this, ptr, id); - if (blip is MockBlip mockBlip) - { - mockBlip.BlipType = type; - mockBlip.IsAttached = true; - mockBlip.AttachedTo = entityAttach; - } - - return blip; - } - - public IBlip CreateBlip(bool global, byte type, IEntity entityAttach, IPlayer[] targets) - { - throw new NotImplementedException(); - } - - public IVoiceChannel CreateVoiceChannel(bool spatial, float maxDistance) - { - var ptr = MockEntities.GetNextPtr(out var id); - var voiceChannel = PoolManager.VoiceChannel.Create(this, ptr, id); - if (voiceChannel is MockVoiceChannel mockVoiceChannel) - { - mockVoiceChannel.IsSpatial = spatial; - mockVoiceChannel.MaxDistance = maxDistance; - } - - return voiceChannel; - } - - public IColShape CreateColShapeCylinder(Position pos, float radius, float height) - { - throw new NotImplementedException(); - } - - public IColShape CreateColShapeSphere(Position pos, float radius) - { - throw new NotImplementedException(); - } - - public IColShape CreateColShapeCircle(Position pos, float radius) - { - throw new NotImplementedException(); - } - - public IColShape CreateColShapeCube(Position pos, Position pos2) - { - throw new NotImplementedException(); - } - - public IColShape CreateColShapeRectangle(Position pos, Position pos2) - { - throw new NotImplementedException(); - } - - public IColShape CreateColShapePolygon(float minZ, float maxZ, Vector2[] points) - { - throw new NotImplementedException(); - } - - public void RemoveColShape(IColShape colShape) - { - throw new NotImplementedException(); - } - - public void RemoveBlip(IBlip blip) - { - } - - public void RemoveCheckpoint(ICheckpoint checkpoint) - { - } - - public void RemoveVehicle(IVehicle vehicle) - { - } - - public void RemoveVoiceChannel(IVoiceChannel channel) - { - } - - public INativeResource GetResource(string name) - { - return new NativeResource(null, IntPtr.Zero); - } - - public INativeResource GetResource(IntPtr resourcePointer) - { - return new NativeResource(null, IntPtr.Zero); - } - - public void CreateMValueVector3(out MValueConst mValue, Position value) - { - throw new NotImplementedException(); - } - - public void CreateMValueVector2(out MValueConst mValue, Vector2 value) - { - throw new NotImplementedException(); - } - - public void CreateMValueRgba(out MValueConst mValue, Rgba value) - { - throw new NotImplementedException(); - } - - public void CreateMValueByteArray(out MValueConst mValue, byte[] value) - { - throw new NotImplementedException(); - } - - public IBaseObject GetBaseObjectById(BaseObjectType type, uint id) - { - throw new NotImplementedException(); - } - - public void StartResource(string name) - { - throw new NotImplementedException(); - } - - public void StopResource(string name) - { - throw new NotImplementedException(); - } - - public void RestartResource(string name) - { - throw new NotImplementedException(); - } - - public bool IsMValueConvertible(Type type) - { - throw new NotImplementedException(); - } - - public void CreateMValueNil(out MValueConst mValue) - { - throw new NotImplementedException(); - } - - public void CreateMValueBool(out MValueConst mValue, bool value) - { - throw new NotImplementedException(); - } - - public void CreateMValueInt(out MValueConst mValue, long value) - { - throw new NotImplementedException(); - } - - public void CreateMValueUInt(out MValueConst mValue, ulong value) - { - throw new NotImplementedException(); - } - - public void CreateMValueDouble(out MValueConst mValue, double value) - { - throw new NotImplementedException(); - } - - public void CreateMValueString(out MValueConst mValue, string value) - { - throw new NotImplementedException(); - } - - public void CreateMValueList(out MValueConst mValue, MValueConst[] val, ulong size) - { - throw new NotImplementedException(); - } - - public void CreateMValueDict(out MValueConst mValue, string[] keys, MValueConst[] val, ulong size) - { - throw new NotImplementedException(); - } - - public void CreateMValueBaseObject(out MValueConst mValue, ISharedBaseObject value) - { - throw new NotImplementedException(); - } - - public void CreateMValueFunction(out MValueConst mValue, IntPtr value) - { - throw new NotImplementedException(); - } - - public void CreateMValue(out MValueConst mValue, object obj) - { - throw new NotImplementedException(); - } - - public void CreateMValues(MValueConst[] mValues, object[] objects) - { - throw new NotImplementedException(); - } - - public void TriggerServerEvent(string eventName, params MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerServerEvent(IntPtr eventNamePtr, params MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerServerEvent(string eventName, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerServerEvent(IntPtr eventNamePtr, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEvent(IPlayer player, IntPtr eventNamePtr, params MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEvent(IPlayer player, string eventName, params MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEvent(IPlayer player, IntPtr eventNamePtr, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEvent(IPlayer player, string eventName, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerServerEvent(IntPtr eventNamePtr, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerServerEvent(string eventName, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEvent(IPlayer player, IntPtr eventNamePtr, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEvent(IPlayer player, string eventName, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForAll(IntPtr eventNamePtr, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForAll(string eventName, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForAll(IntPtr eventNamePtr, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForAll(string eventName, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerClientEventForAll(IntPtr eventNamePtr, params object[] args) - { - throw new NotImplementedException(); - } - - public ICheckpoint CreateCheckpoint(byte type, Position pos, float radius, float height, Rgba color, - uint streamingDistance) - { - throw new NotImplementedException(); - } - - public IBlip CreateBlip(bool global, byte type, Position pos, IPlayer[] targets) - { - throw new NotImplementedException(); - } - - public IColShape CreateColShapeRectangle(float x1, float y1, float x2, float y2, float z) - { - throw new NotImplementedException(); - } - - public void SetMetaData(string key, object value) - { - throw new NotImplementedException(); - } - - public bool HasMetaData(string key) - { - throw new NotImplementedException(); - } - - public void DeleteMetaData(string key) - { - throw new NotImplementedException(); - } - - public void GetMetaData(string key, out MValueConst value) - { - throw new NotImplementedException(); - } - - public void SetSyncedMetaData(string key, object value) - { - throw new NotImplementedException(); - } - - public bool HasSyncedMetaData(string key) - { - throw new NotImplementedException(); - } - - public void DeleteSyncedMetaData(string key) - { - throw new NotImplementedException(); - } - - public void GetSyncedMetaData(string key, out MValueConst value) - { - throw new NotImplementedException(); - } - - public void TriggerLocalEvent(string eventName, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerLocalEvent(IntPtr eventNamePtr, MValueConst[] args) - { - throw new NotImplementedException(); - } - - public void TriggerLocalEvent(string eventName, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerLocalEvent(IntPtr eventNamePtr, IntPtr[] args) - { - throw new NotImplementedException(); - } - - public void TriggerLocalEvent(IntPtr eventNamePtr, params object[] args) - { - throw new NotImplementedException(); - } - - public void TriggerLocalEvent(string eventName, params object[] args) - { - throw new NotImplementedException(); - } - - public VoiceConnectionState GetVoiceConnectionState() - { - throw new NotImplementedException(); - } - - public void SetPassword(string password) - { - throw new NotImplementedException(); - } - - public VehicleModelInfo GetVehicleModelInfo(uint hash) - { - throw new NotImplementedException(); - } - - public PedModelInfo? GetPedModelInfo(uint hash) - { - throw new NotImplementedException(); - } - - public WeaponModelInfo? GetWeaponModelInfo(uint hash) - { - throw new NotImplementedException(); - } - - public void StopServer() - { - throw new NotImplementedException(); - } - - public bool IsDebug { get; } - - public bool FileExists(string path) - { - throw new NotImplementedException(); - } - - public string FileRead(string path) - { - throw new NotImplementedException(); - } - - public byte[] FileReadBinary(string path) - { - throw new NotImplementedException(); - } - - public IConfig GetServerConfig() - { - throw new NotImplementedException(); - } - - public void SetWorldProfiler(bool state) - { - throw new NotImplementedException(); - } - - public IEnumerable GetRegisteredClientEvents() - { - throw new NotImplementedException(); - } - - public IEnumerable GetRegisteredServerEvents() - { - throw new NotImplementedException(); - } - public IBaseObject[] GetClosestEntities(Position position, int range, int dimension, int limit, EntityType allowedTypes, Order order = Order.Default) - { - throw new NotImplementedException(); - } - - public IBaseObject[] GetEntitiesInDimension(int dimension, EntityType allowedTypes) - { - throw new NotImplementedException(); - } - - public IBaseObject[] GetEntitiesInRange(Position position, int range, int dimension, EntityType allowedTypes) - { - throw new NotImplementedException(); - } - - public IntPtr CreateVirtualEntityEntity(out uint id, IVirtualEntityGroup group, Position position, - uint streamingDistance, Dictionary data) - { - throw new NotImplementedException(); - } - - public IntPtr CreateVirtualEntityGroupEntity(out uint id, uint maxEntitiesInStream) - { - throw new NotImplementedException(); - } - - public IntPtr CreateMarkerEntity(out uint id, IPlayer player, MarkerType type, Position pos, Rgba color) - { - throw new NotImplementedException(); - } - - public IBaseObject GetBaseObject(BaseObjectType type, uint id) - { - throw new NotImplementedException(); - } - - public IMetric RegisterMetric(string name, MetricType type = MetricType.MetricTypeGauge, - Dictionary dataDict = default) - { - throw new NotImplementedException(); - } - - public void UnregisterMetric(IMetric metric) - { - throw new NotImplementedException(); - } - - public IMarker CreateMarker(IPlayer player, MarkerType type, Position pos, Rgba color) - { - throw new NotImplementedException(); - } - - public IObject CreateObject(uint hash, Position position, Rotation rotation, byte alpha, byte textureVariation, - ushort lodDistance, uint streamingDistance) - { - throw new NotImplementedException(); - } - - public IVirtualEntityGroup CreateVirtualEntityGroup(uint streamingDistance) - { - throw new NotImplementedException(); - } - - public IVirtualEntity CreateVirtualEntity(IVirtualEntityGroup group, Position position, uint streamingDistance, - Dictionary dataDict) - { - throw new NotImplementedException(); - } - - public void SetVoiceExternalPublic(string host, ushort port) - { - throw new NotImplementedException(); - } - - public void SetVoiceExternal(string host, ushort port) - { - throw new NotImplementedException(); - } - - public ushort MaxStreamingPeds { get; set; } - public ushort MaxStreamingObjects { get; set; } - public ushort MaxStreamingVehicles { get; set; } - public byte StreamerThreadCount { get; set; } - public uint StreamingTickRate { get; set; } - public uint StreamingDistance { get; set; } - public uint ColShapeTickRate { get; set; } - public uint MigrationDistance { get; set; } - public byte MigrationThreadCount { get; set; } - public uint MigrationTickRate { get; set; } - public byte SyncReceiveThreadCount { get; set; } - public byte SyncSendThreadCount { get; set; } - public uint[] LoadedVehicleModels { get; } - public void AddClientConfigKey(string key) - { - throw new NotImplementedException(); - } - - public bool HasBenefit(Benefit benefit) - { - throw new NotImplementedException(); - } - - public string PtrToStringUtf8AndFree(nint str, int size) - { - throw new NotImplementedException(); - } - - public void RegisterMValueAdapter(IMValueAdapter adapter) - { - throw new NotImplementedException(); - } - - public bool ToMValue(object obj, Type type, out MValueConst mValue) - { - throw new NotImplementedException(); - } - - public bool FromMValue(in MValueConst mValue, Type type, out object obj) - { - throw new NotImplementedException(); - } - - public bool MValueFromObject(object obj, Type type, out object result) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockDecorator.cs b/api/AltV.Net.Mock/MockDecorator.cs deleted file mode 100644 index 6bc951f1..00000000 --- a/api/AltV.Net.Mock/MockDecorator.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; - -namespace AltV.Net.Mock -{ - public class MockDecorator : DispatchProxy - { - private T decorated; - - private TM mock; - - protected override object Invoke(MethodInfo targetMethod, object[] args) - { - try - { - LogBefore(targetMethod, args); - - var mockMethod = mock.GetType().GetMethods() - .FirstOrDefault(info => info.Name == targetMethod.Name); - var result = mockMethod != null ? mockMethod.Invoke(mock, args) : targetMethod.Invoke(decorated, args); - - LogAfter(targetMethod, args, result); - return result; - } - catch (Exception ex) when (ex is TargetInvocationException) - { - LogException(ex.InnerException ?? ex, targetMethod); - throw ex.InnerException ?? ex; - } - } - - public static T Create(T decorated, TM mock) - { - object proxy = Create>(); - ((MockDecorator)proxy).SetParameters(decorated, mock); - - return (T)proxy; - } - - private void SetParameters(T decorated, TM mock) - { - if (decorated == null || mock == null) - { - throw new ArgumentNullException(nameof(decorated)); - } - - this.decorated = decorated; - this.mock = mock; - } - - public TM GetMock() => mock; - - public T GetDecorated() => decorated; - - private void LogException(Exception exception, MethodInfo methodInfo = null) - { - Console.WriteLine( - $"Class {decorated.GetType().FullName}, Method {methodInfo.Name} threw exception:\n{exception}"); - } - - private void LogAfter(MethodInfo methodInfo, object[] args, object result) - { - Console.WriteLine( - $"Class {decorated.GetType().FullName}, Method {methodInfo.Name} executed, Output: {result}"); - } - - private void LogBefore(MethodInfo methodInfo, object[] args) - { - Console.WriteLine($"Class {decorated.GetType().FullName}, Method {methodInfo.Name} is executing"); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockEntities.cs b/api/AltV.Net.Mock/MockEntities.cs deleted file mode 100644 index 7d521113..00000000 --- a/api/AltV.Net.Mock/MockEntities.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace AltV.Net.Mock -{ - public static class MockEntities - { - private static IntPtr _ptr = IntPtr.Zero; - - private static uint _id = 0; - - private static readonly Stack FreePointers = new Stack(); - - private static readonly Stack FreeIds = new Stack(); - - public static IntPtr GetNextPtr(out uint id) - { - if (FreeIds.Count > 0 && FreePointers.Count > 0) - { - id = FreeIds.Pop(); - return FreePointers.Pop(); - } - - _ptr += 1; - id = ++_id; - return _ptr; - } - - public static void Free(IntPtr intPtr, uint id) - { - FreeIds.Push(id); - FreePointers.Push(intPtr); - } - - public static void FreeNoId(IntPtr intPtr) - { - FreePointers.Push(intPtr); - } - - public static IntPtr GetNextPtrNoId() - { - if (FreePointers.Count > 0) - { - return FreePointers.Pop(); - } - - _ptr += 1; - return _ptr; - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockEntity.cs b/api/AltV.Net.Mock/MockEntity.cs deleted file mode 100644 index 9bc34a4b..00000000 --- a/api/AltV.Net.Mock/MockEntity.cs +++ /dev/null @@ -1,207 +0,0 @@ -using System; -using System.Collections.Generic; -using AltV.Net.Data; -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Args; -using AltV.Net.Native; - -namespace AltV.Net.Mock -{ - public abstract class MockEntity : Entity - { - public IntPtr NativePointer { get; } - public bool Exists { get; } - public uint Id { get; } - public BaseObjectType Type { get; } - public override uint Model { get; set; } - - private readonly Dictionary data = new Dictionary(); - - private readonly Dictionary metaData = new Dictionary(); - - private readonly Dictionary syncedMetaData = new Dictionary(); - - public MockEntity(ICore core, IntPtr nativePointer, BaseObjectType baseObjectType, uint id) : base(core, - nativePointer, baseObjectType, id) - { - NativePointer = nativePointer; - Type = baseObjectType; - Id = id; - Exists = true; - } - - public void ResetNetworkOwner() - { - throw new NotImplementedException(); - } - - public void SetPosition(float x, float y, float z) - { - Position = new Position(x, y, z); - } - - public void SetRotation(float roll, float pitch, float yaw) - { - Rotation = new Rotation(roll, pitch, yaw); - } - - public void SetMetaData(string key, object value) - { - Alt.Core.CreateMValue(out var mValue, value); - metaData[key] = mValue; - } - - public bool GetMetaData(string key, out T result) - { - if (!metaData.TryGetValue(key, out var value)) - { - result = default; - return false; - } - - try - { - result = (T)Convert.ChangeType(value.ToObject(), typeof(T)); - return true; - } - catch - { - result = default; - return false; - } - } - - public void SetData(string key, object value) - { - data[key] = value; - } - - public bool GetData(string key, out T result) - { - if (!data.TryGetValue(key, out var value)) - { - result = default; - return false; - } - - if (!(value is T cast)) - { - result = default; - return false; - } - - result = cast; - return true; - } - - public void SetSyncedMetaData(string key, object value) - { - Alt.Core.CreateMValue(out var mValue, value); - syncedMetaData[key] = mValue; - } - - public bool GetSyncedMetaData(string key, out T result) - { - if (!syncedMetaData.TryGetValue(key, out var value)) - { - result = default; - return false; - } - - if (!(value.ToObject() is T cast)) - { - result = default; - return false; - } - - result = cast; - return true; - } - - public bool HasData(string key) - { - throw new NotImplementedException(); - } - - public void DeleteData(string key) - { - throw new NotImplementedException(); - } - - public void ClearData() - { - throw new NotImplementedException(); - } - - public void SetStreamSyncedMetaData(string key, object value) - { - throw new NotImplementedException(); - } - - public bool GetStreamSyncedMetaData(string key, out T result) - { - throw new NotImplementedException(); - } - - public abstract void Destroy(); - - public void CheckIfEntityExists() - { - if (Exists) - { - return; - } - - throw new EntityRemovedException(this); - } - - public void OnDestroy() - { - } - - public bool AddRef() - { - throw new NotImplementedException(); - } - - public bool RemoveRef() - { - throw new NotImplementedException(); - } - - public IEnumerable GetAllDataKeys() - { - throw new NotImplementedException(); - } - - public bool GetSyncedMetaData(string key, out int value) - { - throw new NotImplementedException(); - } - - public bool GetSyncedMetaData(string key, out uint value) - { - throw new NotImplementedException(); - } - - public bool GetSyncedMetaData(string key, out float value) - { - throw new NotImplementedException(); - } - - public bool GetStreamSyncedMetaData(string key, out int value) - { - throw new NotImplementedException(); - } - - public bool GetStreamSyncedMetaData(string key, out uint value) - { - throw new NotImplementedException(); - } - - public bool GetStreamSyncedMetaData(string key, out float value) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockMarker.cs b/api/AltV.Net.Mock/MockMarker.cs deleted file mode 100644 index a9318e22..00000000 --- a/api/AltV.Net.Mock/MockMarker.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using AltV.Net.Data; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock; - -public class MockMarker : Marker -{ - public MockMarker(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, id) - { - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockMarkerFactory.cs b/api/AltV.Net.Mock/MockMarkerFactory.cs deleted file mode 100644 index ebbe4953..00000000 --- a/api/AltV.Net.Mock/MockMarkerFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockMarkerFactory : IBaseObjectFactory where TEntity : IMarker - { - private readonly IBaseObjectFactory markerFactory; - - public MockMarkerFactory(IBaseObjectFactory markerFactory) - { - this.markerFactory = markerFactory; - } - - public IMarker Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create((TEntity)markerFactory.Create(core, entityPointer, id), - new MockMarker(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockMarkerPool.cs b/api/AltV.Net.Mock/MockMarkerPool.cs deleted file mode 100644 index 9edfc2d3..00000000 --- a/api/AltV.Net.Mock/MockMarkerPool.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockMarkerPool : MarkerPool - { - public MockMarkerPool(IBaseObjectFactory factory) : base(factory) - { - } - - public override void OnRemove(IMarker entity) - { - MockEntities.FreeNoId(entity.NativePointer); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockObject.cs b/api/AltV.Net.Mock/MockObject.cs deleted file mode 100644 index 1060ddd9..00000000 --- a/api/AltV.Net.Mock/MockObject.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using AltV.Net.Data; -using AltV.Net.Elements.Entities; -using Object = AltV.Net.Elements.Entities.Object; - -namespace AltV.Net.Mock; - -public class MockObject : Object -{ - public MockObject(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, id) - { - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockObjectFactory.cs b/api/AltV.Net.Mock/MockObjectFactory.cs deleted file mode 100644 index fca00baf..00000000 --- a/api/AltV.Net.Mock/MockObjectFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockObjectFactory : IEntityFactory where TEntity : IObject - { - private readonly IEntityFactory factory; - - public MockObjectFactory(IEntityFactory factory) - { - this.factory = factory; - } - - public IObject Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create((TEntity)factory.Create(core, entityPointer, id), - new MockObject(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockObjectPool.cs b/api/AltV.Net.Mock/MockObjectPool.cs deleted file mode 100644 index 8f47951e..00000000 --- a/api/AltV.Net.Mock/MockObjectPool.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockObjectPool : ObjectPool - { - public MockObjectPool(IEntityFactory factory) : base(factory) - { - } - - public override uint GetId(IntPtr entityPointer) - { - return 0; - } - - public override void OnRemove(IObject entity) - { - MockEntities.Free(entity.NativePointer, entity.Id); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockPed.cs b/api/AltV.Net.Mock/MockPed.cs deleted file mode 100644 index 16c97ced..00000000 --- a/api/AltV.Net.Mock/MockPed.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using AltV.Net.Data; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock; - -public class MockPed : Ped -{ - public MockPed(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, id) - { - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockPedFactory.cs b/api/AltV.Net.Mock/MockPedFactory.cs deleted file mode 100644 index 921a9687..00000000 --- a/api/AltV.Net.Mock/MockPedFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockPedFactory : IEntityFactory where TEntity : IPed - { - private readonly IEntityFactory pedFactory; - - public MockPedFactory(IEntityFactory pedFactory) - { - this.pedFactory = pedFactory; - } - - public IPed Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create((TEntity)pedFactory.Create(core, entityPointer, id), - new MockPed(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockPedPool.cs b/api/AltV.Net.Mock/MockPedPool.cs deleted file mode 100644 index b04471c9..00000000 --- a/api/AltV.Net.Mock/MockPedPool.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockPedPool : PedPool - { - public MockPedPool(IEntityFactory pedFactory) : base(pedFactory) - { - } - - public override uint GetId(IntPtr entityPointer) - { - return 0; - } - - public override void OnRemove(IPed entity) - { - MockEntities.Free(entity.NativePointer, entity.Id); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockPlayer.Events.cs b/api/AltV.Net.Mock/MockPlayer.Events.cs deleted file mode 100644 index d37dc941..00000000 --- a/api/AltV.Net.Mock/MockPlayer.Events.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public static class MockPlayerEvents - { - public static void Disconnect(this IPlayer player, string reason) - { - player.CancelEvents(); - Alt.CoreImpl.OnPlayerDisconnect(player.NativePointer, reason); - } - - public static void Damage(this IPlayer player, IEntity attacker, uint weapon, byte healthDamage, - byte armourDamage) - { - player.Health -= healthDamage; - player.Armor -= armourDamage; - - Alt.CoreImpl.OnPlayerDamage(player.NativePointer, attacker?.NativePointer ?? IntPtr.Zero, - attacker?.Type ?? BaseObjectType.Undefined, weapon, healthDamage, armourDamage); - } - - public static void Death(this IPlayer player, IEntity killer, uint weapon) - { - if (player.IsDead) - { - throw new ArgumentException("Player can't die twice"); - } - - if (((MockDecorator)player).GetMock() is MockPlayer mockPlayer) - { - //mockPlayer.IsDead = true; - } - - Alt.CoreImpl.OnPlayerDeath(player.NativePointer, killer?.NativePointer ?? IntPtr.Zero, - killer?.Type ?? BaseObjectType.Undefined, weapon); - } - - public static void EnterVehicle(this IPlayer player, IVehicle vehicle, byte seat) - { - if (((MockDecorator)player).GetMock() is MockPlayer mockPlayer) - { - //mockPlayer.IsInVehicle = true; - //mockPlayer.Vehicle = vehicle; - //mockPlayer.Seat = seat; - } - - Alt.CoreImpl.OnPlayerEnterVehicle(vehicle.NativePointer, player.NativePointer, seat); - } - - public static void LeaveVehicle(this IPlayer player, IVehicle vehicle, byte seat) - { - if (!player.IsInVehicle) - { - throw new ArgumentException("Player can't leave vehicle outside of an vehicle"); - } - - if (((MockDecorator)player).GetMock() is MockPlayer mockPlayer) - { - //mockPlayer.IsInVehicle = false; - //mockPlayer.Vehicle = null; - //mockPlayer.Seat = 0; - } - - Alt.CoreImpl.OnPlayerLeaveVehicle(vehicle.NativePointer, player.NativePointer, seat); - } - - public static void ChangeSeat(this IPlayer player, IVehicle vehicle, byte seat) - { - if (!player.IsInVehicle) - { - throw new ArgumentException("Player can't change seat outside of an vehicle"); - } - - var oldSeat = player.Seat; - if (((MockDecorator)player).GetMock() is MockPlayer mockPlayer) - { - //mockPlayer.Seat = seat; - } - - Alt.CoreImpl.OnPlayerChangeVehicleSeat(vehicle.NativePointer, player.NativePointer, oldSeat, seat); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockPlayer.cs b/api/AltV.Net.Mock/MockPlayer.cs deleted file mode 100644 index 832c80bc..00000000 --- a/api/AltV.Net.Mock/MockPlayer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockPlayer : Player - { - public MockPlayer(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, id) - { - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockPlayerFactory.cs b/api/AltV.Net.Mock/MockPlayerFactory.cs deleted file mode 100644 index 990a42b3..00000000 --- a/api/AltV.Net.Mock/MockPlayerFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockPlayerFactory : IEntityFactory where TEntity : IPlayer - { - private readonly IEntityFactory playerFactory; - - public MockPlayerFactory(IEntityFactory playerFactory) - { - this.playerFactory = playerFactory; - } - - public IPlayer Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create((TEntity)playerFactory.Create(core, entityPointer, id), - new MockPlayer(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockPlayerPool.cs b/api/AltV.Net.Mock/MockPlayerPool.cs deleted file mode 100644 index 6bac86af..00000000 --- a/api/AltV.Net.Mock/MockPlayerPool.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockPlayerPool : PlayerPool - { - public MockPlayerPool(IEntityFactory playerFactory) : base(playerFactory) - { - } - - public override uint GetId(IntPtr entityPointer) - { - return 0; - } - - public override void OnRemove(IPlayer entity) - { - MockEntities.Free(entity.NativePointer, entity.Id); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockPoolManager.cs b/api/AltV.Net.Mock/MockPoolManager.cs deleted file mode 100644 index d102398d..00000000 --- a/api/AltV.Net.Mock/MockPoolManager.cs +++ /dev/null @@ -1,22 +0,0 @@ -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockPoolManager : PoolManager - { - public MockPoolManager(IEntityPool playerPool, IEntityPool vehiclePool, - IEntityPool pedPool, - IEntityPool objectPool, - IBaseObjectPool blipPool, - IBaseObjectPool checkpointPool, IBaseObjectPool voiceChannelPool, - IBaseObjectPool colShapePool, - IBaseObjectPool virtualEntityPool, - IBaseObjectPool virtualEntityGroupPool, - IBaseObjectPool markerPool, IBaseObjectPool connectionInfoPool) : base( - playerPool, vehiclePool, pedPool, objectPool, blipPool, checkpointPool, voiceChannelPool, colShapePool, - virtualEntityPool, virtualEntityGroupPool, markerPool, connectionInfoPool) - { - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockResourceLoader.cs b/api/AltV.Net.Mock/MockResourceLoader.cs deleted file mode 100644 index 1b29ebb9..00000000 --- a/api/AltV.Net.Mock/MockResourceLoader.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using AltV.Net.ResourceLoaders; - -namespace AltV.Net.Mock -{ - /*internal class MockResourceLoader : ResourceLoader - { - internal MockResourceLoader(IntPtr serverPointer, string resourceName, string entryPoint) : base(serverPointer, - new MockAssemblyLoader(), resourceName, entryPoint) - { - } - - protected override string GetPath(string pathResourceName, string pathEntryName) => pathEntryName; - - protected override void Log(string message) => Console.WriteLine(message); - }*/ -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVehicle.cs b/api/AltV.Net.Mock/MockVehicle.cs deleted file mode 100644 index 72aca320..00000000 --- a/api/AltV.Net.Mock/MockVehicle.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockVehicle : Vehicle - { - public MockVehicle(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, id) - { - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVehicleFactory.cs b/api/AltV.Net.Mock/MockVehicleFactory.cs deleted file mode 100644 index 9d2d4b3e..00000000 --- a/api/AltV.Net.Mock/MockVehicleFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockVehicleFactory : IEntityFactory where TEntity : IVehicle - { - private readonly IEntityFactory vehicleFactory; - - public MockVehicleFactory(IEntityFactory vehicleFactory) - { - this.vehicleFactory = vehicleFactory; - } - - public IVehicle Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create((TEntity)vehicleFactory.Create(core, entityPointer, id), - new MockVehicle(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVehiclePool.cs b/api/AltV.Net.Mock/MockVehiclePool.cs deleted file mode 100644 index 12a05146..00000000 --- a/api/AltV.Net.Mock/MockVehiclePool.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockVehiclePool : VehiclePool - { - public MockVehiclePool(IEntityFactory vehicleFactory) : base(vehicleFactory) - { - } - - public override uint GetId(IntPtr entityPointer) - { - return 0; - } - - public override void OnRemove(IVehicle entity) - { - MockEntities.Free(entity.NativePointer, entity.Id); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVirtualEntity.cs b/api/AltV.Net.Mock/MockVirtualEntity.cs deleted file mode 100644 index e44907dc..00000000 --- a/api/AltV.Net.Mock/MockVirtualEntity.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using AltV.Net.Elements.Args; -using AltV.Net.Elements.Entities; -using AltV.Net.Shared.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockVirtualEntity : MockWorldObject, IVirtualEntity - { - public MockVirtualEntity(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, - BaseObjectType.VirtualEntity, id) - { - } - - public IntPtr VirtualEntityNativePointer { get; } - public ISharedVirtualEntityGroup Group { get; } - - public bool HasStreamSyncedMetaData(string key) - { - throw new NotImplementedException(); - } - - public bool GetStreamSyncedMetaData(string key, out T result) - { - throw new NotImplementedException(); - } - - public void GetStreamSyncedMetaData(string key, out MValueConst value) - { - throw new NotImplementedException(); - } - - public uint StreamingDistance { get; } - public bool Visible { get; set; } - - public void SetStreamSyncedMetaData(string key, object value) - { - throw new NotImplementedException(); - } - - public void SetStreamSyncedMetaData(Dictionary metaData) - { - throw new NotImplementedException(); - } - - public void SetStreamSyncedMetaData(string key, in MValueConst value) - { - throw new NotImplementedException(); - } - - public void DeleteStreamSyncedMetaData(string key) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVirtualEntityFactory.cs b/api/AltV.Net.Mock/MockVirtualEntityFactory.cs deleted file mode 100644 index ceeb6d6e..00000000 --- a/api/AltV.Net.Mock/MockVirtualEntityFactory.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockVirtualEntityFactory : IBaseObjectFactory where TEntity : IVirtualEntity - { - private readonly IBaseObjectFactory virtualEntityFactory; - - public MockVirtualEntityFactory(IBaseObjectFactory virtualEntityFactory) - { - this.virtualEntityFactory = virtualEntityFactory; - } - - public IVirtualEntity Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create( - (TEntity)virtualEntityFactory.Create(core, entityPointer, id), - new MockVirtualEntity(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVirtualEntityGroup.cs b/api/AltV.Net.Mock/MockVirtualEntityGroup.cs deleted file mode 100644 index efd733a0..00000000 --- a/api/AltV.Net.Mock/MockVirtualEntityGroup.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using AltV.Net.Elements.Args; -using AltV.Net.Elements.Entities; -using AltV.Net.Shared.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockVirtualEntityGroup : MockWorldObject, IVirtualEntityGroup - { - public MockVirtualEntityGroup(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, BaseObjectType.VirtualEntityGroup, id) - { - } - - public IntPtr VirtualEntityGroupNativePointer { get; } - public uint MaxEntitiesInStream { get; } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVirtualEntityGroupFactory.cs b/api/AltV.Net.Mock/MockVirtualEntityGroupFactory.cs deleted file mode 100644 index 264ff7c7..00000000 --- a/api/AltV.Net.Mock/MockVirtualEntityGroupFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockVirtualEntityGroupFactory : IBaseObjectFactory where TEntity : IVirtualEntityGroup - { - private readonly IBaseObjectFactory virtualEntityGroupFactory; - - public MockVirtualEntityGroupFactory(IBaseObjectFactory virtualEntityGroupFactory) - { - this.virtualEntityGroupFactory = virtualEntityGroupFactory; - } - - public IVirtualEntityGroup Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create((TEntity) virtualEntityGroupFactory.Create(core, entityPointer, id), - new MockVirtualEntityGroup(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVirtualEntityGroupPool.cs b/api/AltV.Net.Mock/MockVirtualEntityGroupPool.cs deleted file mode 100644 index 2ecc8d3c..00000000 --- a/api/AltV.Net.Mock/MockVirtualEntityGroupPool.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockVirtualEntityGroupPool : VirtualEntityGroupPool - { - public MockVirtualEntityGroupPool(IBaseObjectFactory factory) : base(factory) - { - } - - public override void OnRemove(IVirtualEntityGroup entity) - { - MockEntities.FreeNoId(entity.NativePointer); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVirtualEntityPool.cs b/api/AltV.Net.Mock/MockVirtualEntityPool.cs deleted file mode 100644 index b8051778..00000000 --- a/api/AltV.Net.Mock/MockVirtualEntityPool.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockVirtualEntityPool : VirtualEntityPool - { - public MockVirtualEntityPool(IBaseObjectFactory factory) : base(factory) - { - } - - public override void OnRemove(IVirtualEntity entity) - { - MockEntities.FreeNoId(entity.NativePointer); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVoiceChannel.cs b/api/AltV.Net.Mock/MockVoiceChannel.cs deleted file mode 100644 index 502dda91..00000000 --- a/api/AltV.Net.Mock/MockVoiceChannel.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockVoiceChannel : MockWorldObject, IVoiceChannel - { - public MockVoiceChannel(ICore core, IntPtr nativePointer, uint id): base(core, nativePointer, BaseObjectType.VoiceChannel, id) - { - } - - public IntPtr VoiceChannelNativePointer { get; } - public void AddPlayer(IPlayer player) - { - throw new NotImplementedException(); - } - - public void RemovePlayer(IPlayer player) - { - throw new NotImplementedException(); - } - - public void MutePlayer(IPlayer player) - { - throw new NotImplementedException(); - } - - public void UnmutePlayer(IPlayer player) - { - throw new NotImplementedException(); - } - - public bool HasPlayer(IPlayer player) - { - throw new NotImplementedException(); - } - - public bool IsPlayerMuted(IPlayer player) - { - throw new NotImplementedException(); - } - - public bool IsSpatial { set; get; } - public float MaxDistance { set; get; } - - public void Destroy() - { - throw new NotImplementedException(); - } - - public uint Filter { get; set; } - public int Priority { get; set; } - public IReadOnlyCollection Players { get; } - public ulong PlayerCount { get; } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVoiceChannelFactory.cs b/api/AltV.Net.Mock/MockVoiceChannelFactory.cs deleted file mode 100644 index 75b7a78b..00000000 --- a/api/AltV.Net.Mock/MockVoiceChannelFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockVoiceChannelFactory : IBaseObjectFactory where TEntity : IVoiceChannel - { - private readonly IBaseObjectFactory voiceChannelFactory; - - public MockVoiceChannelFactory(IBaseObjectFactory voiceChannelFactory) - { - this.voiceChannelFactory = voiceChannelFactory; - } - - public IVoiceChannel Create(ICore core, IntPtr entityPointer, uint id) - { - return MockDecorator.Create((TEntity) voiceChannelFactory.Create(core, entityPointer, id), - new MockVoiceChannel(core, entityPointer, id)); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockVoiceChannelPool.cs b/api/AltV.Net.Mock/MockVoiceChannelPool.cs deleted file mode 100644 index f7c55ceb..00000000 --- a/api/AltV.Net.Mock/MockVoiceChannelPool.cs +++ /dev/null @@ -1,17 +0,0 @@ -using AltV.Net.Elements.Entities; -using AltV.Net.Elements.Pools; - -namespace AltV.Net.Mock -{ - public class MockVoiceChannelPool : VoiceChannelPool - { - public MockVoiceChannelPool(IBaseObjectFactory voiceChannelFactory) : base(voiceChannelFactory) - { - } - - public override void OnRemove(IVoiceChannel entity) - { - MockEntities.FreeNoId(entity.NativePointer); - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/MockWorldObject.cs b/api/AltV.Net.Mock/MockWorldObject.cs deleted file mode 100644 index f0c6c10f..00000000 --- a/api/AltV.Net.Mock/MockWorldObject.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using AltV.Net.Data; -using AltV.Net.Elements.Args; -using AltV.Net.Elements.Entities; - -namespace AltV.Net.Mock -{ - public class MockWorldObject : WorldObject - { - public MockWorldObject(ICore core, IntPtr nativePointer, BaseObjectType type, uint id) : base(core, nativePointer, type, id) - { - } - } -} \ No newline at end of file diff --git a/api/AltV.Net.Mock/license/license.txt b/api/AltV.Net.Mock/license/license.txt deleted file mode 100644 index f3d004aa..00000000 --- a/api/AltV.Net.Mock/license/license.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 alt:mp - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/api/AltV.Net.Resources.Chat.Api/ChatModule.cs b/api/AltV.Net.Resources.Chat.Api/ChatModule.cs index 490b130a..d5e5980f 100644 --- a/api/AltV.Net.Resources.Chat.Api/ChatModule.cs +++ b/api/AltV.Net.Resources.Chat.Api/ChatModule.cs @@ -191,7 +191,7 @@ private void RegisterEvents(object target /*, Chat chat*/) { var commandName = command.Name ?? eventMethod.Name; Handles.AddLast(GCHandle.Alloc(eventMethodDelegate)); - var function = Function.Create(Alt.Core, eventMethodDelegate); + var function = Alt.CreateFunction(eventMethodDelegate); if (function == null) { Alt.Log("Unsupported Command method: " + eventMethod); diff --git a/api/AltV.Net.Shared/AltShared.cs b/api/AltV.Net.Shared/AltShared.cs index 0d98c626..24500616 100644 --- a/api/AltV.Net.Shared/AltShared.cs +++ b/api/AltV.Net.Shared/AltShared.cs @@ -9,9 +9,9 @@ namespace AltV.Net.Shared { public static class AltShared { - public static ISharedCore Core { get; set; } - public static uint Hash(string key) => Core.Hash(key); + internal static ISharedCore CoreImpl { get; set; } + public static uint Hash(string key) => CoreImpl.Hash(key); public static bool CacheEntities = true; - public static void EmitLocal(string eventName, params object[] args) => Core.TriggerLocalEvent(eventName, args); + public static void EmitLocal(string eventName, params object[] args) => CoreImpl.TriggerLocalEvent(eventName, args); } } \ No newline at end of file diff --git a/api/AltV.Net.Shared/Elements/Args/MValueBuffer2.cs b/api/AltV.Net.Shared/Elements/Args/MValueBuffer2.cs index 57e83a24..fb02580b 100644 --- a/api/AltV.Net.Shared/Elements/Args/MValueBuffer2.cs +++ b/api/AltV.Net.Shared/Elements/Args/MValueBuffer2.cs @@ -17,8 +17,8 @@ public struct MValueBuffer2 public int size; [Obsolete("Use Alt.CreateMValueBuffer or overload with ISharedCore argument instead")] - public MValueBuffer2(MValueConst[] values) : this(AltShared.Core, values) { - AltShared.Core.LogWarning("new MValueBuffer2(MValueConst[]) is deprecated, use Alt.CreateMValueBuffer or overload with ISharedCore argument instead"); + public MValueBuffer2(MValueConst[] values) : this(AltShared.CoreImpl, values) { + AltShared.CoreImpl.LogWarning("new MValueBuffer2(MValueConst[]) is deprecated, use Alt.CreateMValueBuffer or overload with ISharedCore argument instead"); } public MValueBuffer2(ISharedCore core, MValueConst[] values) diff --git a/api/AltV.Net.Shared/Elements/Args/MValueWriter2.cs b/api/AltV.Net.Shared/Elements/Args/MValueWriter2.cs index 08aa3d7a..5a5959a1 100644 --- a/api/AltV.Net.Shared/Elements/Args/MValueWriter2.cs +++ b/api/AltV.Net.Shared/Elements/Args/MValueWriter2.cs @@ -14,9 +14,9 @@ public class MValueWriter2 : IMValueWriter private readonly ISharedCore core; [Obsolete("Use Alt.CreateMValueWriter or overload with ISharedCore argument instead")] - public MValueWriter2() : this(AltShared.Core) + public MValueWriter2() : this(AltShared.CoreImpl) { - AltShared.Core.LogWarning("new MValueWriter2() is deprecated, use Alt.CreateMValueWriter or overload with ISharedCore argument instead"); + AltShared.CoreImpl.LogWarning("new MValueWriter2() is deprecated, use Alt.CreateMValueWriter or overload with ISharedCore argument instead"); } public MValueWriter2(ISharedCore core) @@ -43,7 +43,7 @@ public struct MValueObject : IWritableMValue public List Values { get; } [Obsolete("Use overload with core as first parameter instead")] - public MValueObject(List names, List values) : this(AltShared.Core, names, values) + public MValueObject(List names, List values) : this(AltShared.CoreImpl, names, values) { } @@ -91,7 +91,7 @@ public struct MValueArray : IWritableMValue [Obsolete("Use overload with core as first parameter instead")] - public MValueArray(List values) : this(AltShared.Core, values) + public MValueArray(List values) : this(AltShared.CoreImpl, values) { } public MValueArray(ISharedCore core, List values) diff --git a/api/AltV.Net.Shared/Events/HashSetEventHandler.cs b/api/AltV.Net.Shared/Events/HashSetEventHandler.cs index a2254fad..688c73e9 100644 --- a/api/AltV.Net.Shared/Events/HashSetEventHandler.cs +++ b/api/AltV.Net.Shared/Events/HashSetEventHandler.cs @@ -2,7 +2,7 @@ namespace AltV.Net.Shared.Events { internal class HashSetEventHandler : IEventHandler { - private ISharedCore core => AltShared.Core; // todo pass core to constructor + private ISharedCore core => AltShared.CoreImpl; // todo pass core to constructor private readonly EventType? type; private readonly HashSet events = new(); diff --git a/api/AltV.Net.Shared/Function.Create.cs b/api/AltV.Net.Shared/Function.Create.cs index 83403007..0d84b60f 100644 --- a/api/AltV.Net.Shared/Function.Create.cs +++ b/api/AltV.Net.Shared/Function.Create.cs @@ -196,256 +196,256 @@ public static Function Create(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Action function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, function); + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create( Func function) { - AltShared.Core.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create>(AltShared.Core, + AltShared.CoreImpl.LogWarning("Function.Create is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create>(AltShared.CoreImpl, function); } } diff --git a/api/AltV.Net.Shared/Function.cs b/api/AltV.Net.Shared/Function.cs index 42ac7f3a..10f8b4f0 100644 --- a/api/AltV.Net.Shared/Function.cs +++ b/api/AltV.Net.Shared/Function.cs @@ -29,8 +29,8 @@ private delegate bool CallArgsLengthCheckPlayer(Type[] args, int requiredArgsCou [Obsolete("Use Alt.CreateFunction or overload with ISharedCore argument instead")] public static Function Create(T func) where T : Delegate { - AltShared.Core.LogWarning("Function.Create(T func) is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); - return Create(AltShared.Core, func); + AltShared.CoreImpl.LogWarning("Function.Create(T func) is deprecated, use Alt.CreateFunction or overload with ISharedCore argument instead"); + return Create(AltShared.CoreImpl, func); } //TODO: for high optimization add ParseBoolUnsafe ect. that doesn't contains the mValue type check for scenarios where we already had to check the mValue type @@ -67,7 +67,7 @@ public static Function Create(ISharedCore core, T func) where T : Delegate stringParsers[i] = typeInfo.StringParser; if (constParsers[i] == null || objectParsers[i] == null || stringParsers[i] == null) { - AltShared.Core.LogWarning("Failed to construct a function because of unsupported argument type " + arg + " at index " + i); + AltShared.CoreImpl.LogWarning("Failed to construct a function because of unsupported argument type " + arg + " at index " + i); return null; } } diff --git a/api/AltV.Net.Shared/FunctionParser/FunctionTypeInfo.cs b/api/AltV.Net.Shared/FunctionParser/FunctionTypeInfo.cs index 4f3b9635..bef375ec 100644 --- a/api/AltV.Net.Shared/FunctionParser/FunctionTypeInfo.cs +++ b/api/AltV.Net.Shared/FunctionParser/FunctionTypeInfo.cs @@ -320,7 +320,7 @@ public FunctionTypeInfo(Type paramType, ParameterInfo paramInfo = null) ObjectParser = FunctionObjectParsers.ParseRgba; StringParser = FunctionStringParsers.ParseRgba; } - else if (AltShared.Core.IsMValueConvertible(paramType)) + else if (AltShared.CoreImpl.IsMValueConvertible(paramType)) { ConstParser = FunctionMValueConstParsers.ParseConvertible; ObjectParser = FunctionObjectParsers.ParseConvertible; diff --git a/api/AltV.Net.sln b/api/AltV.Net.sln index ec39ffdd..5e11f47b 100644 --- a/api/AltV.Net.sln +++ b/api/AltV.Net.sln @@ -6,10 +6,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltV.Net.Example", "AltV.Ne EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltV.Net.Executable.Example", "AltV.Net.Executable.Example\AltV.Net.Executable.Example.csproj", "{900D195C-38A2-419F-A732-31DD9DE970C3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltV.Net.Mock", "AltV.Net.Mock\AltV.Net.Mock.csproj", "{780345D7-EFCA-4D86-BC72-806C00472E60}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltV.Net.Mock.Example", "AltV.Net.Mock.Example\AltV.Net.Mock.Example.csproj", "{5BC7624A-FB7D-405E-9FED-A2BBFFFFD145}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltV.Net.Async", "AltV.Net.Async\AltV.Net.Async.csproj", "{24055D62-A4EB-4F4E-928F-4CB46D58F65B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AltV.Net.CoreRT.Example", "AltV.Net.CoreRT.Example\AltV.Net.CoreRT.Example.csproj", "{5687CC8F-F11D-4C6E-9DDB-202163A44218}" @@ -103,18 +99,6 @@ Global {900D195C-38A2-419F-A732-31DD9DE970C3}.Release|Any CPU.Build.0 = Release|Any CPU {900D195C-38A2-419F-A732-31DD9DE970C3}.Testing|Any CPU.ActiveCfg = Debug|Any CPU {900D195C-38A2-419F-A732-31DD9DE970C3}.Testing|Any CPU.Build.0 = Debug|Any CPU - {780345D7-EFCA-4D86-BC72-806C00472E60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {780345D7-EFCA-4D86-BC72-806C00472E60}.Debug|Any CPU.Build.0 = Debug|Any CPU - {780345D7-EFCA-4D86-BC72-806C00472E60}.Release|Any CPU.ActiveCfg = Release|Any CPU - {780345D7-EFCA-4D86-BC72-806C00472E60}.Release|Any CPU.Build.0 = Release|Any CPU - {780345D7-EFCA-4D86-BC72-806C00472E60}.Testing|Any CPU.ActiveCfg = Debug|Any CPU - {780345D7-EFCA-4D86-BC72-806C00472E60}.Testing|Any CPU.Build.0 = Debug|Any CPU - {5BC7624A-FB7D-405E-9FED-A2BBFFFFD145}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5BC7624A-FB7D-405E-9FED-A2BBFFFFD145}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5BC7624A-FB7D-405E-9FED-A2BBFFFFD145}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5BC7624A-FB7D-405E-9FED-A2BBFFFFD145}.Release|Any CPU.Build.0 = Release|Any CPU - {5BC7624A-FB7D-405E-9FED-A2BBFFFFD145}.Testing|Any CPU.ActiveCfg = Debug|Any CPU - {5BC7624A-FB7D-405E-9FED-A2BBFFFFD145}.Testing|Any CPU.Build.0 = Debug|Any CPU {24055D62-A4EB-4F4E-928F-4CB46D58F65B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {24055D62-A4EB-4F4E-928F-4CB46D58F65B}.Debug|Any CPU.Build.0 = Debug|Any CPU {24055D62-A4EB-4F4E-928F-4CB46D58F65B}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/api/AltV.Net/Alt.Assembly.cs b/api/AltV.Net/Alt.Assembly.cs index 0d063d4b..f6c97f30 100644 --- a/api/AltV.Net/Alt.Assembly.cs +++ b/api/AltV.Net/Alt.Assembly.cs @@ -9,7 +9,7 @@ namespace AltV.Net public partial class Alt { public static IEnumerable Assemblies => CoreImpl.Assemblies; - + public static WeakReference AssemblyLoadContext => CoreImpl.GetAssemblyLoadContext(); public static Assembly LoadAssemblyFromName(AssemblyName assemblyName) => diff --git a/api/AltV.Net/Alt.Blip.cs b/api/AltV.Net/Alt.Blip.cs index 93688c64..98c7ceff 100644 --- a/api/AltV.Net/Alt.Blip.cs +++ b/api/AltV.Net/Alt.Blip.cs @@ -16,7 +16,7 @@ public partial class Alt /// The created Blip. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IBlip CreateBlip(bool global, byte type, Position pos, IPlayer[] targets) => - Core.CreateBlip(global, type, pos, targets); + CoreImpl.CreateBlip(global, type, pos, targets); /// /// Create a blip for a specific player, attached to specific entity. @@ -28,7 +28,7 @@ public static IBlip CreateBlip(bool global, byte type, Position pos, IPlayer[] t /// The created Blip. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IBlip CreateBlip(bool global, byte type, IEntity entityAttach, IPlayer[] targets) => - Core.CreateBlip(global, type, entityAttach, targets); + CoreImpl.CreateBlip(global, type, entityAttach, targets); /// /// Creates a blip for a specific player on a specific position. @@ -40,7 +40,7 @@ public static IBlip CreateBlip(bool global, byte type, IEntity entityAttach, IPl /// The created Blip. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IBlip CreateBlip(bool global, BlipType type, Position pos, IPlayer[] targets) => - Core.CreateBlip(global, (byte) type, pos, targets); + CoreImpl.CreateBlip(global, (byte) type, pos, targets); /// /// Creates a blip for a specific player, attached to specific entity. @@ -52,6 +52,6 @@ public static IBlip CreateBlip(bool global, BlipType type, Position pos, IPlayer /// The created Blip. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IBlip CreateBlip(bool global, BlipType type, IEntity entityAttach, IPlayer[] targets) => - Core.CreateBlip(global, (byte) type, entityAttach, targets); + CoreImpl.CreateBlip(global, (byte) type, entityAttach, targets); } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.Checkpoint.cs b/api/AltV.Net/Alt.Checkpoint.cs index 0b8746a1..f0c4f22e 100644 --- a/api/AltV.Net/Alt.Checkpoint.cs +++ b/api/AltV.Net/Alt.Checkpoint.cs @@ -16,7 +16,7 @@ public partial class Alt /// The created Checkpoint. public static ICheckpoint CreateCheckpoint(byte type, Position pos, float radius, float height, Rgba color, uint streamingDistance) => - Core.CreateCheckpoint(type, pos, radius, height, color, streamingDistance); + CoreImpl.CreateCheckpoint(type, pos, radius, height, color, streamingDistance); /// /// Creates a checkpoint for a all players, with given type, position, radius, height and color. @@ -29,6 +29,6 @@ public static ICheckpoint CreateCheckpoint(byte type, Position pos, float radius /// public static ICheckpoint CreateCheckpoint(CheckpointType type, Position pos, float radius, float height, Rgba color, uint streamingDistance) => - Core.CreateCheckpoint((byte) type, pos, radius, height, color, streamingDistance); + CoreImpl.CreateCheckpoint((byte) type, pos, radius, height, color, streamingDistance); } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.ColShape.cs b/api/AltV.Net/Alt.ColShape.cs index dc8525fb..4ae20a93 100644 --- a/api/AltV.Net/Alt.ColShape.cs +++ b/api/AltV.Net/Alt.ColShape.cs @@ -15,7 +15,7 @@ public partial class Alt /// The created colshape. public static IColShape CreateColShapeCylinder(Position pos, float radius, float height) { - return Core.CreateColShapeCylinder(pos, radius, height); + return CoreImpl.CreateColShapeCylinder(pos, radius, height); } /// @@ -26,7 +26,7 @@ public static IColShape CreateColShapeCylinder(Position pos, float radius, float /// The created colshape. public static IColShape CreateColShapeSphere(Position pos, float radius) { - return Core.CreateColShapeSphere(pos, radius); + return CoreImpl.CreateColShapeSphere(pos, radius); } /// @@ -37,7 +37,7 @@ public static IColShape CreateColShapeSphere(Position pos, float radius) /// The created colshape. public static IColShape CreateColShapeCircle(Position pos, float radius) { - return Core.CreateColShapeCircle(pos, radius); + return CoreImpl.CreateColShapeCircle(pos, radius); } /// @@ -48,7 +48,7 @@ public static IColShape CreateColShapeCircle(Position pos, float radius) /// The created colshape. public static IColShape CreateColShapeCube(Position pos, Position pos2) { - return Core.CreateColShapeCube(pos, pos2); + return CoreImpl.CreateColShapeCube(pos, pos2); } /// @@ -62,7 +62,7 @@ public static IColShape CreateColShapeCube(Position pos, Position pos2) /// The created colshape. public static IColShape CreateColShapeRectangle(float x1, float y1, float x2, float y2, float z) { - return Core.CreateColShapeRectangle(x1, y1, x2, y2, z); + return CoreImpl.CreateColShapeRectangle(x1, y1, x2, y2, z); } /// @@ -74,7 +74,7 @@ public static IColShape CreateColShapeRectangle(float x1, float y1, float x2, fl /// The created colshape. public static IColShape CreateColShapePolygon(float minZ, float maxZ, Vector2[] points) { - return Core.CreateColShapePolygon(minZ, maxZ, points); + return CoreImpl.CreateColShapePolygon(minZ, maxZ, points); } } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.Events.cs b/api/AltV.Net/Alt.Events.cs index 50cd05aa..c49bcfaf 100644 --- a/api/AltV.Net/Alt.Events.cs +++ b/api/AltV.Net/Alt.Events.cs @@ -6,8 +6,8 @@ public static partial class Alt { public static event CheckpointDelegate OnCheckpoint { - add => CoreImpl.CheckpointEventHandler.Add(value); - remove => CoreImpl.CheckpointEventHandler.Remove(value); + add => ((Core)CoreImpl).CheckpointEventHandler.Add(value); + remove => ((Core)CoreImpl).CheckpointEventHandler.Remove(value); } /// @@ -22,68 +22,68 @@ public static event CheckpointDelegate OnCheckpoint /// public static event PlayerConnectDelegate OnPlayerConnect { - add => CoreImpl.PlayerConnectEventHandler.Add(value); - remove => CoreImpl.PlayerConnectEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerConnectEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerConnectEventHandler.Remove(value); } public static event BaseObjectCreateDelegate OnBaseObjectCreate { - add => CoreImpl.BaseObjectCreateEventHandler.Add(value); - remove => CoreImpl.BaseObjectCreateEventHandler.Remove(value); + add => ((Core)CoreImpl).BaseObjectCreateEventHandler.Add(value); + remove => ((Core)CoreImpl).BaseObjectCreateEventHandler.Remove(value); } public static event BaseObjectRemoveDelegate OnBaseObjectRemove { - add => CoreImpl.BaseObjectRemoveEventHandler.Add(value); - remove => CoreImpl.BaseObjectRemoveEventHandler.Remove(value); + add => ((Core)CoreImpl).BaseObjectRemoveEventHandler.Add(value); + remove => ((Core)CoreImpl).BaseObjectRemoveEventHandler.Remove(value); } public static event PlayerConnectDeniedDelegate OnPlayerConnectDenied { - add => CoreImpl.PlayerConnectDeniedEventHandler.Add(value); - remove => CoreImpl.PlayerConnectDeniedEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerConnectDeniedEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerConnectDeniedEventHandler.Remove(value); } public static event ResourceEventDelegate OnAnyResourceStart { - add => CoreImpl.ResourceStartEventHandler.Add(value); - remove => CoreImpl.ResourceStartEventHandler.Remove(value); + add => ((Core)CoreImpl).ResourceStartEventHandler.Add(value); + remove => ((Core)CoreImpl).ResourceStartEventHandler.Remove(value); } public static event ResourceEventDelegate OnAnyResourceStop { - add => CoreImpl.ResourceStopEventHandler.Add(value); - remove => CoreImpl.ResourceStopEventHandler.Remove(value); + add => ((Core)CoreImpl).ResourceStopEventHandler.Add(value); + remove => ((Core)CoreImpl).ResourceStopEventHandler.Remove(value); } public static event ResourceEventDelegate OnAnyResourceError { - add => CoreImpl.ResourceErrorEventHandler.Add(value); - remove => CoreImpl.ResourceErrorEventHandler.Remove(value); + add => ((Core)CoreImpl).ResourceErrorEventHandler.Add(value); + remove => ((Core)CoreImpl).ResourceErrorEventHandler.Remove(value); } public static event PlayerDamageDelegate OnPlayerDamage { - add => CoreImpl.PlayerDamageEventHandler.Add(value); - remove => CoreImpl.PlayerDamageEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerDamageEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerDamageEventHandler.Remove(value); } public static event PlayerDeadDelegate OnPlayerDead { - add => CoreImpl.PlayerDeadEventHandler.Add(value); - remove => CoreImpl.PlayerDeadEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerDeadEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerDeadEventHandler.Remove(value); } public static event PlayerHealDelegate OnPlayerHeal { - add => CoreImpl.PlayerHealEventHandler.Add(value); - remove => CoreImpl.PlayerHealEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerHealEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerHealEventHandler.Remove(value); } public static event ExplosionDelegate OnExplosion { - add => CoreImpl.ExplosionEventHandler.Add(value); - remove => CoreImpl.ExplosionEventHandler.Remove(value); + add => ((Core)CoreImpl).ExplosionEventHandler.Add(value); + remove => ((Core)CoreImpl).ExplosionEventHandler.Remove(value); } /// @@ -100,86 +100,86 @@ public static event ExplosionDelegate OnExplosion /// public static event WeaponDamageDelegate OnWeaponDamage { - add => CoreImpl.WeaponDamageEventHandler.Add(value); - remove => CoreImpl.WeaponDamageEventHandler.Remove(value); + add => ((Core)CoreImpl).WeaponDamageEventHandler.Add(value); + remove => ((Core)CoreImpl).WeaponDamageEventHandler.Remove(value); } public static event PlayerDisconnectDelegate OnPlayerDisconnect { - add => CoreImpl.PlayerDisconnectEventHandler.Add(value); - remove => CoreImpl.PlayerDisconnectEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerDisconnectEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerDisconnectEventHandler.Remove(value); } public static event PlayerRemoveDelegate OnPlayerRemove { - add => CoreImpl.PlayerRemoveEventHandler.Add(value); - remove => CoreImpl.PlayerRemoveEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerRemoveEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerRemoveEventHandler.Remove(value); } public static event VehicleRemoveDelegate OnVehicleRemove { - add => CoreImpl.VehicleRemoveEventHandler.Add(value); - remove => CoreImpl.VehicleRemoveEventHandler.Remove(value); + add => ((Core)CoreImpl).VehicleRemoveEventHandler.Add(value); + remove => ((Core)CoreImpl).VehicleRemoveEventHandler.Remove(value); } public static event PedRemoveDelegate OnPedRemove { - add => CoreImpl.PedRemoveEventHandler.Add(value); - remove => CoreImpl.PedRemoveEventHandler.Remove(value); + add => ((Core)CoreImpl).PedRemoveEventHandler.Add(value); + remove => ((Core)CoreImpl).PedRemoveEventHandler.Remove(value); } public static event PlayerChangeVehicleSeatDelegate OnPlayerChangeVehicleSeat { - add => CoreImpl.PlayerChangeVehicleSeatEventHandler.Add(value); - remove => CoreImpl.PlayerChangeVehicleSeatEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerChangeVehicleSeatEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerChangeVehicleSeatEventHandler.Remove(value); } public static event PlayerEnterVehicleDelegate OnPlayerEnterVehicle { - add => CoreImpl.PlayerEnterVehicleEventHandler.Add(value); - remove => CoreImpl.PlayerEnterVehicleEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerEnterVehicleEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerEnterVehicleEventHandler.Remove(value); } public static event PlayerEnteringVehicleDelegate OnPlayerEnteringVehicle { - add => CoreImpl.PlayerEnteringVehicleEventHandler.Add(value); - remove => CoreImpl.PlayerEnteringVehicleEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerEnteringVehicleEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerEnteringVehicleEventHandler.Remove(value); } public static event PlayerLeaveVehicleDelegate OnPlayerLeaveVehicle { - add => CoreImpl.PlayerLeaveVehicleEventHandler.Add(value); - remove => CoreImpl.PlayerLeaveVehicleEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerLeaveVehicleEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerLeaveVehicleEventHandler.Remove(value); } public static event PlayerClientEventDelegate OnPlayerEvent { - add => CoreImpl.PlayerClientEventEventHandler.Add(value); - remove => CoreImpl.PlayerClientEventEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerClientEventEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerClientEventEventHandler.Remove(value); } public static event PlayerClientCustomEventDelegate OnPlayerCustomEvent { - add => CoreImpl.PlayerClientCustomEventEventHandler.Add(value); - remove => CoreImpl.PlayerClientCustomEventEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerClientCustomEventEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerClientCustomEventEventHandler.Remove(value); } public static event ServerEventEventDelegate OnServerEvent { - add => CoreImpl.ServerEventEventHandler.Add(value); - remove => CoreImpl.ServerEventEventHandler.Remove(value); + add => ((Core)CoreImpl).ServerEventEventHandler.Add(value); + remove => ((Core)CoreImpl).ServerEventEventHandler.Remove(value); } public static event ServerCustomEventEventDelegate OnServerCustomEvent { - add => CoreImpl.ServerCustomEventEventHandler.Add(value); - remove => CoreImpl.ServerCustomEventEventHandler.Remove(value); + add => ((Core)CoreImpl).ServerCustomEventEventHandler.Add(value); + remove => ((Core)CoreImpl).ServerCustomEventEventHandler.Remove(value); } public static event ConsoleCommandDelegate OnConsoleCommand { - add => CoreImpl.ConsoleCommandEventHandler.Add(value); - remove => CoreImpl.ConsoleCommandEventHandler.Remove(value); + add => ((Core)CoreImpl).ConsoleCommandEventHandler.Add(value); + remove => ((Core)CoreImpl).ConsoleCommandEventHandler.Remove(value); } /// @@ -188,8 +188,8 @@ public static event ConsoleCommandDelegate OnConsoleCommand /// Meta data is accessible across different serverside resources. public static event MetaDataChangeDelegate OnMetaDataChange { - add => CoreImpl.MetaDataChangeEventHandler.Add(value); - remove => CoreImpl.MetaDataChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).MetaDataChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).MetaDataChangeEventHandler.Remove(value); } /// @@ -198,206 +198,206 @@ public static event MetaDataChangeDelegate OnMetaDataChange /// Synced meta data is accessible across different serverside resources and to all clients without range limitation. public static event MetaDataChangeDelegate OnSyncedMetaDataChange { - add => CoreImpl.SyncedMetaDataChangeEventHandler.Add(value); - remove => CoreImpl.SyncedMetaDataChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).SyncedMetaDataChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).SyncedMetaDataChangeEventHandler.Remove(value); } public static event ColShapeDelegate OnColShape { - add => CoreImpl.ColShapeEventHandler.Add(value); - remove => CoreImpl.ColShapeEventHandler.Remove(value); + add => ((Core)CoreImpl).ColShapeEventHandler.Add(value); + remove => ((Core)CoreImpl).ColShapeEventHandler.Remove(value); } public static event VehicleDestroyDelegate OnVehicleDestroy { - add => CoreImpl.VehicleDestroyEventHandler.Add(value); - remove => CoreImpl.VehicleDestroyEventHandler.Remove(value); + add => ((Core)CoreImpl).VehicleDestroyEventHandler.Add(value); + remove => ((Core)CoreImpl).VehicleDestroyEventHandler.Remove(value); } public static event FireDelegate OnFire { - add => CoreImpl.FireEventHandler.Add(value); - remove => CoreImpl.FireEventHandler.Remove(value); + add => ((Core)CoreImpl).FireEventHandler.Add(value); + remove => ((Core)CoreImpl).FireEventHandler.Remove(value); } public static event StartProjectileDelegate OnStartProjectile { - add => CoreImpl.StartProjectileEventHandler.Add(value); - remove => CoreImpl.StartProjectileEventHandler.Remove(value); + add => ((Core)CoreImpl).StartProjectileEventHandler.Add(value); + remove => ((Core)CoreImpl).StartProjectileEventHandler.Remove(value); } public static event PlayerWeaponChangeDelegate OnPlayerWeaponChange { - add => CoreImpl.PlayerWeaponChangeEventHandler.Add(value); - remove => CoreImpl.PlayerWeaponChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).PlayerWeaponChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).PlayerWeaponChangeEventHandler.Remove(value); } public static event NetOwnerChangeDelegate OnNetworkOwnerChange { - add => CoreImpl.NetOwnerChangeEventHandler.Add(value); - remove => CoreImpl.NetOwnerChangeEventHandler.Remove(value); + add => ((Core)CoreImpl).NetOwnerChangeEventHandler.Add(value); + remove => ((Core)CoreImpl).NetOwnerChangeEventHandler.Remove(value); } public static event VehicleAttachDelegate OnVehicleAttach { - add => CoreImpl.VehicleAttachEventHandler.Add(value); - remove => CoreImpl.VehicleAttachEventHandler.Remove(value); + add => ((Core)CoreImpl).VehicleAttachEventHandler.Add(value); + remove => ((Core)CoreImpl).VehicleAttachEventHandler.Remove(value); } public static event VehicleDetachDelegate OnVehicleDetach { - add => CoreImpl.VehicleDetachEventHandler.Add(value); - remove => CoreImpl.VehicleDetachEventHandler.Remove(value); + add => ((Core)CoreImpl).VehicleDetachEventHandler.Add(value); + remove => ((Core)CoreImpl).VehicleDetachEventHandler.Remove(value); } public static event VehicleDamageDelegate OnVehicleDamage { - add => CoreImpl.VehicleDamageEventHandler.Add(value); - remove => CoreImpl.VehicleDamageEventHandler.Remove(value); + add => ((Core)CoreImpl).VehicleDamageEventHandler.Add(value); + remove => ((Core)CoreImpl).VehicleDamageEventHandler.Remove(value); } public static event VehicleHornDelegate OnVehicleHorn { - add => CoreImpl.VehicleHornEventHandler.Add(value); - remove => CoreImpl.VehicleHornEventHandler.Remove(value); + add => ((Core)CoreImpl).VehicleHornEventHandler.Add(value); + remove => ((Core)CoreImpl).VehicleHornEventHandler.Remove(value); } public static event ConnectionQueueAddDelegate OnConnectionQueueAdd { - add => CoreImpl.ConnectionQueueAddHandler.Add(value); - remove => CoreImpl.ConnectionQueueAddHandler.Remove(value); + add => ((Core)CoreImpl).ConnectionQueueAddHandler.Add(value); + remove => ((Core)CoreImpl).ConnectionQueueAddHandler.Remove(value); } public static event ConnectionQueueRemoveDelegate OnConnectionQueueRemove { - add => CoreImpl.ConnectionQueueRemoveHandler.Add(value); - remove => CoreImpl.ConnectionQueueRemoveHandler.Remove(value); + add => ((Core)CoreImpl).ConnectionQueueRemoveHandler.Add(value); + remove => ((Core)CoreImpl).ConnectionQueueRemoveHandler.Remove(value); } public static event ServerStartedDelegate OnServerStarted { - add => CoreImpl.ServerStartedHandler.Add(value); - remove => CoreImpl.ServerStartedHandler.Remove(value); + add => ((Core)CoreImpl).ServerStartedHandler.Add(value); + remove => ((Core)CoreImpl).ServerStartedHandler.Remove(value); } public static event PlayerRequestControlDelegate OnPlayerRequestControl { - add => CoreImpl.PlayerRequestControlHandler.Add(value); - remove => CoreImpl.PlayerRequestControlHandler.Remove(value); + add => ((Core)CoreImpl).PlayerRequestControlHandler.Add(value); + remove => ((Core)CoreImpl).PlayerRequestControlHandler.Remove(value); } public static event PlayerChangeAnimationDelegate OnPlayerChangeAnimation { - add => CoreImpl.PlayerChangeAnimationHandler.Add(value); - remove => CoreImpl.PlayerChangeAnimationHandler.Remove(value); + add => ((Core)CoreImpl).PlayerChangeAnimationHandler.Add(value); + remove => ((Core)CoreImpl).PlayerChangeAnimationHandler.Remove(value); } public static event PlayerChangeInteriorDelegate OnPlayerChangeInterior { - add => CoreImpl.PlayerChangeInteriorHandler.Add(value); - remove => CoreImpl.PlayerChangeInteriorHandler.Remove(value); + add => ((Core)CoreImpl).PlayerChangeInteriorHandler.Add(value); + remove => ((Core)CoreImpl).PlayerChangeInteriorHandler.Remove(value); } public static event PlayerDimensionChangeDelegate OnPlayerDimensionChange { - add => CoreImpl.PlayerDimensionChangeHandler.Add(value); - remove => CoreImpl.PlayerDimensionChangeHandler.Remove(value); + add => ((Core)CoreImpl).PlayerDimensionChangeHandler.Add(value); + remove => ((Core)CoreImpl).PlayerDimensionChangeHandler.Remove(value); } public static event VehicleSirenDelegate OnVehicleSiren { - add => CoreImpl.VehicleSirenHandler.Add(value); - remove => CoreImpl.VehicleSirenHandler.Remove(value); + add => ((Core)CoreImpl).VehicleSirenHandler.Add(value); + remove => ((Core)CoreImpl).VehicleSirenHandler.Remove(value); } public static event PlayerSpawnDelegate OnPlayerSpawn { - add => CoreImpl.PlayerSpawnHandler.Add(value); - remove => CoreImpl.PlayerSpawnHandler.Remove(value); + add => ((Core)CoreImpl).PlayerSpawnHandler.Add(value); + remove => ((Core)CoreImpl).PlayerSpawnHandler.Remove(value); } public static event RequestSyncedSceneDelegate OnRequestSyncScene { - add => CoreImpl.RequestSyncedSceneHandler.Add(value); - remove => CoreImpl.RequestSyncedSceneHandler.Remove(value); + add => ((Core)CoreImpl).RequestSyncedSceneHandler.Add(value); + remove => ((Core)CoreImpl).RequestSyncedSceneHandler.Remove(value); } public static event StartSyncedSceneDelegate OnStartSyncedScene { - add => CoreImpl.StartSyncedSceneHandler.Add(value); - remove => CoreImpl.StartSyncedSceneHandler.Remove(value); + add => ((Core)CoreImpl).StartSyncedSceneHandler.Add(value); + remove => ((Core)CoreImpl).StartSyncedSceneHandler.Remove(value); } public static event StopSyncedSceneDelegate OnStopSyncedScene { - add => CoreImpl.StopSyncedSceneHandler.Add(value); - remove => CoreImpl.StopSyncedSceneHandler.Remove(value); + add => ((Core)CoreImpl).StopSyncedSceneHandler.Add(value); + remove => ((Core)CoreImpl).StopSyncedSceneHandler.Remove(value); } public static event UpdateSyncedSceneDelegate OnUpdateSyncedScene { - add => CoreImpl.UpdateSyncedSceneHandler.Add(value); - remove => CoreImpl.UpdateSyncedSceneHandler.Remove(value); + add => ((Core)CoreImpl).UpdateSyncedSceneHandler.Add(value); + remove => ((Core)CoreImpl).UpdateSyncedSceneHandler.Remove(value); } public static event ClientRequestObjectDelegate OnClientRequestObject { - add => CoreImpl.ClientRequestObjectHandler.Add(value); - remove => CoreImpl.ClientRequestObjectHandler.Remove(value); + add => ((Core)CoreImpl).ClientRequestObjectHandler.Add(value); + remove => ((Core)CoreImpl).ClientRequestObjectHandler.Remove(value); } public static event ClientDeleteObjectDelegate OnClientDeleteObject { - add => CoreImpl.ClientDeleteObjectHandler.Add(value); - remove => CoreImpl.ClientDeleteObjectHandler.Remove(value); + add => ((Core)CoreImpl).ClientDeleteObjectHandler.Add(value); + remove => ((Core)CoreImpl).ClientDeleteObjectHandler.Remove(value); } public static event GivePedScriptedTaskDelegate OnGivePedScriptedTask { - add => CoreImpl.GivePedScriptedTaskHandler.Add(value); - remove => CoreImpl.GivePedScriptedTaskHandler.Remove(value); + add => ((Core)CoreImpl).GivePedScriptedTaskHandler.Add(value); + remove => ((Core)CoreImpl).GivePedScriptedTaskHandler.Remove(value); } public static event PedDamageDelegate OnPedDamage { - add => CoreImpl.PedDamageEventHandler.Add(value); - remove => CoreImpl.PedDamageEventHandler.Remove(value); + add => ((Core)CoreImpl).PedDamageEventHandler.Add(value); + remove => ((Core)CoreImpl).PedDamageEventHandler.Remove(value); } public static event PedDeadDelegate OnPedDead { - add => CoreImpl.PedDeadEventHandler.Add(value); - remove => CoreImpl.PedDeadEventHandler.Remove(value); + add => ((Core)CoreImpl).PedDeadEventHandler.Add(value); + remove => ((Core)CoreImpl).PedDeadEventHandler.Remove(value); } public static event PedHealDelegate OnPedHeal { - add => CoreImpl.PedHealEventHandler.Add(value); - remove => CoreImpl.PedHealEventHandler.Remove(value); + add => ((Core)CoreImpl).PedHealEventHandler.Add(value); + remove => ((Core)CoreImpl).PedHealEventHandler.Remove(value); } public static event PlayerStartTalkingDelegate OnPlayerStartTalking { - add => CoreImpl.PlayerStartTalkingHandler.Add(value); - remove => CoreImpl.PlayerStartTalkingHandler.Remove(value); + add => ((Core)CoreImpl).PlayerStartTalkingHandler.Add(value); + remove => ((Core)CoreImpl).PlayerStartTalkingHandler.Remove(value); } public static event PlayerStopTalkingDelegate OnPlayerStopTalking { - add => CoreImpl.PlayerStopTalkingHandler.Add(value); - remove => CoreImpl.PlayerStopTalkingHandler.Remove(value); + add => ((Core)CoreImpl).PlayerStopTalkingHandler.Add(value); + remove => ((Core)CoreImpl).PlayerStopTalkingHandler.Remove(value); } public static event ScriptRpcDelegate OnScriptRPC { - add => CoreImpl.ScriptRpcHandler.Add(value); - remove => CoreImpl.ScriptRpcHandler.Remove(value); + add => ((Core)CoreImpl).ScriptRpcHandler.Add(value); + remove => ((Core)CoreImpl).ScriptRpcHandler.Remove(value); } public static event ScriptRpcAnswerDelegate OnScriptRPCAnswer { - add => CoreImpl.ScriptRpcAnswerHandler.Add(value); - remove => CoreImpl.ScriptRpcAnswerHandler.Remove(value); + add => ((Core)CoreImpl).ScriptRpcAnswerHandler.Add(value); + remove => ((Core)CoreImpl).ScriptRpcAnswerHandler.Remove(value); } } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.Export.cs b/api/AltV.Net/Alt.Export.cs index 3f2a4fff..db5da98c 100644 --- a/api/AltV.Net/Alt.Export.cs +++ b/api/AltV.Net/Alt.Export.cs @@ -12,7 +12,7 @@ public static void Export(string key, object value) public static void Export(string key, bool value) { - Alt.Core.CreateMValueBool(out var mValue, value); + Alt.CoreImpl.CreateMValueBool(out var mValue, value); Resource.SetExport(key, in mValue); HostWrapper.Export(key, value); mValue.Dispose(); @@ -20,7 +20,7 @@ public static void Export(string key, bool value) public static void Export(string key, int value) { - Alt.Core.CreateMValueInt(out var mValue, value); + Alt.CoreImpl.CreateMValueInt(out var mValue, value); Resource.SetExport(key, in mValue); HostWrapper.Export(key, value); mValue.Dispose(); @@ -28,7 +28,7 @@ public static void Export(string key, int value) public static void Export(string key, long value) { - Alt.Core.CreateMValueInt(out var mValue, value); + Alt.CoreImpl.CreateMValueInt(out var mValue, value); Resource.SetExport(key, in mValue); HostWrapper.Export(key, value); mValue.Dispose(); @@ -36,7 +36,7 @@ public static void Export(string key, long value) public static void Export(string key, uint value) { - Alt.Core.CreateMValueUInt(out var mValue, value); + Alt.CoreImpl.CreateMValueUInt(out var mValue, value); Resource.SetExport(key, mValue); HostWrapper.Export(key, value); mValue.Dispose(); @@ -44,7 +44,7 @@ public static void Export(string key, uint value) public static void Export(string key, ulong value) { - Alt.Core.CreateMValueUInt(out var mValue, value); + Alt.CoreImpl.CreateMValueUInt(out var mValue, value); Resource.SetExport(key, mValue); HostWrapper.Export(key, value); mValue.Dispose(); @@ -52,7 +52,7 @@ public static void Export(string key, ulong value) public static void Export(string key, double value) { - Alt.Core.CreateMValueDouble(out var mValue, value); + Alt.CoreImpl.CreateMValueDouble(out var mValue, value); Resource.SetExport(key,mValue); HostWrapper.Export(key, value); mValue.Dispose(); @@ -60,7 +60,7 @@ public static void Export(string key, double value) public static void Export(string key, string value) { - Alt.Core.CreateMValueString(out var mValue, value); + Alt.CoreImpl.CreateMValueString(out var mValue, value); Resource.SetExport(key, mValue); HostWrapper.Export(key, value); mValue.Dispose(); @@ -68,63 +68,63 @@ public static void Export(string key, string value) public static void Export(string key, Delegate value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } @@ -132,7 +132,7 @@ public static void Export(string key, Action(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } @@ -140,162 +140,162 @@ public static void Export(string key, public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } public static void Export(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } @@ -303,7 +303,7 @@ public static void Export value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); HostWrapper.Export(key, value); } } diff --git a/api/AltV.Net/Alt.ExportNative.cs b/api/AltV.Net/Alt.ExportNative.cs index 02b9aaf2..65ea8d24 100644 --- a/api/AltV.Net/Alt.ExportNative.cs +++ b/api/AltV.Net/Alt.ExportNative.cs @@ -11,257 +11,257 @@ public static void ExportNativeNative(string key, object value) public static void ExportNative(string key, bool value) { - Alt.Core.CreateMValueBool(out var mValue, value); + Alt.CoreImpl.CreateMValueBool(out var mValue, value); CoreImpl.Resource.SetExport(key, in mValue); mValue.Dispose(); } public static void ExportNative(string key, int value) { - Alt.Core.CreateMValueInt(out var mValue, value); + Alt.CoreImpl.CreateMValueInt(out var mValue, value); CoreImpl.Resource.SetExport(key, in mValue); mValue.Dispose(); } public static void ExportNative(string key, long value) { - Alt.Core.CreateMValueInt(out var mValue, value); + Alt.CoreImpl.CreateMValueInt(out var mValue, value); CoreImpl.Resource.SetExport(key, in mValue); mValue.Dispose(); } public static void ExportNative(string key, uint value) { - Alt.Core.CreateMValueUInt(out var mValue, value); + Alt.CoreImpl.CreateMValueUInt(out var mValue, value); CoreImpl.Resource.SetExport(key, mValue); mValue.Dispose(); } public static void ExportNative(string key, ulong value) { - Alt.Core.CreateMValueUInt(out var mValue, value); + Alt.CoreImpl.CreateMValueUInt(out var mValue, value); CoreImpl.Resource.SetExport(key, mValue); mValue.Dispose(); } public static void ExportNative(string key, double value) { - Alt.Core.CreateMValueDouble(out var mValue, value); + Alt.CoreImpl.CreateMValueDouble(out var mValue, value); CoreImpl.Resource.SetExport(key,mValue); mValue.Dispose(); } public static void ExportNative(string key, string value) { - Alt.Core.CreateMValueString(out var mValue, value); + Alt.CoreImpl.CreateMValueString(out var mValue, value); CoreImpl.Resource.SetExport(key, mValue); mValue.Dispose(); } public static void ExportNative(string key, Delegate value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Action value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative(string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } public static void ExportNative( string key, Func value) { - CoreImpl.SetExport(key, Function.Create(Core, value)); + CoreImpl.SetExport(key, Function.Create(CoreImpl, value)); } } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.Function.cs b/api/AltV.Net/Alt.Function.cs index e44f2f1d..f5d1ffc5 100644 --- a/api/AltV.Net/Alt.Function.cs +++ b/api/AltV.Net/Alt.Function.cs @@ -7,194 +7,194 @@ public partial class Alt { public static Function CreateFunction(T func) where T : Delegate { - return Function.Create(Core, func); + return Function.Create(CoreImpl, func); } - + public static Function CreateFunction(Action function) { - return Function.Create(Core, function); + return Function.Create(CoreImpl, function); } public static Function CreateFunction(Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Action function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction(Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Func function) { - return Function.Create>(Core, function); + return Function.Create>(CoreImpl, function); } public static Function CreateFunction( Func function) { - return Function.Create>(Core, + return Function.Create>(CoreImpl, function); } } diff --git a/api/AltV.Net/Alt.GetById.cs b/api/AltV.Net/Alt.GetById.cs index d4a16e6c..ac5431e9 100644 --- a/api/AltV.Net/Alt.GetById.cs +++ b/api/AltV.Net/Alt.GetById.cs @@ -4,14 +4,14 @@ namespace AltV.Net; public partial class Alt { - public static IPlayer GetPlayerById(uint id) => Core.GetBaseObject(BaseObjectType.Player, id) as IPlayer; - public static IVehicle GetVehicleById(uint id) => Core.GetBaseObject(BaseObjectType.Vehicle, id) as IVehicle; - public static IPed GetPedById(uint id) => Core.GetBaseObject(BaseObjectType.Ped, id) as IPed; - public static IBlip GetBlipById(uint id) => Core.GetBaseObject(BaseObjectType.Blip, id) as IBlip; - public static IVoiceChannel GetVoiceChannelById(uint id) => Core.GetBaseObject(BaseObjectType.VoiceChannel, id) as IVoiceChannel; - public static IColShape GetColShapeById(uint id) => Core.GetBaseObject(BaseObjectType.ColShape, id) as IColShape; - public static ICheckpoint GetCheckpointById(uint id) => Core.GetBaseObject(BaseObjectType.Checkpoint, id) as ICheckpoint; - public static IVirtualEntity GetVirtualEntityById(uint id) => Core.GetBaseObject(BaseObjectType.VirtualEntity, id) as IVirtualEntity; - public static IVirtualEntityGroup GetVirtualEntityGroupById(uint id) => Core.GetBaseObject(BaseObjectType.VirtualEntityGroup, id) as IVirtualEntityGroup; - public static IMarker GetMarkerById(uint id) => Core.GetBaseObject(BaseObjectType.Marker, id) as IMarker; + public static IPlayer GetPlayerById(uint id) => CoreImpl.GetBaseObject(BaseObjectType.Player, id) as IPlayer; + public static IVehicle GetVehicleById(uint id) => CoreImpl.GetBaseObject(BaseObjectType.Vehicle, id) as IVehicle; + public static IPed GetPedById(uint id) => CoreImpl.GetBaseObject(BaseObjectType.Ped, id) as IPed; + public static IBlip GetBlipById(uint id) => CoreImpl.GetBaseObject(BaseObjectType.Blip, id) as IBlip; + public static IVoiceChannel GetVoiceChannelById(uint id) => CoreImpl.GetBaseObject(BaseObjectType.VoiceChannel, id) as IVoiceChannel; + public static IColShape GetColShapeById(uint id) => CoreImpl.GetBaseObject(BaseObjectType.ColShape, id) as IColShape; + public static ICheckpoint GetCheckpointById(uint id) => CoreImpl.GetBaseObject(BaseObjectType.Checkpoint, id) as ICheckpoint; + public static IVirtualEntity GetVirtualEntityById(uint id) => CoreImpl.GetBaseObject(BaseObjectType.VirtualEntity, id) as IVirtualEntity; + public static IVirtualEntityGroup GetVirtualEntityGroupById(uint id) => CoreImpl.GetBaseObject(BaseObjectType.VirtualEntityGroup, id) as IVirtualEntityGroup; + public static IMarker GetMarkerById(uint id) => CoreImpl.GetBaseObject(BaseObjectType.Marker, id) as IMarker; } \ No newline at end of file diff --git a/api/AltV.Net/Alt.GlobalMeta.cs b/api/AltV.Net/Alt.GlobalMeta.cs index de87c432..517b2bbd 100644 --- a/api/AltV.Net/Alt.GlobalMeta.cs +++ b/api/AltV.Net/Alt.GlobalMeta.cs @@ -7,15 +7,15 @@ namespace AltV.Net { public static partial class Alt { - public static void SetMetaData(string key, object value) => Core.SetMetaData(key, value); + public static void SetMetaData(string key, object value) => CoreImpl.SetMetaData(key, value); - public static bool HasMetaData(string key) => Core.HasMetaData(key); + public static bool HasMetaData(string key) => CoreImpl.HasMetaData(key); - public static void DeleteMetaData(string key) => Core.DeleteMetaData(key); + public static void DeleteMetaData(string key) => CoreImpl.DeleteMetaData(key); public static bool GetMetaData(string key, out T result) { - Core.GetMetaData(key, out var mValue); + CoreImpl.GetMetaData(key, out var mValue); using (mValue) { @@ -32,15 +32,15 @@ public static bool GetMetaData(string key, out T result) } } - public static void SetSyncedMetaData(string key, object value) => Core.SetSyncedMetaData(key, value); + public static void SetSyncedMetaData(string key, object value) => CoreImpl.SetSyncedMetaData(key, value); - public static bool HasSyncedMetaData(string key) => Core.HasSyncedMetaData(key); + public static bool HasSyncedMetaData(string key) => CoreImpl.HasSyncedMetaData(key); - public static void DeleteSyncedMetaData(string key) => Core.DeleteSyncedMetaData(key); + public static void DeleteSyncedMetaData(string key) => CoreImpl.DeleteSyncedMetaData(key); public static bool GetSyncedMetaData(string key, out T result) { - Core.GetSyncedMetaData(key, out var mValue); + CoreImpl.GetSyncedMetaData(key, out var mValue); using (mValue) { diff --git a/api/AltV.Net/Alt.Import.cs b/api/AltV.Net/Alt.Import.cs index 4428ddf9..164d73b3 100644 --- a/api/AltV.Net/Alt.Import.cs +++ b/api/AltV.Net/Alt.Import.cs @@ -162,7 +162,7 @@ public static bool Import(string resourceName, string key, out string value) public static bool Import(string resourceName, string key, out MValueConst mValue) { - var resource = Core.GetResource(resourceName); + var resource = CoreImpl.GetResource(resourceName); if (resource == null) { mValue = default; @@ -196,14 +196,14 @@ public static bool Import(string resourceName, string key, MValueConst.Type type var mValueArgs = new IntPtr[length]; for (uint i = 0; i < length; i++) { - Alt.Core.CreateMValue(out var mValueElement, args[i]); + Alt.CoreImpl.CreateMValue(out var mValueElement, args[i]); mValueArgs[i] = mValueElement.nativePointer; } - result = new MValueConst(Alt.Core.Library.MValue_CallFunction(mValue.nativePointer, mValueArgs, length)); + result = new MValueConst(Alt.CoreImpl.Library.MValue_CallFunction(mValue.nativePointer, mValueArgs, length)); for (ulong i = 0;i < length;i++) { - Alt.Core.Library.MValueConst_Delete(mValueArgs[i]); + Alt.CoreImpl.Library.MValueConst_Delete(mValueArgs[i]); } }*/ @@ -215,16 +215,16 @@ private static object ImportCall(in MValueConst mValue, object[] args) var mValueArgs = new IntPtr[length]; for (uint i = 0; i < length; i++) { - Alt.Core.CreateMValue(out var mValueElement, args[i]); + CoreImpl.CreateMValue(out var mValueElement, args[i]); mValueArgs[i] = mValueElement.nativePointer; } - var result = new MValueConst(Alt.Core, Alt.Core.Library.Shared.MValueConst_CallFunction(Alt.Core.NativePointer, mValue.nativePointer, mValueArgs, length)); + var result = new MValueConst(CoreImpl, CoreImpl.Library.Shared.MValueConst_CallFunction(CoreImpl.NativePointer, mValue.nativePointer, mValueArgs, length)); var resultObj = result.ToObject(); result.Dispose(); for (ulong i = 0;i < length;i++) { - Alt.Core.Library.Shared.MValueConst_Delete(mValueArgs[i]); + CoreImpl.Library.Shared.MValueConst_Delete(mValueArgs[i]); } return resultObj; @@ -239,16 +239,16 @@ private static object ImportCall(in MValueConst mValue, object[] args) var mValueArgs = new IntPtr[length]; for (uint i = 0; i < length; i++) { - Alt.Core.CreateMValue(out var mValueElement, args[i]); + CoreImpl.CreateMValue(out var mValueElement, args[i]); mValueArgs[i] = mValueElement.nativePointer; } - var result = new MValueConst(Alt.Core, Alt.Core.Library.Shared.MValueConst_CallFunction(Alt.Core.NativePointer, mValue.nativePointer, mValueArgs, length)); + var result = new MValueConst(CoreImpl, CoreImpl.Library.Shared.MValueConst_CallFunction(CoreImpl.NativePointer, mValue.nativePointer, mValueArgs, length)); var resultObj = Utils.GetCastedMValue(result); result.Dispose(); for (ulong i = 0;i < length;i++) { - Alt.Core.Library.Shared.MValueConst_Delete(mValueArgs[i]); + CoreImpl.Library.Shared.MValueConst_Delete(mValueArgs[i]); } return resultObj; diff --git a/api/AltV.Net/Alt.Log.Colored.cs b/api/AltV.Net/Alt.Log.Colored.cs index c6189722..9783a8fd 100644 --- a/api/AltV.Net/Alt.Log.Colored.cs +++ b/api/AltV.Net/Alt.Log.Colored.cs @@ -4,6 +4,6 @@ namespace AltV.Net { public static partial class Alt { - public static void LogColored(ColoredMessage message) => Core.LogColored(message.ToString()); + public static void LogColored(ColoredMessage message) => CoreImpl.LogColored(message.ToString()); } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.Log.cs b/api/AltV.Net/Alt.Log.cs index fb9cc245..65373a82 100644 --- a/api/AltV.Net/Alt.Log.cs +++ b/api/AltV.Net/Alt.Log.cs @@ -40,22 +40,22 @@ public static void LogFast(string message) public static void LogInfo(string message) { - Alt.Core.LogInfo(message); + Alt.CoreImpl.LogInfo(message); } public static void LogDebug(string message) { - Alt.Core.LogDebug(message); + Alt.CoreImpl.LogDebug(message); } public static void LogWarning(string message) { - Alt.Core.LogWarning(message); + Alt.CoreImpl.LogWarning(message); } public static void LogError(string message) { - Alt.Core.LogError(message); + Alt.CoreImpl.LogError(message); } } } diff --git a/api/AltV.Net/Alt.MValue.cs b/api/AltV.Net/Alt.MValue.cs index 6254f1f3..a21603d2 100644 --- a/api/AltV.Net/Alt.MValue.cs +++ b/api/AltV.Net/Alt.MValue.cs @@ -1,5 +1,8 @@ using System; +using System.Numerics; +using AltV.Net.Data; using AltV.Net.Elements.Args; +using AltV.Net.Elements.Entities; using AltV.Net.ObjectMethodExecutors; namespace AltV.Net @@ -8,37 +11,118 @@ public static partial class Alt { public static void RegisterMValueAdapter(IMValueAdapter adapter) { - Core.RegisterMValueAdapter(adapter); + CoreImpl.RegisterMValueAdapter(adapter); } public static bool ToMValue(object obj, Type type, out MValueConst mValue) { - return Core.ToMValue(obj, type, out mValue); + return CoreImpl.ToMValue(obj, type, out mValue); } public static bool FromMValue(in MValueConst mValue, Type type, out object obj) { - return Core.FromMValue(mValue, type, out obj); + return CoreImpl.FromMValue(mValue, type, out obj); } public static bool MValueFromObject(object obj, Type type, out object result) { - return Core.MValueFromObject(obj, type, out result); + return CoreImpl.MValueFromObject(obj, type, out result); } public static bool IsMValueConvertible(Type type) { - return Core.IsMValueConvertible(type); + return CoreImpl.IsMValueConvertible(type); } - + public static MValueWriter2 CreateMValueWriter() { - return new MValueWriter2(Core); + return new MValueWriter2(CoreImpl); } - + public static MValueBuffer2 CreateMValueBuffer(MValueConst[] values) { - return new MValueBuffer2(Core, values); + return new MValueBuffer2(CoreImpl, values); + } + + public static void CreateMValueNil(out MValueConst mValue) + { + CoreImpl.CreateMValueNil(out mValue); + } + + public static void CreateMValueBool(out MValueConst mValue, bool value) + { + CoreImpl.CreateMValueBool(out mValue, value); + } + + public static void CreateMValueInt(out MValueConst mValue, long value) + { + CoreImpl.CreateMValueInt(out mValue, value); + } + + public static void CreateMValueUInt(out MValueConst mValue, ulong value) + { + CoreImpl.CreateMValueUInt(out mValue, value); + } + + public static void CreateMValueDouble(out MValueConst mValue, double value) + { + CoreImpl.CreateMValueDouble(out mValue, value); + } + + public static void CreateMValueString(out MValueConst mValue, string value) + { + CoreImpl.CreateMValueString(out mValue, value); + } + + public static void CreateMValueList(out MValueConst mValue, MValueConst[] val, ulong size) + { + CoreImpl.CreateMValueList(out mValue, val, size); + } + + public static void CreateMValueDict(out MValueConst mValue, string[] keys, MValueConst[] val, + ulong size) + { + CoreImpl.CreateMValueDict(out mValue, keys, val, size); + } + + public static void CreateMValueBaseObject(out MValueConst mValue, IBaseObject value) + { + CoreImpl.CreateMValueBaseObject(out mValue, value); + } + + public static void CreateMValueFunction(out MValueConst mValue, IntPtr value) + { + CoreImpl.CreateMValueFunction(out mValue, value); + } + + public static void CreateMValueVector3(out MValueConst mValue, Position value) + { + CoreImpl.CreateMValueVector3(out mValue, value); + } + + public static void CreateMValueVector2(out MValueConst mValue, Vector2 value) + { + CoreImpl.CreateMValueVector2(out mValue, value); + } + + public static void CreateMValueRgba(out MValueConst mValue, Rgba value) + { + CoreImpl.CreateMValueRgba(out mValue, value); + } + + public static void CreateMValueByteArray(out MValueConst mValue, byte[] value) + { + CoreImpl.CreateMValueByteArray(out mValue, value); + } + + public static void CreateMValue(out MValueConst mValue, object obj) + { + CoreImpl.CreateMValue(out mValue, obj); + } + + public static void CreateMValues(MValueConst[] mValues, object[] objects) + { + CoreImpl.CreateMValues(mValues, objects); } } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.Marker.cs b/api/AltV.Net/Alt.Marker.cs index 9e5091dd..f92f3d53 100644 --- a/api/AltV.Net/Alt.Marker.cs +++ b/api/AltV.Net/Alt.Marker.cs @@ -8,8 +8,8 @@ namespace AltV.Net; public partial class Alt { public static IMarker CreateMarker(MarkerType type, Position pos, Rgba color) => - Core.CreateMarker(null, type, pos, color); + CoreImpl.CreateMarker(null, type, pos, color); public static IMarker CreateMarker(IPlayer player, MarkerType type, Position pos, Rgba color) => - Core.CreateMarker(player, type, pos, color); + CoreImpl.CreateMarker(player, type, pos, color); } \ No newline at end of file diff --git a/api/AltV.Net/Alt.Object.cs b/api/AltV.Net/Alt.Object.cs index 1870f373..794b8096 100644 --- a/api/AltV.Net/Alt.Object.cs +++ b/api/AltV.Net/Alt.Object.cs @@ -7,9 +7,9 @@ namespace AltV.Net public partial class Alt { public static IObject CreateObject(uint model, Position position, Rotation rotation, byte alpha = 255, byte textureVariation = 0, ushort lodDistance = 100, uint streamingDistance = 0) => - Core.CreateObject(model, position, rotation, alpha, textureVariation, lodDistance, streamingDistance); + CoreImpl.CreateObject(model, position, rotation, alpha, textureVariation, lodDistance, streamingDistance); public static IObject CreateObject(string model, Position position, Rotation rotation, byte alpha = 255, byte textureVariation = 0, ushort lodDistance = 100, uint streamingDistance = 0) => - Core.CreateObject(Core.Hash(model), position, rotation, alpha, textureVariation, lodDistance, streamingDistance); + CoreImpl.CreateObject(CoreImpl.Hash(model), position, rotation, alpha, textureVariation, lodDistance, streamingDistance); } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.On.cs b/api/AltV.Net/Alt.On.cs index 1e33d551..6a6e0e13 100644 --- a/api/AltV.Net/Alt.On.cs +++ b/api/AltV.Net/Alt.On.cs @@ -7,718 +7,718 @@ namespace AltV.Net public static partial class Alt { public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, - Action action) => CoreImpl.OnServer(eventName, Function.Create(Core, action)); + Action action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, - Action action) => CoreImpl.OnServer(eventName, Function.Create(Core, action)); + Action action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer( string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, - Func action) => CoreImpl.OnServer(eventName, Function.Create(Core, action)); + Func action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, - Func action) => CoreImpl.OnServer(eventName, Function.Create(Core, action)); + Func action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer( string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnServer( string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action)); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Action action) => CoreImpl.OnClient(eventName, Function.Create(Core, action)); + Action action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Action action) => CoreImpl.OnClient(eventName, Function.Create(Core, action)); + Action action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient( string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Func action) => CoreImpl.OnClient(eventName, Function.Create(Core, action)); + Func action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Func action) => CoreImpl.OnClient(eventName, Function.Create(Core, action)); + Func action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient( string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient( string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Action action) => CoreImpl.OnClient(eventName, Function.Create(Core, action)); + Action action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Action action) => CoreImpl.OnClient(eventName, Function.Create(Core, action)); + Action action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Func action) => CoreImpl.OnClient(eventName, Function.Create(Core, action)); + Func action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, - Func action) => CoreImpl.OnClient(eventName, Function.Create(Core, action)); + Func action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnClient( string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action)); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action)); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, - Action action) => CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + Action action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, - Action action) => CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + Action action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer( string eventName, Action action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, - Func action) => CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + Func action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, - Func action) => CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + Func action) => CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer(string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer( string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceServer( string eventName, Func action) => - CoreImpl.OnServer(eventName, Function.Create(Core, action), true); + CoreImpl.OnServer(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, - Action action) => CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + Action action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, - Action action) => CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + Action action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient( string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, - Func action) => CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + Func action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, - Func action) => CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + Func action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient( string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient( string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, - Action action) => CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + Action action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, - Action action) => CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + Action action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Action action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, - Func action) => CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + Func action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, - Func action) => CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + Func action) => CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient(string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); public static Function OnceClient( string eventName, Func action) => - CoreImpl.OnClient(eventName, Function.Create(Core, action), true); + CoreImpl.OnClient(eventName, Function.Create(CoreImpl, action), true); } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.Ped.cs b/api/AltV.Net/Alt.Ped.cs index b6fb1524..6ed24937 100644 --- a/api/AltV.Net/Alt.Ped.cs +++ b/api/AltV.Net/Alt.Ped.cs @@ -7,12 +7,12 @@ namespace AltV.Net public partial class Alt { public static IPed CreatePed(uint model, Position pos, Rotation rot, uint streamingDistance = 0) => - Core.CreatePed(model, pos, rot, streamingDistance); + CoreImpl.CreatePed(model, pos, rot, streamingDistance); public static IPed CreatePed(PedModel model, Position pos, Rotation rot, uint streamingDistance = 0) => - Core.CreatePed((uint)model, pos, rot, streamingDistance); + CoreImpl.CreatePed((uint)model, pos, rot, streamingDistance); public static IPed CreatePed(string model, Position pos, Rotation rot, uint streamingDistance = 0) => - Core.CreatePed(Core.Hash(model), pos, rot, streamingDistance); + CoreImpl.CreatePed(CoreImpl.Hash(model), pos, rot, streamingDistance); } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.RegisterEvents.cs b/api/AltV.Net/Alt.RegisterEvents.cs index 09bf3b04..7d213ed4 100644 --- a/api/AltV.Net/Alt.RegisterEvents.cs +++ b/api/AltV.Net/Alt.RegisterEvents.cs @@ -749,11 +749,11 @@ public static void RegisterEvents(object target) break; case ServerEventAttribute @event: var serverEventName = @event.Name ?? eventMethod.Name; - CoreImpl.OnServer(serverEventName, Function.Create(Core, eventMethodDelegate)); + CoreImpl.OnServer(serverEventName, Function.Create(CoreImpl, eventMethodDelegate)); break; case ClientEventAttribute @event: var clientEventName = @event.Name ?? eventMethod.Name; - CoreImpl.OnClient(clientEventName, Function.Create(Core, eventMethodDelegate)); + CoreImpl.OnClient(clientEventName, Function.Create(CoreImpl, eventMethodDelegate)); break; } }); diff --git a/api/AltV.Net/Alt.Resource.cs b/api/AltV.Net/Alt.Resource.cs index 0de9b8f3..4131ad30 100644 --- a/api/AltV.Net/Alt.Resource.cs +++ b/api/AltV.Net/Alt.Resource.cs @@ -2,15 +2,15 @@ { public partial class Alt { - public static void StartResource(string name) => Core.StartResource(name); + public static void StartResource(string name) => CoreImpl.StartResource(name); - public static void StopResource(string name) => Core.StopResource(name); + public static void StopResource(string name) => CoreImpl.StopResource(name); - public static void RestartResource(string name) => Core.RestartResource(name); + public static void RestartResource(string name) => CoreImpl.RestartResource(name); - public static INativeResource GetResource(string name) => Core.GetResource(name); - public static INativeResource[] GetAllResources() => Core.GetAllResources(); + public static INativeResource GetResource(string name) => CoreImpl.GetResource(name); + public static INativeResource[] GetAllResources() => CoreImpl.GetAllResources(); - public static INativeResource Resource => Core.Resource; + public static INativeResource Resource => CoreImpl.Resource; } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.Vehicle.cs b/api/AltV.Net/Alt.Vehicle.cs index 0b951249..0702cda0 100644 --- a/api/AltV.Net/Alt.Vehicle.cs +++ b/api/AltV.Net/Alt.Vehicle.cs @@ -7,12 +7,12 @@ namespace AltV.Net public partial class Alt { public static IVehicle CreateVehicle(uint model, Position pos, Rotation rotation, uint streamingDistance = 0) => - Core.CreateVehicle(model, pos, rotation, streamingDistance); + CoreImpl.CreateVehicle(model, pos, rotation, streamingDistance); public static IVehicle CreateVehicle(VehicleModel model, Position pos, Rotation rotation, uint streamingDistance = 0) => - Core.CreateVehicle((uint) model, pos, rotation, streamingDistance); + CoreImpl.CreateVehicle((uint) model, pos, rotation, streamingDistance); public static IVehicle CreateVehicle(string model, Position pos, Rotation rotation, uint streamingDistance = 0) => - Core.CreateVehicle(Core.Hash(model), pos, rotation, streamingDistance); + CoreImpl.CreateVehicle(CoreImpl.Hash(model), pos, rotation, streamingDistance); } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.VirtualEntity.cs b/api/AltV.Net/Alt.VirtualEntity.cs index c0f8250e..b8d4f0e1 100644 --- a/api/AltV.Net/Alt.VirtualEntity.cs +++ b/api/AltV.Net/Alt.VirtualEntity.cs @@ -7,9 +7,9 @@ namespace AltV.Net; public partial class Alt { public static IVirtualEntityGroup CreateVirtualEntityGroup(uint maxEntitiesInStream) => - Core.CreateVirtualEntityGroup(maxEntitiesInStream); + CoreImpl.CreateVirtualEntityGroup(maxEntitiesInStream); public static IVirtualEntity CreateVirtualEntity(IVirtualEntityGroup group, Position position, uint streamingDistance, Dictionary dataDict) => - Core.CreateVirtualEntity(group, position, streamingDistance, dataDict); + CoreImpl.CreateVirtualEntity(group, position, streamingDistance, dataDict); } diff --git a/api/AltV.Net/Alt.VoiceChannel.cs b/api/AltV.Net/Alt.VoiceChannel.cs index 0dbdce07..12603cd6 100644 --- a/api/AltV.Net/Alt.VoiceChannel.cs +++ b/api/AltV.Net/Alt.VoiceChannel.cs @@ -6,6 +6,6 @@ namespace AltV.Net public partial class Alt { public static IVoiceChannel CreateVoiceChannel(bool spatial, float maxDistance) => - Core.CreateVoiceChannel(spatial, maxDistance); + CoreImpl.CreateVoiceChannel(spatial, maxDistance); } } \ No newline at end of file diff --git a/api/AltV.Net/Alt.cs b/api/AltV.Net/Alt.cs index 5e4a53d2..17d1ea6e 100644 --- a/api/AltV.Net/Alt.cs +++ b/api/AltV.Net/Alt.cs @@ -17,209 +17,215 @@ namespace AltV.Net { public static partial class Alt { - public static ICore Core => CoreImpl; - internal static Core CoreImpl; + internal static ICore CoreImpl; public static bool CacheEntities { get => AltShared.CacheEntities; set => AltShared.CacheEntities = value; } public static bool ThrowIfEntityDoesNotExist = false; - public static bool IsDebug => Core.IsDebug; + public static bool IsDebug => CoreImpl.IsDebug; - public static void Emit(string eventName, params object[] args) => Core.TriggerLocalEvent(eventName, args); + public static void Emit(string eventName, params object[] args) => CoreImpl.TriggerLocalEvent(eventName, args); public static void EmitAllClients(string eventName, params object[] args) => - Core.TriggerClientEventForAll(eventName, args); + CoreImpl.TriggerClientEventForAll(eventName, args); public static void EmitClients(IPlayer[] clients, string eventName, params object[] args) => - Core.TriggerClientEventForSome(clients, eventName, args); + CoreImpl.TriggerClientEventForSome(clients, eventName, args); public static void EmitEventUnreliableAllClients(string eventName, params object[] args) => - Core.TriggerClientEventUnreliableForAll(eventName, args); + CoreImpl.TriggerClientEventUnreliableForAll(eventName, args); public static void EmitUnreliableClients(IPlayer[] clients, string eventName, params object[] args) => - Core.TriggerClientEventUnreliableForSome(clients, eventName, args); + CoreImpl.TriggerClientEventUnreliableForSome(clients, eventName, args); - public static IEnumerable GetRegisteredClientEvents() => Core.GetRegisteredClientEvents(); - public static IEnumerable GetRegisteredServerEvents() => Core.GetRegisteredServerEvents(); + public static IEnumerable GetRegisteredClientEvents() => CoreImpl.GetRegisteredClientEvents(); + public static IEnumerable GetRegisteredServerEvents() => CoreImpl.GetRegisteredServerEvents(); - public static void Log(string message) => Core.LogInfo(message); + public static void Log(string message) => CoreImpl.LogInfo(message); - public static IReadOnlyCollection GetAllPlayers() => Core.PoolManager.Player.GetAllEntities(); + public static IReadOnlyCollection GetAllPlayers() => CoreImpl.PoolManager.Player.GetAllEntities(); - public static IReadOnlyCollection GetAllVehicles() =>Core.PoolManager.Vehicle.GetAllEntities(); + public static IReadOnlyCollection GetAllVehicles() =>CoreImpl.PoolManager.Vehicle.GetAllEntities(); - public static IReadOnlyCollection GetAllPeds() =>Core.PoolManager.Ped.GetAllEntities(); + public static IReadOnlyCollection GetAllPeds() =>CoreImpl.PoolManager.Ped.GetAllEntities(); - public static IReadOnlyCollection GetAllBlips() =>Core.PoolManager.Blip.GetAllObjects(); + public static IReadOnlyCollection GetAllBlips() =>CoreImpl.PoolManager.Blip.GetAllObjects(); - public static IReadOnlyCollection GetAllNetworkObjects() =>Core.PoolManager.Object.GetAllEntities(); + public static IReadOnlyCollection GetAllNetworkObjects() =>CoreImpl.PoolManager.Object.GetAllEntities(); - public static IReadOnlyCollection GetAllCheckpoints() =>Core.PoolManager.Checkpoint.GetAllObjects(); + public static IReadOnlyCollection GetAllCheckpoints() =>CoreImpl.PoolManager.Checkpoint.GetAllObjects(); - public static IReadOnlyCollection GetAllVoiceChannels() =>Core.PoolManager.VoiceChannel.GetAllObjects(); + public static IReadOnlyCollection GetAllVoiceChannels() =>CoreImpl.PoolManager.VoiceChannel.GetAllObjects(); - public static IReadOnlyCollection GetAllColShapes() =>Core.PoolManager.ColShape.GetAllObjects(); + public static IReadOnlyCollection GetAllColShapes() =>CoreImpl.PoolManager.ColShape.GetAllObjects(); - public static IReadOnlyCollection GetAllMarkers() =>Core.PoolManager.Marker.GetAllObjects(); + public static IReadOnlyCollection GetAllMarkers() =>CoreImpl.PoolManager.Marker.GetAllObjects(); - public static IReadOnlyCollection GetAllConnectionInfos() => Core.PoolManager.ConnectionInfo.GetAllObjects(); + public static IReadOnlyCollection GetAllConnectionInfos() => CoreImpl.PoolManager.ConnectionInfo.GetAllObjects(); - public static IReadOnlyCollection GetAllVirtualEntities() => Core.PoolManager.VirtualEntity.GetAllObjects(); + public static IReadOnlyCollection GetAllVirtualEntities() => CoreImpl.PoolManager.VirtualEntity.GetAllObjects(); - public static IReadOnlyCollection GetAllVirtualEntityGroups() => Core.PoolManager.VirtualEntityGroup.GetAllObjects(); + public static IReadOnlyCollection GetAllVirtualEntityGroups() => CoreImpl.PoolManager.VirtualEntityGroup.GetAllObjects(); - public static KeyValuePair[] GetPlayersArray() => Core.PoolManager.Player.GetEntitiesArray(); + public static KeyValuePair[] GetPlayersArray() => CoreImpl.PoolManager.Player.GetEntitiesArray(); - public static KeyValuePair[] GetVehiclesArray() => Core.PoolManager.Vehicle.GetEntitiesArray(); + public static KeyValuePair[] GetVehiclesArray() => CoreImpl.PoolManager.Vehicle.GetEntitiesArray(); - public static KeyValuePair[] GetPedsArray() => Core.PoolManager.Ped.GetEntitiesArray(); + public static KeyValuePair[] GetPedsArray() => CoreImpl.PoolManager.Ped.GetEntitiesArray(); - public static KeyValuePair[] GetBlipsArray() => Core.PoolManager.Blip.GetObjectsArray(); + public static KeyValuePair[] GetBlipsArray() => CoreImpl.PoolManager.Blip.GetObjectsArray(); - public static KeyValuePair[] GetCheckpointsArray() => Core.PoolManager.Checkpoint.GetObjectsArray(); + public static KeyValuePair[] GetCheckpointsArray() => CoreImpl.PoolManager.Checkpoint.GetObjectsArray(); - public static KeyValuePair[] GetVoiceChannelsArray() => Core.PoolManager.VoiceChannel.GetObjectsArray(); + public static KeyValuePair[] GetVoiceChannelsArray() => CoreImpl.PoolManager.VoiceChannel.GetObjectsArray(); - public static KeyValuePair[] GetColShapesArray() => Core.PoolManager.ColShape.GetObjectsArray(); - public static KeyValuePair[] GetConnectionInfoArray() => Core.PoolManager.ConnectionInfo.GetObjectsArray(); + public static KeyValuePair[] GetColShapesArray() => CoreImpl.PoolManager.ColShape.GetObjectsArray(); + public static KeyValuePair[] GetConnectionInfoArray() => CoreImpl.PoolManager.ConnectionInfo.GetObjectsArray(); public static void ForEachPlayers(IBaseObjectCallback baseObjectCallback) => - Core.PoolManager.Player.ForEach(baseObjectCallback); + CoreImpl.PoolManager.Player.ForEach(baseObjectCallback); public static Task ForEachPlayers(IAsyncBaseObjectCallback baseObjectCallback) => - Core.PoolManager.Player.ForEach(baseObjectCallback); + CoreImpl.PoolManager.Player.ForEach(baseObjectCallback); public static void ForEachVehicles(IBaseObjectCallback baseObjectCallback) => - Core.PoolManager.Vehicle.ForEach(baseObjectCallback); + CoreImpl.PoolManager.Vehicle.ForEach(baseObjectCallback); public static Task ForEachVehicles(IAsyncBaseObjectCallback baseObjectCallback) => - Core.PoolManager.Vehicle.ForEach(baseObjectCallback); + CoreImpl.PoolManager.Vehicle.ForEach(baseObjectCallback); public static void ForEachPeds(IBaseObjectCallback baseObjectCallback) => - Core.PoolManager.Ped.ForEach(baseObjectCallback); + CoreImpl.PoolManager.Ped.ForEach(baseObjectCallback); public static Task ForEachPeds(IAsyncBaseObjectCallback baseObjectCallback) => - Core.PoolManager.Ped.ForEach(baseObjectCallback); + CoreImpl.PoolManager.Ped.ForEach(baseObjectCallback); public static void ForEachBlips(IBaseObjectCallback baseObjectCallback) => - Core.PoolManager.Blip.ForEach(baseObjectCallback); + CoreImpl.PoolManager.Blip.ForEach(baseObjectCallback); public static Task ForEachBlips(IAsyncBaseObjectCallback baseObjectCallback) => - Core.PoolManager.Blip.ForEach(baseObjectCallback); + CoreImpl.PoolManager.Blip.ForEach(baseObjectCallback); public static void ForEachCheckpoints(IBaseObjectCallback baseObjectCallback) => - Core.PoolManager.Checkpoint.ForEach(baseObjectCallback); + CoreImpl.PoolManager.Checkpoint.ForEach(baseObjectCallback); public static Task ForEachCheckpoints(IAsyncBaseObjectCallback baseObjectCallback) => - Core.PoolManager.Checkpoint.ForEach(baseObjectCallback); + CoreImpl.PoolManager.Checkpoint.ForEach(baseObjectCallback); public static void ForEachVoiceChannels(IBaseObjectCallback baseObjectCallback) => - Core.PoolManager.VoiceChannel.ForEach(baseObjectCallback); + CoreImpl.PoolManager.VoiceChannel.ForEach(baseObjectCallback); public static Task ForEachVoiceChannels(IAsyncBaseObjectCallback baseObjectCallback) => - Core.PoolManager.VoiceChannel.ForEach(baseObjectCallback); + CoreImpl.PoolManager.VoiceChannel.ForEach(baseObjectCallback); public static void ForEachColShapes(IBaseObjectCallback baseObjectCallback) => - Core.PoolManager.ColShape.ForEach(baseObjectCallback); + CoreImpl.PoolManager.ColShape.ForEach(baseObjectCallback); public static Task ForEachColShapes(IAsyncBaseObjectCallback baseObjectCallback) => - Core.PoolManager.ColShape.ForEach(baseObjectCallback); + CoreImpl.PoolManager.ColShape.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 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) => Core.Hash(stringToHash); - public static ulong HashPassword(string password) => Core.HashPassword(password); + public static uint Hash(string stringToHash) => CoreImpl.Hash(stringToHash); + public static ulong HashPassword(string password) => CoreImpl.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 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() => Core.GetServerConfig(); - public static IBaseObject GetBaseObjectById(BaseObjectType type, uint id) => Core.GetBaseObjectById(type, id); + 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 dataDict = default) => Core.RegisterMetric(name, type, dataDict); - public static void UnregisterMetric(IMetric metric) => Core.UnregisterMetric(metric); - public static IReadOnlyCollection GetAllMetrics() => Core.GetAllMetrics(); - public static VoiceConnectionState GetVoiceConnectionState() => Core.GetVoiceConnectionState(); + public static IMetric RegisterMetric(string name, MetricType type = MetricType.MetricTypeGauge, Dictionary dataDict = default) => CoreImpl.RegisterMetric(name, type, dataDict); + public static void UnregisterMetric(IMetric metric) => CoreImpl.UnregisterMetric(metric); + public static IReadOnlyCollection GetAllMetrics() => CoreImpl.GetAllMetrics(); + public static VoiceConnectionState GetVoiceConnectionState() => CoreImpl.GetVoiceConnectionState(); - public static void SetWorldProfiler(bool state) => Core.SetWorldProfiler(state); + 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) => - Core.GetClosestEntities(position, range, dimension, limit, allowedTypes, order); + CoreImpl.GetClosestEntities(position, range, dimension, limit, allowedTypes, order); - public static IBaseObject[] GetEntitiesInDimension(int dimension, EntityType allowedTypes) => Core.GetEntitiesInDimension(dimension, allowedTypes); + public static IBaseObject[] GetEntitiesInDimension(int dimension, EntityType allowedTypes) => CoreImpl.GetEntitiesInDimension(dimension, allowedTypes); - public static IBaseObject[] GetEntitiesInRange(Position position, int range, int dimension, EntityType allowedTypes) => Core.GetEntitiesInRange(position, range, dimension, allowedTypes); + public static IBaseObject[] GetEntitiesInRange(Position position, int range, int dimension, EntityType allowedTypes) => CoreImpl.GetEntitiesInRange(position, range, dimension, allowedTypes); - public static int NetTime => Core.NetTime; + public static int NetTime => CoreImpl.NetTime; - public static void AddClientConfigKey(string key) => Core.AddClientConfigKey(key); + public static void AddClientConfigKey(string key) => CoreImpl.AddClientConfigKey(key); public static ushort MaxStreamingPeds { - get => Core.MaxStreamingPeds; - set => Core.MaxStreamingPeds = value; + get => CoreImpl.MaxStreamingPeds; + set => CoreImpl.MaxStreamingPeds = value; } public static ushort MaxStreamingObjects { - get => Core.MaxStreamingObjects; - set => Core.MaxStreamingObjects = value; + get => CoreImpl.MaxStreamingObjects; + set => CoreImpl.MaxStreamingObjects = value; } public static ushort MaxStreamingVehicles { - get => Core.MaxStreamingVehicles; - set => Core.MaxStreamingVehicles = value; + get => CoreImpl.MaxStreamingVehicles; + set => CoreImpl.MaxStreamingVehicles = value; } public static byte StreamerThreadCount { - get => Core.StreamerThreadCount; - set => Core.StreamerThreadCount = value; + get => CoreImpl.StreamerThreadCount; + set => CoreImpl.StreamerThreadCount = value; } public static uint StreamingTickRate { - get => Core.StreamingTickRate; - set => Core.StreamingTickRate = value; + get => CoreImpl.StreamingTickRate; + set => CoreImpl.StreamingTickRate = value; } public static uint StreamingDistance { - get => Core.StreamingDistance; - set => Core.StreamingDistance = value; + get => CoreImpl.StreamingDistance; + set => CoreImpl.StreamingDistance = value; } public static uint ColShapeTickRate { - get => Core.ColShapeTickRate; - set => Core.ColShapeTickRate = value; + get => CoreImpl.ColShapeTickRate; + set => CoreImpl.ColShapeTickRate = value; } public static uint MigrationDistance { - get => Core.MigrationDistance; - set => Core.MigrationDistance = value; + get => CoreImpl.MigrationDistance; + set => CoreImpl.MigrationDistance = value; } public static byte MigrationThreadCount { - get => Core.MigrationThreadCount; - set => Core.MigrationThreadCount = value; + get => CoreImpl.MigrationThreadCount; + set => CoreImpl.MigrationThreadCount = value; } public static uint MigrationTickRate { - get => Core.MigrationTickRate; - set => Core.MigrationTickRate = value; + get => CoreImpl.MigrationTickRate; + set => CoreImpl.MigrationTickRate = value; } public static byte SyncReceiveThreadCount { - get => Core.SyncReceiveThreadCount; - set => Core.SyncReceiveThreadCount = value; + get => CoreImpl.SyncReceiveThreadCount; + set => CoreImpl.SyncReceiveThreadCount = value; } public static byte SyncSendThreadCount { - get => Core.SyncSendThreadCount; - set => Core.SyncSendThreadCount = value; + get => CoreImpl.SyncSendThreadCount; + set => CoreImpl.SyncSendThreadCount = value; } - public static bool HasBenefit(Benefit benefit) => Core.HasBenefit(benefit); + 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); } } \ No newline at end of file diff --git a/api/AltV.Net/Core.Events.cs b/api/AltV.Net/Core.Events.cs index c36bd325..bce46bd8 100644 --- a/api/AltV.Net/Core.Events.cs +++ b/api/AltV.Net/Core.Events.cs @@ -516,7 +516,7 @@ public virtual void OnExplosionEvent(IntPtr eventPointer, IPlayer sourcePlayer, { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPointer); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPointer); } } } @@ -574,7 +574,7 @@ public virtual void OnWeaponDamageEvent(IntPtr eventPointer, IPlayer sourcePlaye { unsafe { - Alt.Core.Library.Server.Event_WeaponDamageEvent_SetDamageValue(eventPointer, weaponDamage.Value); + Alt.CoreImpl.Library.Server.Event_WeaponDamageEvent_SetDamageValue(eventPointer, weaponDamage.Value); } } @@ -582,7 +582,7 @@ public virtual void OnWeaponDamageEvent(IntPtr eventPointer, IPlayer sourcePlaye { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPointer); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPointer); } } } @@ -1041,7 +1041,7 @@ public virtual void OnFireEvent(IntPtr eventPointer, IPlayer player, FireInfo[] { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPointer); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPointer); } } } @@ -1087,7 +1087,7 @@ public virtual void OnStartProjectileEvent(IntPtr eventPointer, IPlayer player, { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPointer); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPointer); } } } @@ -1330,7 +1330,7 @@ public virtual void OnVehicleHornEvent(IntPtr eventPointer, IVehicle targetVehic { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPointer); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPointer); } } } @@ -1466,7 +1466,7 @@ public virtual void OnPlayerRequestControlEvent(IntPtr eventPtr, IEntity target, { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPtr); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPtr); } } } @@ -2244,7 +2244,7 @@ public virtual void OnRequestSyncedSceneEvent(IntPtr eventPointer, IPlayer sourc { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPointer); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPointer); } } } @@ -2395,7 +2395,7 @@ public virtual void OnClientRequestObjectEvent(IntPtr eventPointer, IPlayer sour { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPointer); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPointer); } } } @@ -2439,7 +2439,7 @@ public virtual void OnClientDeleteObjectEvent(IntPtr eventPointer, IPlayer sourc { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPointer); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPointer); } } } @@ -2491,7 +2491,7 @@ public virtual void OnGivePedScriptedTaskEvent(IntPtr eventPointer, IPlayer sour { unsafe { - Alt.Core.Library.Shared.Event_Cancel(eventPointer); + Alt.CoreImpl.Library.Shared.Event_Cancel(eventPointer); } } } diff --git a/api/AltV.Net/Core.cs b/api/AltV.Net/Core.cs index 9489be0c..8584ffa6 100644 --- a/api/AltV.Net/Core.cs +++ b/api/AltV.Net/Core.cs @@ -1114,7 +1114,7 @@ public void SetExport(string key, Function function) private readonly WeakReference assemblyLoadContext; - internal IEnumerable Assemblies => !assemblyLoadContext.TryGetTarget(out var target) + public IEnumerable Assemblies => !assemblyLoadContext.TryGetTarget(out var target) ? new List() : target.Assemblies; @@ -1409,7 +1409,7 @@ public IVirtualEntity CreateVirtualEntity(IVirtualEntityGroup group, Position po for (var i = 0; i < dataDict.Count; i++) { var stringPtr = MemoryUtils.StringToHGlobalUtf8(dataDict.ElementAt(i).Key); - Alt.Core.CreateMValue(out var mValue, dataDict.ElementAt(i).Value); + Alt.CoreImpl.CreateMValue(out var mValue, dataDict.ElementAt(i).Value); keys[i] = stringPtr; values[i] = mValue.nativePointer; data.Add(stringPtr, mValue); diff --git a/api/AltV.Net/Elements/Args/MValueAdapters.cs b/api/AltV.Net/Elements/Args/MValueAdapters.cs index 62b8d63b..f003664e 100644 --- a/api/AltV.Net/Elements/Args/MValueAdapters.cs +++ b/api/AltV.Net/Elements/Args/MValueAdapters.cs @@ -9,35 +9,35 @@ public static class MValueAdapters public static void Register(IMValueAdapter adapter) { Alt.LogWarning("MValueAdapters.Register is deprecated, use Alt.RegisterMValueAdapter instead"); - Alt.Core.RegisterMValueAdapter(adapter); + Alt.CoreImpl.RegisterMValueAdapter(adapter); } [Obsolete("Use Alt.ToMValue instead")] public static bool ToMValue(object obj, Type type, out MValueConst mValue) { Alt.LogWarning("MValueAdapters.ToMValue is deprecated, use Alt.ToMValue instead"); - return Alt.Core.ToMValue(obj, type, out mValue); + return Alt.CoreImpl.ToMValue(obj, type, out mValue); } [Obsolete("Use Alt.FromMValue instead")] public static bool FromMValue(in MValueConst mValue, Type type, out object obj) { Alt.LogWarning("MValueAdapters.FromMValue is deprecated, use Alt.FromMValue instead"); - return Alt.Core.FromMValue(mValue, type, out obj); + return Alt.CoreImpl.FromMValue(mValue, type, out obj); } [Obsolete("Use Alt.MValueFromObject instead")] public static bool FromObject(object obj, Type type, out object result) { Alt.LogWarning("MValueAdapters.FromObject is deprecated, use Alt.MValueFromObject instead"); - return Alt.Core.MValueFromObject(obj, type, out result); + return Alt.CoreImpl.MValueFromObject(obj, type, out result); } [Obsolete("Use Alt.IsMValueConvertible instead")] public static bool IsConvertible(Type type) { Alt.LogWarning("MValueAdapters.IsConvertible is deprecated, use Alt.IsMValueConvertible instead"); - return Alt.Core.IsMValueConvertible(type); + return Alt.CoreImpl.IsMValueConvertible(type); } } } \ No newline at end of file diff --git a/api/AltV.Net/Elements/Entities/BaseObject.cs b/api/AltV.Net/Elements/Entities/BaseObject.cs index 8f5caf1b..3dcf811d 100644 --- a/api/AltV.Net/Elements/Entities/BaseObject.cs +++ b/api/AltV.Net/Elements/Entities/BaseObject.cs @@ -61,7 +61,7 @@ public override void CheckIfCallIsValid() public void SetSyncedMetaData(string key, object value) { CheckIfEntityExists(); - Alt.Core.CreateMValue(out var mValue, value); + Core.CreateMValue(out var mValue, value); SetSyncedMetaData(key, in mValue); mValue.Dispose(); } diff --git a/api/AltV.Net/Elements/Entities/Blip.cs b/api/AltV.Net/Elements/Entities/Blip.cs index 19245f41..31ee245c 100644 --- a/api/AltV.Net/Elements/Entities/Blip.cs +++ b/api/AltV.Net/Elements/Entities/Blip.cs @@ -49,7 +49,7 @@ public static uint GetId(IntPtr pedPointer) { unsafe { - return Alt.Core.Library.Shared.Blip_GetID(pedPointer); + return Alt.CoreImpl.Library.Shared.Blip_GetID(pedPointer); } } @@ -103,7 +103,7 @@ public IEntity AttachedTo var entityType = BaseObjectType.Undefined; var entityPointer = Core.Library.Shared.Blip_AttachedTo(BlipNativePointer, &entityType); if (entityPointer == IntPtr.Zero) return null; - return (IEntity)Alt.Core.PoolManager.Blip.Get(entityPointer); + return (IEntity)Core.PoolManager.Blip.Get(entityPointer); } } } diff --git a/api/AltV.Net/Elements/Entities/Checkpoint.cs b/api/AltV.Net/Elements/Entities/Checkpoint.cs index 6a3eb4fa..63e5e6b4 100644 --- a/api/AltV.Net/Elements/Entities/Checkpoint.cs +++ b/api/AltV.Net/Elements/Entities/Checkpoint.cs @@ -27,7 +27,7 @@ public static uint GetId(IntPtr pedPointer) { unsafe { - return Alt.Core.Library.Shared.Checkpoint_GetID(pedPointer); + return Alt.CoreImpl.Library.Shared.Checkpoint_GetID(pedPointer); } } @@ -225,7 +225,7 @@ public void DeleteStreamSyncedMetaData(string key) public void SetStreamSyncedMetaData(string key, object value) { CheckIfEntityExists(); - Alt.Core.CreateMValue(out var mValue, value); + Core.CreateMValue(out var mValue, value); SetStreamSyncedMetaData(key, in mValue); mValue.Dispose(); } diff --git a/api/AltV.Net/Elements/Entities/ColShape.cs b/api/AltV.Net/Elements/Entities/ColShape.cs index 83fb4383..4ba96743 100644 --- a/api/AltV.Net/Elements/Entities/ColShape.cs +++ b/api/AltV.Net/Elements/Entities/ColShape.cs @@ -21,7 +21,7 @@ public static uint GetId(IntPtr pedPointer) { unsafe { - return Alt.Core.Library.Shared.ColShape_GetID(pedPointer); + return Alt.CoreImpl.Library.Shared.ColShape_GetID(pedPointer); } } diff --git a/api/AltV.Net/Elements/Entities/ConnectionInfo.cs b/api/AltV.Net/Elements/Entities/ConnectionInfo.cs index 701ceb89..caffd25c 100644 --- a/api/AltV.Net/Elements/Entities/ConnectionInfo.cs +++ b/api/AltV.Net/Elements/Entities/ConnectionInfo.cs @@ -27,7 +27,7 @@ public static uint GetId(IntPtr pointer) { unsafe { - return Alt.Core.Library.Server.ConnectionInfo_GetID(pointer); + return Alt.CoreImpl.Library.Server.ConnectionInfo_GetID(pointer); } } diff --git a/api/AltV.Net/Elements/Entities/Entity.cs b/api/AltV.Net/Elements/Entities/Entity.cs index 50e91179..6a104ef6 100644 --- a/api/AltV.Net/Elements/Entities/Entity.cs +++ b/api/AltV.Net/Elements/Entities/Entity.cs @@ -33,7 +33,7 @@ public IPlayer NetworkOwner { var entityPointer = Core.Library.Shared.Entity_GetNetOwner(EntityNativePointer); if (entityPointer == IntPtr.Zero) return null; - return Alt.Core.PoolManager.Player.Get(entityPointer); + return Core.PoolManager.Player.Get(entityPointer); } } } @@ -192,7 +192,7 @@ public void DeleteStreamSyncedMetaData(string key) public void SetStreamSyncedMetaData(string key, object value) { CheckIfEntityExists(); - Alt.Core.CreateMValue(out var mValue, value); + Core.CreateMValue(out var mValue, value); SetStreamSyncedMetaData(key, in mValue); mValue.Dispose(); } diff --git a/api/AltV.Net/Elements/Entities/Marker.cs b/api/AltV.Net/Elements/Entities/Marker.cs index bf1f2e9b..a0e8098d 100644 --- a/api/AltV.Net/Elements/Entities/Marker.cs +++ b/api/AltV.Net/Elements/Entities/Marker.cs @@ -23,7 +23,7 @@ public static uint GetId(IntPtr nativePointer) { unsafe { - return Alt.Core.Library.Shared.Marker_GetID(nativePointer); + return Alt.CoreImpl.Library.Shared.Marker_GetID(nativePointer); } } diff --git a/api/AltV.Net/Elements/Entities/Object.cs b/api/AltV.Net/Elements/Entities/Object.cs index c04ed15a..b186b06c 100644 --- a/api/AltV.Net/Elements/Entities/Object.cs +++ b/api/AltV.Net/Elements/Entities/Object.cs @@ -20,7 +20,7 @@ public static uint GetId(IntPtr pointer) { unsafe { - return Alt.Core.Library.Shared.Object_GetID(pointer); + return Alt.CoreImpl.Library.Shared.Object_GetID(pointer); } } diff --git a/api/AltV.Net/Elements/Entities/Ped.cs b/api/AltV.Net/Elements/Entities/Ped.cs index 4eb3b837..9becabde 100644 --- a/api/AltV.Net/Elements/Entities/Ped.cs +++ b/api/AltV.Net/Elements/Entities/Ped.cs @@ -21,7 +21,7 @@ public static uint GetId(IntPtr pedPointer) { unsafe { - return Alt.Core.Library.Shared.Ped_GetID(pedPointer); + return Alt.CoreImpl.Library.Shared.Ped_GetID(pedPointer); } } diff --git a/api/AltV.Net/Elements/Entities/Player.cs b/api/AltV.Net/Elements/Entities/Player.cs index b1478546..ba8fd745 100644 --- a/api/AltV.Net/Elements/Entities/Player.cs +++ b/api/AltV.Net/Elements/Entities/Player.cs @@ -26,7 +26,7 @@ public static uint GetId(IntPtr playerPointer) { unsafe { - return Alt.Core.Library.Shared.Player_GetID(playerPointer); + return Alt.CoreImpl.Library.Shared.Player_GetID(playerPointer); } } @@ -109,7 +109,7 @@ public void GetLocalMetaData(string key, out MValueConst value) public void SetLocalMetaData(string key, object value) { - Alt.Core.CreateMValue(out var mValue, value); + Core.CreateMValue(out var mValue, value); SetLocalMetaData(key, in mValue); mValue.Dispose(); } @@ -859,7 +859,7 @@ public IVehicle Vehicle CheckIfEntityExistsOrCached(); var entityPointer = Core.Library.Shared.Player_GetVehicle(PlayerNativePointer); if (entityPointer == IntPtr.Zero) return null; - return Alt.Core.PoolManager.Vehicle.Get(entityPointer); + return Core.PoolManager.Vehicle.Get(entityPointer); } } } @@ -1003,7 +1003,7 @@ public void Spawn(Position position, uint delayMs) Core.Library.Server.Player_Spawn(PlayerNativePointer, position, delayMs); } } - + public void Spawn(uint model, Position position, uint delayMs = 0) { unsafe @@ -1013,7 +1013,7 @@ public void Spawn(uint model, Position position, uint delayMs = 0) Core.Library.Server.Player_Spawn(PlayerNativePointer, position, delayMs); } } - + public void Spawn(PedModel model, Position position, uint delayMs = 0) { unsafe @@ -1254,13 +1254,13 @@ public void Kick(string reason) public void Emit(string eventName, params object[] args) { CheckIfEntityExists(); - Alt.Core.TriggerClientEvent(this, eventName, args); + Core.TriggerClientEvent(this, eventName, args); } public ushort EmitRPC(string name, params object[] args) { CheckIfEntityExists(); - return Alt.Core.TriggerClientRPC(this, name, args); + return Core.TriggerClientRPC(this, name, args); } public void EmitRPCAnswer(ushort answerId, object answer, string error) @@ -1272,7 +1272,7 @@ public void EmitRPCAnswer(ushort answerId, object answer, string error) public void EmitUnreliable(string eventName, params object[] args) { CheckIfEntityExists(); - Alt.Core.TriggerClientEventUnreliable(this, eventName, args); + Core.TriggerClientEventUnreliable(this, eventName, args); } public void ClearBloodDamage() diff --git a/api/AltV.Net/Elements/Entities/Vehicle.cs b/api/AltV.Net/Elements/Entities/Vehicle.cs index 20a77c60..0b7f2d73 100644 --- a/api/AltV.Net/Elements/Entities/Vehicle.cs +++ b/api/AltV.Net/Elements/Entities/Vehicle.cs @@ -27,7 +27,7 @@ public static uint GetId(IntPtr vehiclePointer) { unsafe { - return Alt.Core.Library.Shared.Vehicle_GetID(vehiclePointer); + return Alt.CoreImpl.Library.Shared.Vehicle_GetID(vehiclePointer); } } @@ -1360,7 +1360,7 @@ public IVehicle Attached CheckIfEntityExistsOrCached(); var entityPointer = Core.Library.Server.Vehicle_GetAttached(VehicleNativePointer); if (entityPointer == IntPtr.Zero) return null; - return Alt.Core.PoolManager.Vehicle.Get(entityPointer); + return Core.PoolManager.Vehicle.Get(entityPointer); } } } @@ -1374,7 +1374,7 @@ public IVehicle AttachedTo CheckIfEntityExistsOrCached(); var entityPointer = Core.Library.Server.Vehicle_GetAttachedTo(VehicleNativePointer); if (entityPointer == IntPtr.Zero) return null; - return Alt.Core.PoolManager.Vehicle.Get(entityPointer); + return Core.PoolManager.Vehicle.Get(entityPointer); } } } @@ -1608,7 +1608,7 @@ public IVehicle TrainEngine CheckIfEntityExistsOrCached(); var entityPointer = Core.Library.Server.Vehicle_GetTrainEngineId(VehicleNativePointer); if (entityPointer == IntPtr.Zero) return null; - return Alt.Core.PoolManager.Vehicle.Get(entityPointer); + return Core.PoolManager.Vehicle.Get(entityPointer); } } set @@ -1830,7 +1830,7 @@ public IVehicle TrainLinkedToBackward CheckIfEntityExistsOrCached(); var entityPointer = Core.Library.Server.Vehicle_GetTrainLinkedToBackwardId(VehicleNativePointer); if (entityPointer == IntPtr.Zero) return null; - return Alt.Core.PoolManager.Vehicle.Get(entityPointer); + return Core.PoolManager.Vehicle.Get(entityPointer); } } set @@ -1852,7 +1852,7 @@ public IVehicle TrainLinkedToForward CheckIfEntityExistsOrCached(); var entityPointer = Core.Library.Server.Vehicle_GetTrainLinkedToForwardId(VehicleNativePointer); if (entityPointer == IntPtr.Zero) return null; - return Alt.Core.PoolManager.Vehicle.Get(entityPointer); + return Core.PoolManager.Vehicle.Get(entityPointer); } } set diff --git a/api/AltV.Net/Elements/Entities/VirtualEntity.cs b/api/AltV.Net/Elements/Entities/VirtualEntity.cs index 5756f71f..2a6a55dd 100644 --- a/api/AltV.Net/Elements/Entities/VirtualEntity.cs +++ b/api/AltV.Net/Elements/Entities/VirtualEntity.cs @@ -27,7 +27,7 @@ public static uint GetId(IntPtr pedPointer) { unsafe { - return Alt.Core.Library.Shared.VirtualEntity_GetID(pedPointer); + return Alt.CoreImpl.Library.Shared.VirtualEntity_GetID(pedPointer); } } @@ -128,7 +128,7 @@ public bool Visible public void SetStreamSyncedMetaData(string key, object value) { CheckIfEntityExists(); - Alt.Core.CreateMValue(out var mValue, value); + Core.CreateMValue(out var mValue, value); SetStreamSyncedMetaData(key, in mValue); mValue.Dispose(); } diff --git a/api/AltV.Net/Elements/Entities/VirtualEntityGroup.cs b/api/AltV.Net/Elements/Entities/VirtualEntityGroup.cs index b9fddda6..5e489e8c 100644 --- a/api/AltV.Net/Elements/Entities/VirtualEntityGroup.cs +++ b/api/AltV.Net/Elements/Entities/VirtualEntityGroup.cs @@ -19,7 +19,7 @@ public static uint GetId(IntPtr pedPointer) { unsafe { - return Alt.Core.Library.Shared.VirtualEntityGroup_GetID(pedPointer); + return Alt.CoreImpl.Library.Shared.VirtualEntityGroup_GetID(pedPointer); } } diff --git a/api/AltV.Net/Elements/Entities/VoiceChannel.cs b/api/AltV.Net/Elements/Entities/VoiceChannel.cs index d0950811..c7215220 100644 --- a/api/AltV.Net/Elements/Entities/VoiceChannel.cs +++ b/api/AltV.Net/Elements/Entities/VoiceChannel.cs @@ -24,7 +24,7 @@ public static uint GetId(IntPtr pedPointer) { unsafe { - return Alt.Core.Library.Shared.VoiceChannel_GetID(pedPointer); + return Alt.CoreImpl.Library.Shared.VoiceChannel_GetID(pedPointer); } } diff --git a/api/AltV.Net/Elements/MValueBufferExtensions.cs b/api/AltV.Net/Elements/MValueBufferExtensions.cs index 4c32e99a..edfaecdf 100644 --- a/api/AltV.Net/Elements/MValueBufferExtensions.cs +++ b/api/AltV.Net/Elements/MValueBufferExtensions.cs @@ -6,7 +6,7 @@ public static class MValueBufferExtensions { public static MValueBuffer2 Reader(this MValueConst[] array) { - return new MValueBuffer2(Alt.Core, array); // todo remove Alt.Core + return new MValueBuffer2(Alt.CoreImpl, array); // todo remove Alt.Core } } } \ No newline at end of file diff --git a/api/AltV.Net/Elements/Pools/BlipPool.cs b/api/AltV.Net/Elements/Pools/BlipPool.cs index ac6c518d..7d256ca7 100644 --- a/api/AltV.Net/Elements/Pools/BlipPool.cs +++ b/api/AltV.Net/Elements/Pools/BlipPool.cs @@ -13,7 +13,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Blip_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Blip_GetID(entityPointer); } } } diff --git a/api/AltV.Net/Elements/Pools/CheckpointPool.cs b/api/AltV.Net/Elements/Pools/CheckpointPool.cs index e3e96bad..e520e986 100644 --- a/api/AltV.Net/Elements/Pools/CheckpointPool.cs +++ b/api/AltV.Net/Elements/Pools/CheckpointPool.cs @@ -13,7 +13,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Checkpoint_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Checkpoint_GetID(entityPointer); } } } diff --git a/api/AltV.Net/Elements/Pools/ColShapePool.cs b/api/AltV.Net/Elements/Pools/ColShapePool.cs index 5ce4abd2..481d4d97 100644 --- a/api/AltV.Net/Elements/Pools/ColShapePool.cs +++ b/api/AltV.Net/Elements/Pools/ColShapePool.cs @@ -13,7 +13,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.ColShape_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.ColShape_GetID(entityPointer); } } } diff --git a/api/AltV.Net/Elements/Pools/ConnectionInfoPool.cs b/api/AltV.Net/Elements/Pools/ConnectionInfoPool.cs index 45741a93..d35f9ba9 100644 --- a/api/AltV.Net/Elements/Pools/ConnectionInfoPool.cs +++ b/api/AltV.Net/Elements/Pools/ConnectionInfoPool.cs @@ -13,7 +13,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Server.ConnectionInfo_GetID(entityPointer); + return Alt.CoreImpl.Library.Server.ConnectionInfo_GetID(entityPointer); } } } \ No newline at end of file diff --git a/api/AltV.Net/Elements/Pools/MarkerPool.cs b/api/AltV.Net/Elements/Pools/MarkerPool.cs index 1067487c..4083694c 100644 --- a/api/AltV.Net/Elements/Pools/MarkerPool.cs +++ b/api/AltV.Net/Elements/Pools/MarkerPool.cs @@ -13,7 +13,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Marker_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Marker_GetID(entityPointer); } } } diff --git a/api/AltV.Net/Elements/Pools/ObjectPool.cs b/api/AltV.Net/Elements/Pools/ObjectPool.cs index 9289bc4b..9f7b7c4d 100644 --- a/api/AltV.Net/Elements/Pools/ObjectPool.cs +++ b/api/AltV.Net/Elements/Pools/ObjectPool.cs @@ -14,7 +14,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Object_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Object_GetID(entityPointer); } } } diff --git a/api/AltV.Net/Elements/Pools/PedPool.cs b/api/AltV.Net/Elements/Pools/PedPool.cs index 58873673..6d9880c1 100644 --- a/api/AltV.Net/Elements/Pools/PedPool.cs +++ b/api/AltV.Net/Elements/Pools/PedPool.cs @@ -13,7 +13,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Ped_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Ped_GetID(entityPointer); } } } \ No newline at end of file diff --git a/api/AltV.Net/Elements/Pools/PlayerPool.cs b/api/AltV.Net/Elements/Pools/PlayerPool.cs index a5a3d0ea..fb9fed0a 100644 --- a/api/AltV.Net/Elements/Pools/PlayerPool.cs +++ b/api/AltV.Net/Elements/Pools/PlayerPool.cs @@ -14,7 +14,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Player_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Player_GetID(entityPointer); } } } diff --git a/api/AltV.Net/Elements/Pools/VehiclePool.cs b/api/AltV.Net/Elements/Pools/VehiclePool.cs index 54b97d2d..e6b7551a 100644 --- a/api/AltV.Net/Elements/Pools/VehiclePool.cs +++ b/api/AltV.Net/Elements/Pools/VehiclePool.cs @@ -14,7 +14,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.Vehicle_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.Vehicle_GetID(entityPointer); } } } diff --git a/api/AltV.Net/Elements/Pools/VirtualEntityGroupPool.cs b/api/AltV.Net/Elements/Pools/VirtualEntityGroupPool.cs index 063816f7..e66d016f 100644 --- a/api/AltV.Net/Elements/Pools/VirtualEntityGroupPool.cs +++ b/api/AltV.Net/Elements/Pools/VirtualEntityGroupPool.cs @@ -13,7 +13,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.VirtualEntityGroup_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.VirtualEntityGroup_GetID(entityPointer); } } } \ No newline at end of file diff --git a/api/AltV.Net/Elements/Pools/VirtualEntityPool.cs b/api/AltV.Net/Elements/Pools/VirtualEntityPool.cs index 0a8afd6c..251684b1 100644 --- a/api/AltV.Net/Elements/Pools/VirtualEntityPool.cs +++ b/api/AltV.Net/Elements/Pools/VirtualEntityPool.cs @@ -13,7 +13,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.VirtualEntity_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.VirtualEntity_GetID(entityPointer); } } } \ No newline at end of file diff --git a/api/AltV.Net/Elements/Pools/VoiceChannelPool.cs b/api/AltV.Net/Elements/Pools/VoiceChannelPool.cs index 71208609..cefcc554 100644 --- a/api/AltV.Net/Elements/Pools/VoiceChannelPool.cs +++ b/api/AltV.Net/Elements/Pools/VoiceChannelPool.cs @@ -13,7 +13,7 @@ public override uint GetId(IntPtr entityPointer) { unsafe { - return Alt.Core.Library.Shared.VoiceChannel_GetID(entityPointer); + return Alt.CoreImpl.Library.Shared.VoiceChannel_GetID(entityPointer); } } } diff --git a/api/AltV.Net/ICore.cs b/api/AltV.Net/ICore.cs index 73e382f9..cb6612ce 100644 --- a/api/AltV.Net/ICore.cs +++ b/api/AltV.Net/ICore.cs @@ -1,11 +1,15 @@ using System; using System.Collections.Generic; +using System.IO; using System.Numerics; +using System.Reflection; +using System.Runtime.Loader; using AltV.Net.CApi; using AltV.Net.Data; using AltV.Net.Elements.Args; using AltV.Net.Elements.Entities; using AltV.Net.Elements.Pools; +using AltV.Net.FunctionParser; using AltV.Net.Native; using AltV.Net.Shared; using AltV.Net.Shared.Elements.Data; @@ -214,5 +218,24 @@ IBaseObject[] GetClosestEntities(Position position, int range, int dimension, in void AddClientConfigKey(string key); bool HasBenefit(Benefit benefit); + Function OnClient(string clientEventName, Function create, bool isOnce = false); + Function OnServer(string clientEventName, Function create, bool isOnce = false); + void On(string eventName, TFunc func, ClientEventParser parser) where TFunc : Delegate; + void Off(string eventName, TFunc func, ClientEventParser parser) where TFunc : Delegate; + + void On(string eventName, TFunc func, ServerEventParser parser) where TFunc : Delegate; + void Off(string eventName, TFunc func, ServerEventParser parser) where TFunc : Delegate; + + IEnumerable Assemblies { get; } + Assembly LoadAssemblyFromName(AssemblyName assemblyName); + Assembly LoadAssemblyFromStream(Stream stream); + Assembly LoadAssemblyFromStream(Stream stream, Stream assemblySymbols); + WeakReference GetAssemblyLoadContext(); + Assembly LoadAssemblyFromPath(string path); + Assembly LoadAssemblyFromNativeImagePath(string nativeImagePath, string assemblyPath); + + void SetExport(string key, Function function); + void OffServer(string eventName, Function function); + void OffClient(string eventName, Function function); } } \ No newline at end of file diff --git a/api/AltV.Net/ModuleWrapper.cs b/api/AltV.Net/ModuleWrapper.cs index e3599c85..7685e1ae 100644 --- a/api/AltV.Net/ModuleWrapper.cs +++ b/api/AltV.Net/ModuleWrapper.cs @@ -128,7 +128,7 @@ public static void MainWithAssembly(IntPtr serverPointer, IntPtr resourcePointer var core = _resource.GetCore(serverPointer, resourcePointer, assemblyLoadContext, library, baseObjectPool, nativeResourcePool); _core = core; Alt.CoreImpl = core; - AltShared.Core = core; + AltShared.CoreImpl = core; if (library.Outdated) { @@ -188,7 +188,7 @@ public static void OnStop() _core.PoolManager.Dispose(); - Alt.Core.Resource.CSharpResourceImpl.Dispose(); + Alt.CoreImpl.Resource.CSharpResourceImpl.Dispose(); AppDomain.CurrentDomain.UnhandledException -= OnUnhandledException;