Skip to content

Commit 50c6d49

Browse files
authored
Merge pull request #119 from RLBot/v0.7
v0.7
2 parents 3e836e5 + 436cba7 commit 50c6d49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+730
-755
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ jobs:
4343
- name: Test
4444
run: dotnet test
4545

46+
- name: Formatting
47+
run: |
48+
dotnet tool restore
49+
dotnet csharpier . --check
50+
4651
- name: Build
4752
run: dotnet publish -r linux-x64
4853

RLBotCS/Conversion/FlatToCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Microsoft.Extensions.Logging;
2-
using rlbot.flat;
2+
using RLBot.Flat;
33
using RLBotCS.ManagerTools;
44

55
namespace RLBotCS.Conversion;
@@ -11,10 +11,10 @@ static class FlatToCommand
1111
private static string MapGameMode(GameMode gameMode) =>
1212
gameMode switch
1313
{
14-
GameMode.Soccer => "?game=TAGame.GameInfo_Soccar_TA",
14+
GameMode.Soccar => "?game=TAGame.GameInfo_Soccar_TA",
1515
GameMode.Hoops => "?game=TAGame.GameInfo_Basketball_TA",
1616
GameMode.Dropshot => "?game=TAGame.GameInfo_Breakout_TA",
17-
GameMode.Hockey => "?game=TAGame.GameInfo_Hockey_TA",
17+
GameMode.Snowday => "?game=TAGame.GameInfo_Hockey_TA",
1818
GameMode.Rumble => "?game=TAGame.GameInfo_Items_TA",
1919
GameMode.Heatseeker => "?game=TAGame.GameInfo_GodBall_TA",
2020
GameMode.Gridiron => "?game=TAGame.GameInfo_Football_TA",

RLBotCS/Conversion/FlatToModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Bridge.Models.Command;
22
using Bridge.Models.Control;
33
using Bridge.State;
4-
using rlbot.flat;
4+
using RLBot.Flat;
55
using Color = System.Drawing.Color;
66
using LoadoutPaint = Bridge.Models.Command.LoadoutPaint;
77
using Physics = Bridge.Models.Phys.Physics;
@@ -66,7 +66,7 @@ internal static RenderAnchor ToRenderAnchor(RenderAnchorT offset, GameState game
6666

6767
internal static Color ToColor(ColorT c) => Color.FromArgb(c.A, c.R, c.G, c.B);
6868

69-
internal static Rotator ToRotator(rlbot.flat.Rotator r) =>
69+
internal static Rotator ToRotator(RLBot.Flat.Rotator r) =>
7070
new Rotator(r.Pitch, r.Yaw, r.Roll);
7171

7272
internal static Loadout ToLoadout(PlayerLoadoutT l, uint team)

RLBotCS/Conversion/GameStateToFlat.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using Bridge.Models.Message;
22
using Bridge.Packet;
33
using Bridge.State;
4-
using rlbot.flat;
4+
using RLBot.Flat;
55
using RLBotCS.Model;
6-
using CollisionShapeUnion = rlbot.flat.CollisionShapeUnion;
6+
using CollisionShapeUnion = RLBot.Flat.CollisionShapeUnion;
77
using MatchPhase = Bridge.Models.Message.MatchPhase;
88
using Rotator = Bridge.Models.Phys.Rotator;
99
using Vector2 = Bridge.Models.Phys.Vector2;
@@ -86,17 +86,17 @@ public static GamePacketT ToFlatBuffers(this GameState gameState)
8686
balls.Add(new() { Physics = ballPhysics, Shape = collisionShape });
8787
}
8888

89-
rlbot.flat.MatchPhase matchPhase = gameState.MatchPhase switch
89+
RLBot.Flat.MatchPhase matchPhase = gameState.MatchPhase switch
9090
{
91-
MatchPhase.Inactive => rlbot.flat.MatchPhase.Inactive,
92-
MatchPhase.Countdown => rlbot.flat.MatchPhase.Countdown,
93-
MatchPhase.Kickoff => rlbot.flat.MatchPhase.Kickoff,
94-
MatchPhase.Active => rlbot.flat.MatchPhase.Active,
95-
MatchPhase.GoalScored => rlbot.flat.MatchPhase.GoalScored,
96-
MatchPhase.Replay => rlbot.flat.MatchPhase.Replay,
97-
MatchPhase.Paused => rlbot.flat.MatchPhase.Paused,
98-
MatchPhase.Ended => rlbot.flat.MatchPhase.Ended,
99-
_ => rlbot.flat.MatchPhase.Inactive,
91+
MatchPhase.Inactive => RLBot.Flat.MatchPhase.Inactive,
92+
MatchPhase.Countdown => RLBot.Flat.MatchPhase.Countdown,
93+
MatchPhase.Kickoff => RLBot.Flat.MatchPhase.Kickoff,
94+
MatchPhase.Active => RLBot.Flat.MatchPhase.Active,
95+
MatchPhase.GoalScored => RLBot.Flat.MatchPhase.GoalScored,
96+
MatchPhase.Replay => RLBot.Flat.MatchPhase.Replay,
97+
MatchPhase.Paused => RLBot.Flat.MatchPhase.Paused,
98+
MatchPhase.Ended => RLBot.Flat.MatchPhase.Ended,
99+
_ => RLBot.Flat.MatchPhase.Inactive,
100100
};
101101

102102
MatchInfoT matchInfo = new()
@@ -170,7 +170,7 @@ public static GamePacketT ToFlatBuffers(this GameState gameState)
170170
Name = car.Name,
171171
Team = car.Team,
172172
Boost = car.Boost,
173-
SpawnId = car.SpawnId,
173+
PlayerId = car.PlayerId,
174174
ScoreInfo = new()
175175
{
176176
Score = car.ScoreInfo.Score,

RLBotCS/Conversion/PsyonixLoadouts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.Collections.Frozen;
2-
using rlbot.flat;
2+
using RLBot.Flat;
33

44
namespace RLBotCS.Conversion;
55

RLBotCS/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
if (args.Length > 0 && args[0] == "--version")
1010
{
11-
Console.WriteLine("RLBotServer v5.beta.6.12");
11+
Console.WriteLine("RLBotServer v5.beta.7.0");
1212
Environment.Exit(0);
1313
}
1414

RLBotCS/ManagerTools/AgentMapping.cs

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using rlbot.flat;
1+
using RLBot.Flat;
22
using RLBotCS.Model;
33

44
namespace RLBotCS.ManagerTools;
55

66
public struct PlayerIdPair
77
{
88
public uint Index;
9-
public int SpawnId;
9+
public int PlayerId;
1010
}
1111

1212
public class AgentMapping
@@ -22,25 +22,37 @@ public void SetAgents(MatchConfigurationT matchConfig)
2222
for (int i = 0; i < matchConfig.PlayerConfigurations.Count; i++)
2323
{
2424
var playerConfig = matchConfig.PlayerConfigurations[i];
25+
uint index = (uint)i - humans;
2526

26-
if (playerConfig.Variety.Type != PlayerClass.CustomBot)
27+
switch (playerConfig.Variety.Value)
2728
{
28-
if (playerConfig.Variety.Type == PlayerClass.Human)
29-
humans++;
30-
31-
continue;
29+
case HumanT:
30+
if (playerConfig.Variety.Type == PlayerClass.Human)
31+
humans++;
32+
break;
33+
case PsyonixBotT psy:
34+
_agents.Add(
35+
new AgentMetadata(
36+
index,
37+
playerConfig.Team,
38+
psy.Name,
39+
"psyonix/" + psy.BotSkill,
40+
playerConfig.PlayerId
41+
)
42+
);
43+
break;
44+
case CustomBotT bot:
45+
_agents.Add(
46+
new AgentMetadata(
47+
index,
48+
playerConfig.Team,
49+
bot.Name,
50+
bot.AgentId,
51+
playerConfig.PlayerId
52+
)
53+
);
54+
break;
3255
}
33-
34-
uint index = (uint)i - humans;
35-
_agents.Add(
36-
new AgentMetadata(
37-
index,
38-
playerConfig.Team,
39-
playerConfig.Name,
40-
playerConfig.AgentId,
41-
playerConfig.SpawnId
42-
)
43-
);
4456
}
4557

4658
// Scripts
@@ -53,7 +65,7 @@ public void SetAgents(MatchConfigurationT matchConfig)
5365
Team.Scripts,
5466
scriptConfig.Name,
5567
scriptConfig.AgentId,
56-
scriptConfig.SpawnId
68+
scriptConfig.ScriptId
5769
)
5870
);
5971
}
@@ -69,7 +81,7 @@ public void SetAgents(MatchConfigurationT matchConfig)
6981
player.SetClient(clientId);
7082

7183
return (
72-
new PlayerIdPair { Index = player.Index, SpawnId = player.SpawnId },
84+
new PlayerIdPair { Index = player.Index, PlayerId = player.PlayerId },
7385
player.Team
7486
);
7587
}
@@ -99,7 +111,7 @@ public void SetAgents(MatchConfigurationT matchConfig)
99111
new PlayerIdPair
100112
{
101113
Index = playerMetadata.Index,
102-
SpawnId = playerMetadata.SpawnId,
114+
PlayerId = playerMetadata.PlayerId,
103115
}
104116
);
105117
}

RLBotCS/ManagerTools/BallPredictor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.Runtime.InteropServices;
2-
using rlbot.flat;
2+
using RLBot.Flat;
33
using RLBotCS.Model;
44

55
namespace RLBotCS.ManagerTools;

0 commit comments

Comments
 (0)