Skip to content

Commit 0d7d3a9

Browse files
committed
fix: Compilation errors in TestPlugin
1 parent 053c1ba commit 0d7d3a9

File tree

5 files changed

+636
-646
lines changed

5 files changed

+636
-646
lines changed

managed/src/Entrypoint.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ internal class Entrypoint
99
{
1010
[UnmanagedCallersOnly]
1111
[SecurityCritical]
12-
public unsafe static void Start(IntPtr nativeTable, int nativeTableSize, IntPtr basePath)
13-
{
14-
try {
12+
public unsafe static void Start( IntPtr nativeTable, int nativeTableSize, IntPtr basePath )
13+
{
14+
try
15+
{
1516
Bootstrap.Start(nativeTable, nativeTableSize, Marshal.PtrToStringUTF8(basePath)!);
16-
} catch (Exception e) {
17+
}
18+
catch (Exception e)
19+
{
1720
AnsiConsole.WriteException(e);
1821
}
1922
}
20-
21-
}
23+
}

managed/src/TestPlugin/BenchContext.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace TestPlugin;
44

5-
public static class BenchContext {
6-
public static CCSPlayerController? Controller { get; set; }
5+
public static class BenchContext
6+
{
7+
public static CCSPlayerController? Controller { get; set; }
78
}

managed/src/TestPlugin/PlayerBenchmarks.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33

44
namespace TestPlugin;
55

6-
public class PlayerBenchmarks {
6+
public class PlayerBenchmarks
7+
{
8+
private CCSPlayerController _controller;
79

8-
private CCSPlayerController _controller;
9-
10-
[GlobalSetup]
11-
public void Setup()
12-
{
13-
_controller = BenchContext.Controller;
14-
15-
if (_controller is null)
10+
[GlobalSetup]
11+
public void Setup()
1612
{
17-
throw new InvalidOperationException("Controller is not set");
13+
_controller = BenchContext.Controller;
14+
15+
if (_controller is null)
16+
{
17+
throw new InvalidOperationException("Controller is not set");
18+
}
1819
}
19-
}
2020

21-
[Benchmark]
22-
public void Test()
23-
{
24-
for (int i = 0; i < 10000; i++)
21+
[Benchmark]
22+
public void Test()
2523
{
26-
var a = _controller.Pawn.Value.WeaponServices.ActiveWeapon;
24+
for (int i = 0; i < 10000; i++)
25+
{
26+
var a = _controller.Pawn.Value.WeaponServices.ActiveWeapon;
27+
}
2728
}
28-
}
2929
}

0 commit comments

Comments
 (0)