Skip to content

Commit 0cc5a92

Browse files
authored
Update to .NET 10 (#145)
Update tools Fix warnings
1 parent e4e3a0e commit 0cc5a92

File tree

10 files changed

+30
-32
lines changed

10 files changed

+30
-32
lines changed

.config/dotnet-tools.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"isRoot": true,
44
"tools": {
55
"csharpier": {
6-
"version": "1.2.0",
6+
"version": "1.2.5",
77
"commands": [
88
"csharpier"
9-
]
9+
],
10+
"rollForward": false
1011
}
1112
}
1213
}

RLBotCS/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
if (args.Length > 0 && args[0] == "--version")
1111
{
1212
Console.WriteLine(
13-
"RLBotServer v5.0.0-rc.2\n"
13+
"RLBotServer v5.0.0-rc.3\n"
1414
+ $"Bridge {BridgeVersion.Version}\n"
1515
+ "@ https://www.rlbot.org & https://github.com/RLBot/core"
1616
);

RLBotCS/RLBotCS.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
@@ -20,8 +20,8 @@
2020
<InvariantGlobalization>true</InvariantGlobalization>
2121
</PropertyGroup>
2222
<ItemGroup>
23-
<PackageReference Include="Tomlyn" Version="0.19.0" />
24-
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
23+
<PackageReference Include="Tomlyn" Version="0.20.0" />
24+
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.2" />
2525
</ItemGroup>
2626
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
2727
<DefineConstants>WINDOWS</DefineConstants>

RLBotCS/lib/Bridge.dll

0 Bytes
Binary file not shown.

RLBotCSTests/AssemblyInfo.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
3+
[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]

RLBotCSTests/BallPrediction.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public void TestBallPred()
4444
var ballPred = BallPredictor.Generate(1, gTP2.Balls[0], null, -650f);
4545

4646
int numSlices = 6 * 120;
47-
Assert.AreEqual(numSlices, ballPred.Slices.Count);
48-
Assert.IsTrue(ballPred.Slices[numSlices - 1].GameSeconds > 5.9999);
47+
Assert.HasCount(numSlices, ballPred.Slices);
48+
Assert.IsInRange(6.9999, 7.0001, ballPred.Slices[numSlices - 1].GameSeconds);
4949

5050
// comment out to see results of the below test
5151
// dotnet test -c "Release" for best results
@@ -75,6 +75,6 @@ public void TestBallPred()
7575
);
7676

7777
// makes the above result print out
78-
Assert.IsTrue(false);
78+
Assert.Fail();
7979
}
8080
}

RLBotCSTests/ConfigParserTest.cs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void AssertThrowsInnerException<T>(Action action)
3030
}
3131
e = e.InnerException!;
3232
}
33-
Assert.IsInstanceOfType(e, typeof(T));
33+
Assert.IsInstanceOfType<T>(e);
3434
return;
3535
}
3636
Assert.Fail();
@@ -48,14 +48,8 @@ public void EmptyVsDefaultMatchConfig()
4848
Assert.AreEqual(emptyMC.AutoStartAgents, defaultMC.AutoStartAgents);
4949
Assert.AreEqual(emptyMC.WaitForAgents, defaultMC.WaitForAgents);
5050
Assert.AreEqual(emptyMC.GameMapUpk, defaultMC.GameMapUpk);
51-
Assert.AreEqual(
52-
emptyMC.PlayerConfigurations.Count,
53-
defaultMC.PlayerConfigurations.Count
54-
);
55-
Assert.AreEqual(
56-
emptyMC.ScriptConfigurations.Count,
57-
defaultMC.ScriptConfigurations.Count
58-
);
51+
Assert.HasCount(emptyMC.PlayerConfigurations.Count, defaultMC.PlayerConfigurations);
52+
Assert.HasCount(emptyMC.ScriptConfigurations.Count, defaultMC.ScriptConfigurations);
5953
Assert.AreEqual(emptyMC.GameMode, defaultMC.GameMode);
6054
Assert.AreEqual(emptyMC.SkipReplays, defaultMC.SkipReplays);
6155
Assert.AreEqual(emptyMC.InstantStart, defaultMC.InstantStart);
@@ -107,7 +101,7 @@ public void EdgeCases()
107101
PsyonixSkill.Pro,
108102
edgeMC.PlayerConfigurations[0].Variety.AsPsyonixBot().BotSkill
109103
);
110-
Assert.AreEqual(null, edgeMC.PlayerConfigurations[0].Variety.AsPsyonixBot().Loadout);
104+
Assert.IsNull(edgeMC.PlayerConfigurations[0].Variety.AsPsyonixBot().Loadout);
111105

