Skip to content

Commit fdb7d09

Browse files
Fix exports
1 parent 0f8b294 commit fdb7d09

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

runtime/src/CoreClr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ bool CoreClr::ExecuteManagedResourceUnload(const char* resourcePath, const char*
489489
while(hostResourceExecuteUnload == nullptr){ cv.wait(lck); }
490490
if (hostResourceExecuteUnload == nullptr) {
491491
core->LogInfo(alt::String("coreclr-module: Core CLR host not loaded"));
492-
return;
492+
return false;
493493
}
494494

495495
// Run managed code
@@ -505,4 +505,5 @@ bool CoreClr::ExecuteManagedResourceUnload(const char* resourcePath, const char*
505505
};
506506

507507
hostResourceExecuteUnload(&args, sizeof(args));
508+
return true;
508509
}

runtime/src/altv-c-api/resource.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ bool Resource_GetExport(alt::IResource* resource, const char* key, alt::MValue &
2727
}
2828

2929
void Resource_SetExport(alt::IResource* resource, const char* key, const alt::MValue* val) {
30-
resource->GetExports()[key] = val;
30+
resource->GetExports()[key] = *val;
31+
}
32+
33+
void Resource_SetExports(alt::IResource* resource, alt::MValue* val, const char** keys, int size) {
34+
alt::MValueDict dict;
35+
for (int i = 0; i < size; i++) {
36+
dict[keys[i]] = val[i];
37+
}
38+
resource->SetExports(dict);
3139
}
3240

3341
void Resource_GetPath(alt::IResource* resource, const char*&text) {

runtime/src/altv-c-api/resource.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ extern "C"
2020
EXPORT void Resource_GetExports(alt::IResource* resource, alt::Array<alt::String> &keys, alt::MValue::List &values);
2121
EXPORT bool Resource_GetExport(alt::IResource* resource, const char* key, alt::MValue &value);
2222
EXPORT void Resource_SetExport(alt::IResource* resource, const char* key, const alt::MValue* val);
23+
EXPORT void Resource_SetExports(alt::IResource* resource, alt::MValue* val, const char** keys, int size);
2324
EXPORT void Resource_GetPath(alt::IResource* resource, const char*&text);
2425
EXPORT void Resource_GetName(alt::IResource* resource, const char*&text);
2526
EXPORT void Resource_GetMain(alt::IResource* resource, const char*&text);

0 commit comments

Comments
 (0)