Skip to content

Commit 4568151

Browse files
authored
Merge pull request #115 from RLBot/v0.7
Update to the newest schema
2 parents 1b43455 + e917369 commit 4568151

Some content is hidden

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

49 files changed

+263
-418
lines changed

RLBotCS/Conversion/FlatToCommand.cs

Lines changed: 1 addition & 1 deletion
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;

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.10");
11+
Console.WriteLine("RLBotServer v5.beta.7.0");
1212
Environment.Exit(0);
1313
}
1414

RLBotCS/ManagerTools/AgentMapping.cs

Lines changed: 6 additions & 6 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
@@ -38,7 +38,7 @@ public void SetAgents(MatchConfigurationT matchConfig)
3838
playerConfig.Team,
3939
playerConfig.Name,
4040
playerConfig.AgentId,
41-
playerConfig.SpawnId
41+
playerConfig.PlayerId
4242
)
4343
);
4444
}
@@ -53,7 +53,7 @@ public void SetAgents(MatchConfigurationT matchConfig)
5353
Team.Scripts,
5454
scriptConfig.Name,
5555
scriptConfig.AgentId,
56-
scriptConfig.SpawnId
56+
scriptConfig.ScriptId
5757
)
5858
);
5959
}
@@ -69,7 +69,7 @@ public void SetAgents(MatchConfigurationT matchConfig)
6969
player.SetClient(clientId);
7070

7171
return (
72-
new PlayerIdPair { Index = player.Index, SpawnId = player.SpawnId },
72+
new PlayerIdPair { Index = player.Index, PlayerId = player.PlayerId },
7373
player.Team
7474
);
7575
}
@@ -99,7 +99,7 @@ public void SetAgents(MatchConfigurationT matchConfig)
9999
new PlayerIdPair
100100
{
101101
Index = playerMetadata.Index,
102-
SpawnId = playerMetadata.SpawnId,
102+
PlayerId = playerMetadata.PlayerId,
103103
}
104104
);
105105
}

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;

RLBotCS/ManagerTools/ConfigParser.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Diagnostics;
2-
using System.Runtime.InteropServices;
32
using Microsoft.Extensions.Logging;
4-
using rlbot.flat;
3+
using RLBot.Flat;
54
using RLBotCS.Model;
65
using Tomlyn;
76
using Tomlyn.Model;
@@ -346,7 +345,7 @@ private PlayerConfigurationT ParseCarTable(TomlTable table, string matchConfigPa
346345
Hivemind = false,
347346
RootDir = "",
348347
RunCommand = "",
349-
SpawnId = 0,
348+
PlayerId = 0,
350349
};
351350
}
352351

@@ -409,7 +408,7 @@ private PlayerConfigurationT LoadPlayerConfig(
409408
RunCommand = GetRunCommand(settings),
410409
Hivemind = GetValue(settings, Fields.AgentHivemind, false),
411410
RootDir = rootDir,
412-
SpawnId = 0,
411+
PlayerId = 0,
413412
Variety = variety,
414413
};
415414
}

RLBotCS/ManagerTools/ConfigValidator.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.Conversion;
44
using RLBotCS.Model;
55

@@ -161,7 +161,7 @@ List<PlayerConfigurationT> players
161161
break;
162162
}
163163

164-
player.SpawnId =
164+
player.PlayerId =
165165
player.Variety.Type == PlayerClass.Human
166166
? 0
167167
: $"{player.AgentId}/{player.Team}/{i}".GetHashCode();
@@ -209,7 +209,7 @@ List<ScriptConfigurationT> scripts
209209
script.Name ??= "";
210210
script.RunCommand ??= "";
211211
script.RootDir ??= "";
212-
script.SpawnId = $"{script.AgentId}/{Team.Scripts}/{i}".GetHashCode();
212+
script.ScriptId = $"{script.AgentId}/{Team.Scripts}/{i}".GetHashCode();
213213
}
214214

215215
return valid;

RLBotCS/ManagerTools/LaunchManager.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private static void LaunchGameViaHeroic()
154154
}
155155

156156
public static void LaunchBots(
157-
List<rlbot.flat.PlayerConfigurationT> bots,
157+
List<RLBot.Flat.PlayerConfigurationT> bots,
158158
int rlbotSocketsPort
159159
)
160160
{
@@ -199,7 +199,7 @@ int rlbotSocketsPort
199199
}
200200

201201
public static void LaunchScripts(
202-
List<rlbot.flat.ScriptConfigurationT> scripts,
202+
List<RLBot.Flat.ScriptConfigurationT> scripts,
203203
int rlbotSocketsPort
204204
)
205205
{
@@ -246,15 +246,15 @@ int rlbotSocketsPort
246246
}
247247

248248
public static void LaunchRocketLeague(
249-
rlbot.flat.Launcher launcherPref,
249+
RLBot.Flat.Launcher launcherPref,
250250
string extraArg,
251251
int gamePort
252252
)
253253
{
254254
#if WINDOWS
255255
switch (launcherPref)
256256
{
257-
case rlbot.flat.Launcher.Steam:
257+
case RLBot.Flat.Launcher.Steam:
258258
string steamPath = GetWindowsSteamPath();
259259
Process steam = new();
260260
steam.StartInfo.FileName = steamPath;
@@ -266,7 +266,7 @@ int gamePort
266266
);
267267
steam.Start();
268268
break;
269-
case rlbot.flat.Launcher.Epic:
269+
case RLBot.Flat.Launcher.Epic:
270270
bool nonRLBotGameRunning = IsRocketLeagueRunning();
271271

272272
// we don't need to start the game because there's another instance of non-rlbot rocket league open
@@ -333,7 +333,7 @@ int gamePort
333333
}).Start();
334334

335335
break;
336-
case rlbot.flat.Launcher.Custom:
336+
case RLBot.Flat.Launcher.Custom:
337337
if (extraArg.ToLower() == "legendary")
338338
{
339339
LaunchGameViaLegendary();
@@ -346,13 +346,13 @@ int gamePort
346346
}
347347

348348
throw new NotSupportedException($"Unexpected launcher, \"{extraArg}\"");
349-
case rlbot.flat.Launcher.NoLaunch:
349+
case RLBot.Flat.Launcher.NoLaunch:
350350
break;
351351
}
352352
#else
353353
switch (launcherPref)
354354
{
355-
case rlbot.flat.Launcher.Steam:
355+
case RLBot.Flat.Launcher.Steam:
356356
string args = string.Join("%20", GetIdealArgs(gamePort));
357357
Process rocketLeague = new();
358358
rocketLeague.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
@@ -364,11 +364,11 @@ int gamePort
364364
);
365365
rocketLeague.Start();
366366
break;
367-
case rlbot.flat.Launcher.Epic:
367+
case RLBot.Flat.Launcher.Epic:
368368
throw new NotSupportedException(
369369
"Epic Games Store is not directly supported on Linux."
370370
);
371-
case rlbot.flat.Launcher.Custom:
371+
case RLBot.Flat.Launcher.Custom:
372372
if (extraArg.ToLower() == "legendary")
373373
{
374374
LaunchGameViaLegendary();
@@ -381,7 +381,7 @@ int gamePort
381381
}
382382

383383
throw new NotSupportedException($"Unexpected launcher, \"{extraArg}\"");
384-
case rlbot.flat.Launcher.NoLaunch:
384+
case RLBot.Flat.Launcher.NoLaunch:
385385
break;
386386
}
387387
#endif

0 commit comments

Comments
 (0)