Skip to content

Commit f5e3a67

Browse files
update and add client js support
1 parent c4e9a1c commit f5e3a67

File tree

8 files changed

+27
-17
lines changed

8 files changed

+27
-17
lines changed

api/AltV.Net.Async/AltV.Net.Async.csproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
<RepositoryUrl>https://github.com/altmp-csharp/docs</RepositoryUrl>
1313
<RepositoryType>git</RepositoryType>
1414
<PackageTags>altv gta bridge</PackageTags>
15-
<PackageVersion>1.7.1-beta</PackageVersion>
15+
<PackageVersion>1.7.2-beta</PackageVersion>
1616
<PackageLicenseFile>license.txt</PackageLicenseFile>
17-
<PackageReleaseNotes>Add IVehicle::AppearanceData
18-
Add IVehicle::RadioStation
19-
Add IVehicle::ManualEngineControl
20-
Add IVehicle::ScriptData
21-
Optimize entity pools</PackageReleaseNotes>
17+
<PackageReleaseNotes>Update dependencies</PackageReleaseNotes>
2218
</PropertyGroup>
2319

2420
<ItemGroup>

api/AltV.Net.Mock/AltV.Net.Mock.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<RepositoryUrl>https://github.com/altmp-csharp/docs</RepositoryUrl>
1212
<RepositoryType>git</RepositoryType>
1313
<PackageTags>altv gta bridge mock</PackageTags>
14-
<PackageVersion>1.7.1-beta</PackageVersion>
14+
<PackageVersion>1.7.2-beta</PackageVersion>
1515
<PackageLicenseFile>license.txt</PackageLicenseFile>
1616
<PackageReleaseNotes>Update dependencies</PackageReleaseNotes>
1717
</PropertyGroup>

api/AltV.Net.Networking.Example/AltV.Net.Networking.Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
<OutputType>Exe</OutputType>
66
</PropertyGroup>
77

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
5+
<clear />
6+
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
7+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
8+
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
9+
</packageSources>
10+
</configuration>

api/AltV.Net.NetworkingEntity/AltV.Net.NetworkingEntity.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

api/AltV.Net/AltV.Net.csproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@
1313
<RepositoryUrl>https://github.com/altmp-csharp/docs</RepositoryUrl>
1414
<RepositoryType>git</RepositoryType>
1515
<PackageTags>altv gta bridge</PackageTags>
16-
<PackageVersion>1.7.1-beta</PackageVersion>
16+
<PackageVersion>1.7.2-beta</PackageVersion>
1717
<PackageLicenseFile>license.txt</PackageLicenseFile>
18-
<PackageReleaseNotes>Add IVehicle::AppearanceData
19-
Add IVehicle::RadioStation
20-
Add IVehicle::ManualEngineControl
21-
Add IVehicle::ScriptData
22-
Optimize entity pools</PackageReleaseNotes>
18+
<PackageReleaseNotes>Update cpp sdk</PackageReleaseNotes>
2319
</PropertyGroup>
2420

2521
<ItemGroup>

runtime/include/CSharpResource.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ class CSharpResource : public alt::IResource {
125125
this->exports[key] = mValue;
126126
}
127127

128+
void MakeClient(CreationInfo* info, alt::Array<alt::String> files) override;
129+
128130
CheckpointDelegate_t OnCheckpointDelegate;
129131

130132
ClientEventDelegate_t OnClientEventDelegate;

runtime/src/CSharpResource.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ CSharpResource::CSharpResource(alt::IServer* server, CoreClr* coreClr, alt::IRes
5656

5757
if (isDll) {
5858
struct stat buf;
59-
auto executable = (stat((alt::String(this->GetPath()) + ASSEMBLY_PATH).CStr(), &buf) == 0);//TODO: needs resource cfg "assembly"
59+
auto executable = (stat((alt::String(this->GetPath()) + ASSEMBLY_PATH).CStr(), &buf) ==
60+
0);//TODO: needs resource cfg "assembly"
6061

6162
coreClr->CreateAppDomain(server, this, this->GetPath().CStr(), &runtimeHost, &domainId, executable,
6263
resourcesCache.GetSize() - 1);
@@ -231,7 +232,8 @@ bool CSharpResource::OnEvent(const alt::CEvent* ev) {
231232
if (entity == nullptr) return true;
232233
auto key = event->GetKey();
233234
auto value = event->GetVal();
234-
OnSyncedMetaChangeDelegate(GetEntityPointer(entity), entity->GetType(), key == nullptr ? "" : key.CStr(), &value);
235+
OnSyncedMetaChangeDelegate(GetEntityPointer(entity), entity->GetType(), key == nullptr ? "" : key.CStr(),
236+
&value);
235237
break;
236238
}
237239
case alt::CEvent::Type::CHECKPOINT_EVENT: {
@@ -437,6 +439,10 @@ CSharpResource* CSharpResource_GetResourcePointer(int32_t resourceIndex) {
437439
return resourcesCache[resourceIndex];
438440
}
439441

442+
void CSharpResource::MakeClient(alt::IResource::CreationInfo* info, alt::Array<alt::String> files) {
443+
info->type = "js";
444+
}
445+
440446
void* CSharpResource::GetBaseObjectPointer(alt::IBaseObject* baseObject) {
441447
if (baseObject != nullptr) {
442448
switch (baseObject->GetType()) {

0 commit comments

Comments
 (0)