Skip to content

Commit 3acd616

Browse files
committed
update to net10
1 parent a7a73d1 commit 3acd616

File tree

8 files changed

+753
-751
lines changed

8 files changed

+753
-751
lines changed

Makefile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
STATICS_RELEASE=265e23ca-337c-4e8d-b383-0e1e87300468
1+
STATICS_RELEASE=87d20f43-0820-47e0-8cf1-b4e0cd1a50aa
22
DOTNETFLAGS=--nodereuse:false -v n
33

44
statics:
@@ -16,7 +16,7 @@ SteamKit2.WASM:
1616
git clone https://github.com/MercuryWorkshop/SteamKit2.WASM --recursive
1717

1818
FNA:
19-
git clone https://github.com/FNA-XNA/FNA --recursive -b 25.02
19+
git clone https://github.com/FNA-XNA/FNA --recursive -b 25.11
2020
cd FNA && git apply ../FNA.patch
2121

2222
NLua:
@@ -44,13 +44,10 @@ deps: statics FNA MonoMod NLua SteamKit2.WASM emsdk
4444

4545
build: deps
4646
pnpm i
47-
rm -r frontend/public/_framework loader/bin/Release/net9.0/publish/wwwroot/_framework || true
48-
#
49-
NUGET_PACKAGES="$(shell realpath .)/nuget" dotnet restore loader $(DOTNETFLAGS)
50-
bash replaceruntime.sh
51-
NUGET_PACKAGES="$(shell realpath .)/nuget" dotnet publish loader -c Release $(DOTNETFLAGS)
52-
#
53-
cp -r loader/bin/Release/net9.0/publish/wwwroot/_framework frontend/public/
47+
rm -r frontend/public/_framework loader/bin/Release/net10.0/publish/wwwroot/_framework statics/dotnet || true
48+
unzip -q -o statics/dotnet.zip -d statics/dotnet
49+
dotnet publish loader -c Release $(DOTNETFLAGS)
50+
cp -r loader/bin/Release/net10.0/publish/wwwroot/_framework frontend/public/
5451
# emscripten sucks
5552
sed -i 's/var offscreenCanvases \?= \?{};/var offscreenCanvases={};if(globalThis.window\&\&!window.TRANSFERRED_CANVAS){transferredCanvasNames=[".canvas"];window.TRANSFERRED_CANVAS=true;}/' frontend/public/_framework/dotnet.native.*.js
5653
# dotnet messed up

Steamworks/Steamworks.NET.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<AssemblyName>Steamworks.NET</AssemblyName>
55
<RootNamespace>Steamworks</RootNamespace>
6-
<LangVersion>12</LangVersion>
6+
<LangVersion>14</LangVersion>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
</PropertyGroup>
99

corefier/NETCoreifier.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<AssemblyName>NETCoreifier</AssemblyName>
55
<RootNamespace>NETCoreifier</RootNamespace>
6-
<LangVersion>11</LangVersion>
6+
<LangVersion>14</LangVersion>
77
</PropertyGroup>
88

99
<ItemGroup>

frontend/src/game/dotnet.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DotnetHostBuilder } from "./dotnetdefs";
1+
import { DotnetHostBuilder, MonoConfig } from "./dotnetdefs";
22
import { recursiveGetDirectory, rootFolder } from "../fs";
33
import { SteamJS } from "../achievements";
44
import { JsSplash } from "./loading";
@@ -85,18 +85,15 @@ useChange([gameState.playing, gameState.initting], () => {
8585
});
8686

8787
let nativefetch = window.fetch;
88-
let wasm;
88+
let wasm: any;
8989
let dotnet: DotnetHostBuilder;
9090
let exports: any;
9191

92-
export async function getDlls(): Promise<(readonly [string, string])[]> {
93-
const resources: any = await nativefetch("_framework/blazor.boot.json").then(
94-
(r) => r.json()
95-
);
96-
97-
return Object.entries(resources.resources.fingerprinting)
98-
.map((x) => [x[0] as string, x[1] as string] as const)
99-
.filter((x) => x[1].endsWith(".dll"));
92+
export function getDlls(): (readonly [string, string])[] {
93+
const config: MonoConfig = wasm.dotnet.instance.config;
94+
const resources = [...(config.resources?.coreAssembly || []), ...(config.resources?.assembly || [])];
95+
return resources
96+
.map((x) => [x.name, x.virtualPath] as const)
10097
}
10198

10299
// the funny custom rsa
@@ -192,14 +189,17 @@ export const loadedLibcurlPromise = new Promise((r) => (libcurlresolver = r));
192189
export async function preInit() {
193190
if (gameState.ready) return;
194191

195-
wasm = await eval(`import("../_framework/dotnet.js")`);
192+
let url = "../_framework/dotnet.js";
193+
if (import.meta.env.DEV) {
194+
url = "/_framework/dotnet.js";
195+
}
196+
197+
wasm = await eval(`import("${url}")`);
196198
dotnet = wasm.dotnet;
197199

198200
console.debug("initializing dotnet");
199201
const runtime = await dotnet
200202
.withConfig({
201-
pthreadPoolInitialSize: 32,
202-
pthreadPoolUnusedSize: 512,
203203
})
204204
.withRuntimeOptions([
205205
// jit functions quickly and jit more functions
@@ -317,7 +317,7 @@ export async function preInit() {
317317
exports,
318318
};
319319

320-
const dlls = await getDlls();
320+
const dlls = getDlls();
321321

322322
const loc = location.pathname;
323323

0 commit comments

Comments
 (0)