112106
Assert.AreEqual(PlayerClass.CustomBot, edgeMC.PlayerConfigurations[1].Variety.Type);
113107
Assert.AreEqual(
@@ -167,8 +161,8 @@ public void EmptyVsDefaultBotAndScriptToml()
167161
Assert.AreEqual(0u, player.Team);
168162
Assert.AreEqual(Path.GetFullPath("TestTomls"), player.Variety.AsCustomBot().RootDir);
169163
Assert.AreEqual("", player.Variety.AsCustomBot().RunCommand);
170-
Assert.AreEqual(null, player.Variety.AsCustomBot().Loadout);
171-
Assert.AreEqual(false, player.Variety.AsCustomBot().Hivemind);
164+
Assert.IsNull(player.Variety.AsCustomBot().Loadout);
165+
Assert.IsFalse(player.Variety.AsCustomBot().Hivemind);
172166

173167
ScriptConfigurationT script = mc.ScriptConfigurations[0];
174168
Assert.AreEqual("", script.Name);
@@ -185,7 +179,7 @@ public void Overrides()
185179

186180
PlayerConfigurationT player = mc.PlayerConfigurations[0];
187181
Assert.AreEqual("New Bot Name", player.Variety.AsCustomBot().Name);
188-
Assert.AreEqual(null, player.Variety.AsCustomBot().Loadout);
182+
Assert.IsNull(player.Variety.AsCustomBot().Loadout);
189183

190184
ScriptConfigurationT script = mc.ScriptConfigurations[0];
191185
Assert.AreEqual("Normal Test Script", script.Name); // Not overriden
@@ -194,7 +188,7 @@ public void Overrides()
194188
[TestMethod]
195189
public void ConfigNotFound()
196190
{
197-
ConfigParser parser = new ConfigParser();
191+
ConfigParser parser = new();
198192
AssertThrowsInnerException<ArgumentNullException>(() => parser.LoadMatchConfig(null!));
199193

200194
AssertThrowsInnerException<FileNotFoundException>(() =>

RLBotCSTests/GameState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ public void Test()
4747
);
4848

4949
var flatPacket = packet.ToFlatBuffers();
50-
Assert.AreEqual(3, flatPacket.BoostPads.Count);
50+
Assert.HasCount(3, flatPacket.BoostPads);
5151
}
5252
}

RLBotCSTests/PlayerMappingTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void TestSpawnProcess()
4242
Assert.AreEqual(playerId, metadata.PlayerId);
4343
Assert.AreEqual(agentId, metadata.AgentId);
4444
Assert.IsTrue(metadata.IsBot);
45-
Assert.IsTrue(!metadata.IsCustomBot);
45+
Assert.IsFalse(metadata.IsCustomBot);
4646

4747
// apply car spawn from unknown player
4848
var metadata2 = _playerMapping.ApplyCarSpawn(111, 222);
@@ -53,8 +53,8 @@ public void TestSpawnProcess()
5353
Assert.AreEqual(0u, index);
5454
Assert.AreNotEqual(0, metadata2.PlayerId);
5555
Assert.AreEqual(desiredIndex, _playerMapping.PlayerIndexFromActorId(actorId));
56-
Assert.IsTrue(!metadata2.IsBot);
57-
Assert.IsTrue(!metadata2.IsCustomBot);
56+
Assert.IsFalse(metadata2.IsBot);
57+
Assert.IsFalse(metadata2.IsCustomBot);
5858

5959
uint? index2 = _playerMapping.PlayerIndexFromActorId(456);
6060

RLBotCSTests/RLBotCSTests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<Nullable>enable</Nullable>
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
9-
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
10-
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
11-
<PackageReference Include="coverlet.collector" Version="3.1.0" />
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
9+
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
10+
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
11+
<PackageReference Include="coverlet.collector" Version="6.0.4" />
1212
</ItemGroup>
1313
<ItemGroup>
1414
<ProjectReference Include="..\RLBotCS\RLBotCS.csproj" />

0 commit comments

Comments
 (0)