Skip to content

Commit

Permalink
feat: use .NET 7
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmuffin committed Oct 7, 2023
1 parent 54d1a05 commit 2fc9fb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cmake-single-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
mkdir -p build/output/addons/counterstrikesharp/dotnet
curl -s -L https://download.visualstudio.microsoft.com/download/pr/02f4c6c2-c137-448d-a189-9ee3a3f6f99f/192f2c750089fa0194f04f5a805bd21e/aspnetcore-runtime-8.0.0-rc.1.23421.29-linux-x64.tar.gz \
| tar xvz -C build/output/addons/counterstrikesharp/dotnet
mv build/output/addons/counterstrikesharp/dotnet/shared/Microsoft.NETCore.App/7.0.11/* build/output/addons/counterstrikesharp/dotnet/shared/Microsoft.NETCore.App/
- uses: actions/upload-artifact@v3
with:
Expand Down
13 changes: 6 additions & 7 deletions src/scripting/dotnet_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ bool load_hostfxr()
{
std::string baseDir = counterstrikesharp::utils::PluginDirectory();

std::string buffer = std::string(baseDir + "/dotnet/host/fxr/8.0.0-rc.1.23419.4/libhostfxr.so");
std::string buffer = std::string(baseDir + "/dotnet/host/fxr/7.0.11/libhostfxr.so");

CSSHARP_CORE_TRACE("Loading hostfxr from {0}", buffer.c_str());

Expand Down Expand Up @@ -135,7 +135,8 @@ bool CDotNetManager::Initialize()
return false;
}

/*
CSSHARP_CORE_INFO(".NET Runtime Initialised.");

std::string wideStr = std::string((baseDir + "/api/CounterStrikeSharp.API.runtimeconfig.json").c_str());

load_assembly_and_get_function_pointer_fn load_assembly_and_get_function_pointer = nullptr;
Expand All @@ -148,9 +149,8 @@ bool CDotNetManager::Initialize()

typedef int(CORECLR_DELEGATE_CALLTYPE * custom_entry_point_fn)();
custom_entry_point_fn entry_point = nullptr;
int rc =
load_assembly_and_get_function_pointer(dotnetlib_path.c_str(), dotnet_type, "LoadAllPlugins",
UNMANAGEDCALLERSONLY_METHOD, nullptr, (void **)&entry_point);
int rc = load_assembly_and_get_function_pointer(dotnetlib_path.c_str(), dotnet_type, "LoadAllPlugins",
UNMANAGEDCALLERSONLY_METHOD, nullptr, (void **)&entry_point);
assert(rc == 0 && entry_point != nullptr && "Failure: load_assembly_and_get_function_pointer()");

const bool success = entry_point();
Expand All @@ -159,9 +159,8 @@ bool CDotNetManager::Initialize()
CSSHARP_CORE_ERROR("Failed to initialize .NET");
return false;
}
*/

CSSHARP_CORE_INFO(".NET Initialized.");
CSSHARP_CORE_INFO("CounterStrikeSharp.API Loaded Successfully.");
return true;
}

Expand Down

0 comments on commit 2fc9fb6

Please sign in to comment.