@@ -19,7 +19,8 @@ void CoreClr_SetResourceLoadDelegates(CoreClrDelegate_t resourceExecute, CoreClr
1919 cv.notify_all ();
2020}
2121
22- CoreClr::CoreClr (alt::ICore* server) {
22+ CoreClr::CoreClr (alt::ICore* core) {
23+ this ->core = core;
2324 _initializeCoreCLR = nullptr ;
2425 _shutdownCoreCLR = nullptr ;
2526 _createDelegate = nullptr ;
@@ -48,7 +49,7 @@ CoreClr::CoreClr(alt::ICore* server) {
4849 auto currDotnetDirectory = " /usr/share/dotnet/" ;
4950 dotnetDirectory = new char [strlen (currDotnetDirectory) + 1 ];
5051 strcpy (dotnetDirectory, currDotnetDirectory);
51- GetPath (server , " /usr/share/dotnet/host/fxr/" );
52+ GetPath (core , " /usr/share/dotnet/host/fxr/" );
5253#endif
5354#ifdef _WIN32
5455 const char *fileName = " /hostfxr.dll" ;
@@ -76,7 +77,7 @@ CoreClr::CoreClr(alt::ICore* server) {
7677 strcat (fullPath, fileName);
7778 _coreClrLib = dlopen (fullPath, RTLD_NOW | RTLD_LOCAL);
7879 if (_coreClrLib == nullptr ) {
79- server ->LogInfo (alt::String (" coreclr-module: Unable to find CoreCLR dll [" ) + fullPath + " ]: " + dlerror ());
80+ core ->LogInfo (alt::String (" coreclr-module: Unable to find CoreCLR dll [" ) + fullPath + " ]: " + dlerror ());
8081 return ;
8182 }
8283 _initializeFxr = (hostfxr_initialize_for_runtime_config_fn) dlsym (_coreClrLib,
@@ -89,7 +90,7 @@ CoreClr::CoreClr(alt::ICore* server) {
8990#endif
9091 if (_initializeFxr == nullptr || _getDelegate == nullptr || _closeFxr == nullptr || _runApp == nullptr ||
9192 _initForCmd == nullptr ) {
92- server ->LogInfo (alt::String (" coreclr-module: Unable to find CoreCLR dll methods" ));
93+ core ->LogInfo (alt::String (" coreclr-module: Unable to find CoreCLR dll methods" ));
9394 return ;
9495 }
9596}
@@ -124,11 +125,11 @@ CoreClr::~CoreClr() {
124125}*/
125126
126127// TODO: don't include own dll or exe ect that is in the directory
127- alt::Array<alt::String> CoreClr::getTrustedAssemblies (alt::ICore* server, const char * appPath) {
128+ /* alt::Array<alt::String> CoreClr::getTrustedAssemblies(alt::ICore* server, const char* appPath) {
128129 alt::Array<alt::String> assemblies;
129130 const char* const tpaExtensions[] = {".ni.dll", ".dll", ".ni.exe", ".exe", ".winmd"};
130131
131- const char * directories[] = {runtimeDirectory/* , appPath* / };
132+ const char* directories[] = {runtimeDirectory// , appPath/ / };
132133
133134 for (auto path : directories) {
134135 auto directory = opendir(path);
@@ -181,9 +182,9 @@ alt::Array<alt::String> CoreClr::getTrustedAssemblies(alt::ICore* server, const
181182 //std::string filenameWithoutExt(filename.substr(0, extPos));
182183
183184 // Ensure assemblies are unique in the list
184- /* if (assemblies.find(filenameWithoutExt) != assemblies.end()) {//TODO: use alt::Set which doesnt exists
185- continue;
186- } */
185+ // if (assemblies.find(filenameWithoutExt) != assemblies.end()) {//TODO: use alt::Set which doesnt exists
186+ // continue;
187+ //}
187188
188189 if (strcmp(entry->d_name, "AltV.Net.dll") == 0) {
189190 continue;
@@ -199,7 +200,7 @@ alt::Array<alt::String> CoreClr::getTrustedAssemblies(alt::ICore* server, const
199200#endif
200201 }
201202 return assemblies;
202- }
203+ }*/
203204
204205// TODO: use APP_PATHS via path from main assembly because all assemblies are most likely in same path
205206/* void CoreClr::CreateAppDomain(alt::ICore* server, alt::IResource* resource, const char* appPath, void** runtimeHost,
@@ -276,7 +277,7 @@ alt::Array<alt::String> CoreClr::getTrustedAssemblies(alt::ICore* server, const
276277 }
277278}*/
278279
279- int CoreClr::Execute (alt::ICore* server, alt::IResource* resource, const char * appPath, uint64_t resourceIndex,
280+ /* int CoreClr::Execute(alt::ICore* server, alt::IResource* resource, const char* appPath, uint64_t resourceIndex,
280281 void** runtimeHost,
281282 const unsigned int* domainId) {
282283 auto executablePath = alt::String(appPath) + PATH_SEPARATOR + resource->GetMain();
@@ -305,7 +306,7 @@ int CoreClr::Execute(alt::ICore* server, alt::IResource* resource, const char* a
305306 server->LogInfo(alt::String("coreclr-module: Assembly executed"));
306307 }
307308 return result;
308- }
309+ }*/
309310
310311/* void CoreClr::Shutdown(alt::ICore* server, void* runtimeHost,
311312 unsigned int domainId) {
@@ -451,12 +452,12 @@ void CoreClr::CreateManagedHost() {
451452 thread = std::thread (thread_proc, userData);
452453}
453454
454- void CoreClr::ExecuteManagedResource (alt::ICore* server, const char * resourcePath, const char * resourceName,
455+ void CoreClr::ExecuteManagedResource (const char * resourcePath, const char * resourceName,
455456 const char * resourceMain, alt::IResource* resource) {
456457 std::unique_lock<std::mutex> lck (mtx);
457458 while (hostResourceExecute == nullptr ){ cv.wait (lck); }
458459 if (hostResourceExecute == nullptr ) {
459- server ->LogInfo (alt::String (" coreclr-module: Core CLR host not loaded" ));
460+ core ->LogInfo (alt::String (" coreclr-module: Core CLR host not loaded" ));
460461 return ;
461462 }
462463
@@ -475,18 +476,18 @@ void CoreClr::ExecuteManagedResource(alt::ICore* server, const char* resourcePat
475476 resourcePath,
476477 resourceName,
477478 resourceMain,
478- server ,
479+ core ,
479480 resource
480481 };
481482
482483 hostResourceExecute (&args, sizeof (args));
483484}
484485
485- void CoreClr::ExecuteManagedResourceUnload (alt::ICore* server, const char * resourcePath, const char * resourceMain) {
486+ void CoreClr::ExecuteManagedResourceUnload (const char * resourcePath, const char * resourceMain) {
486487 std::unique_lock<std::mutex> lck (mtx);
487488 while (hostResourceExecuteUnload == nullptr ){ cv.wait (lck); }
488489 if (hostResourceExecuteUnload == nullptr ) {
489- server ->LogInfo (alt::String (" coreclr-module: Core CLR host not loaded" ));
490+ core ->LogInfo (alt::String (" coreclr-module: Core CLR host not loaded" ));
490491 return ;
491492 }
492493
0 commit comments