Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.2.0",
"version": "1.2.5",
"commands": [
"csharpier"
]
],
"rollForward": false
}
}
}
2 changes: 1 addition & 1 deletion RLBotCS/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
if (args.Length > 0 && args[0] == "--version")
{
Console.WriteLine(
"RLBotServer v5.0.0-rc.2\n"
"RLBotServer v5.0.0-rc.3\n"
+ $"Bridge {BridgeVersion.Version}\n"
+ "@ https://www.rlbot.org & https://github.com/RLBot/core"
);
Expand Down
6 changes: 3 additions & 3 deletions RLBotCS/RLBotCS.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
Expand All @@ -20,8 +20,8 @@
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Tomlyn" Version="0.19.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Tomlyn" Version="0.20.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.2" />
</ItemGroup>
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<DefineConstants>WINDOWS</DefineConstants>
Expand Down
Binary file modified RLBotCS/lib/Bridge.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions RLBotCSTests/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]
6 changes: 3 additions & 3 deletions RLBotCSTests/BallPrediction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void TestBallPred()
var ballPred = BallPredictor.Generate(1, gTP2.Balls[0], null, -650f);

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

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

// makes the above result print out
Assert.IsTrue(false);
Assert.Fail();
}
}
22 changes: 8 additions & 14 deletions RLBotCSTests/ConfigParserTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void AssertThrowsInnerException<T>(Action action)
}
e = e.InnerException!;
}
Assert.IsInstanceOfType(e, typeof(T));
Assert.IsInstanceOfType<T>(e);
return;
}
Assert.Fail();
Expand All @@ -48,14 +48,8 @@ public void EmptyVsDefaultMatchConfig()
Assert.AreEqual(emptyMC.AutoStartAgents, defaultMC.AutoStartAgents);
Assert.AreEqual(emptyMC.WaitForAgents, defaultMC.WaitForAgents);
Assert.AreEqual(emptyMC.GameMapUpk, defaultMC.GameMapUpk);
Assert.AreEqual(
emptyMC.PlayerConfigurations.Count,
defaultMC.PlayerConfigurations.Count
);
Assert.AreEqual(
emptyMC.ScriptConfigurations.Count,
defaultMC.ScriptConfigurations.Count
);
Assert.HasCount(emptyMC.PlayerConfigurations.Count, defaultMC.PlayerConfigurations);
Assert.HasCount(emptyMC.ScriptConfigurations.Count, defaultMC.ScriptConfigurations);
Assert.AreEqual(emptyMC.GameMode, defaultMC.GameMode);
Assert.AreEqual(emptyMC.SkipReplays, defaultMC.SkipReplays);
Assert.AreEqual(emptyMC.InstantStart, defaultMC.InstantStart);
Expand Down Expand Up @@ -107,7 +101,7 @@ public void EdgeCases()
PsyonixSkill.Pro,
edgeMC.PlayerConfigurations[0].Variety.AsPsyonixBot().BotSkill
);
Assert.AreEqual(null, edgeMC.PlayerConfigurations[0].Variety.AsPsyonixBot().Loadout);
Assert.IsNull(edgeMC.PlayerConfigurations[0].Variety.AsPsyonixBot().Loadout);

Assert.AreEqual(PlayerClass.CustomBot, edgeMC.PlayerConfigurations[1].Variety.Type);
Assert.AreEqual(
Expand Down Expand Up @@ -167,8 +161,8 @@ public void EmptyVsDefaultBotAndScriptToml()
Assert.AreEqual(0u, player.Team);
Assert.AreEqual(Path.GetFullPath("TestTomls"), player.Variety.AsCustomBot().RootDir);
Assert.AreEqual("", player.Variety.AsCustomBot().RunCommand);
Assert.AreEqual(null, player.Variety.AsCustomBot().Loadout);
Assert.AreEqual(false, player.Variety.AsCustomBot().Hivemind);
Assert.IsNull(player.Variety.AsCustomBot().Loadout);
Assert.IsFalse(player.Variety.AsCustomBot().Hivemind);

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

PlayerConfigurationT player = mc.PlayerConfigurations[0];
Assert.AreEqual("New Bot Name", player.Variety.AsCustomBot().Name);
Assert.AreEqual(null, player.Variety.AsCustomBot().Loadout);
Assert.IsNull(player.Variety.AsCustomBot().Loadout);

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

AssertThrowsInnerException<FileNotFoundException>(() =>
Expand Down
2 changes: 1 addition & 1 deletion RLBotCSTests/GameState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public void Test()
);

var flatPacket = packet.ToFlatBuffers();
Assert.AreEqual(3, flatPacket.BoostPads.Count);
Assert.HasCount(3, flatPacket.BoostPads);
}
}
6 changes: 3 additions & 3 deletions RLBotCSTests/PlayerMappingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void TestSpawnProcess()
Assert.AreEqual(playerId, metadata.PlayerId);
Assert.AreEqual(agentId, metadata.AgentId);
Assert.IsTrue(metadata.IsBot);
Assert.IsTrue(!metadata.IsCustomBot);
Assert.IsFalse(metadata.IsCustomBot);

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

uint? index2 = _playerMapping.PlayerIndexFromActorId(456);

Expand Down
10 changes: 5 additions & 5 deletions RLBotCSTests/RLBotCSTests.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
<PackageReference Include="coverlet.collector" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
<PackageReference Include="coverlet.collector" Version="6.0.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RLBotCS\RLBotCS.csproj" />
Expand Down