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
141 changes: 140 additions & 1 deletion RLBotCS/Conversion/FlatToCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ private static string MapMaxScore(MaxScoreMutator maxScore) =>
MaxScoreMutator.ThreeGoals => "Max3",
MaxScoreMutator.FiveGoals => "Max5",
MaxScoreMutator.SevenGoals => "Max7",
MaxScoreMutator.TenGoals => "Max10",
MaxScoreMutator.TwentyGoals => "Max20",
MaxScoreMutator.ThirtyGoals => "Max30",
MaxScoreMutator.FortyGoals => "Max40",
MaxScoreMutator.FiftyGoals => "Max50",
MaxScoreMutator.SixtyGoals => "Max60",
MaxScoreMutator.SeventyGoals => "Max70",
MaxScoreMutator.EightyGoals => "Max80",
MaxScoreMutator.NinetyGoals => "Max90",
MaxScoreMutator.HundredGoals => "Max100",
MaxScoreMutator.Unlimited => "UnlimitedScore",
_ => throw new ArgumentOutOfRangeException(nameof(maxScore), maxScore, null),
};
Expand Down Expand Up @@ -104,6 +114,10 @@ private static string MapBallType(BallTypeMutator option) =>
BallTypeMutator.Haunted => "Ball_Haunted",
BallTypeMutator.Ekin => "Ball_Ekin",
BallTypeMutator.SpookyCube => "Ball_SpookyCube",
BallTypeMutator.Egg => "Ball_Egg",
BallTypeMutator.PlayerSeeking => "Ball_Fire",
BallTypeMutator.Dropshot => "Ball_Breakout",
BallTypeMutator.ScoreAbsorb => "Ball_Score",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

Expand Down Expand Up @@ -138,7 +152,7 @@ private static string MapBallBounciness(BallBouncinessMutator option) =>
BallBouncinessMutator.Low => "LowBounciness",
BallBouncinessMutator.High => "HighBounciness",
BallBouncinessMutator.SuperHigh => "SuperBounciness",
BallBouncinessMutator.LowishBounciness => "LowishBounciness",
BallBouncinessMutator.Lowish => "LowishBounciness",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

Expand Down Expand Up @@ -167,6 +181,8 @@ private static string MapRumble(RumbleMutator option) =>
RumbleMutator.HauntedBallBeam => "ItemsModeHauntedBallBeam",
RumbleMutator.Tactical => "ItemsModeSelection",
RumbleMutator.BatmanRumble => "ItemsMode_BM",
RumbleMutator.GrapplingOnly => "ItemsModeGrapplingHooks",
RumbleMutator.HaymakerOnly => "ItemsModeBoxingGloves",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

Expand Down Expand Up @@ -200,6 +216,8 @@ private static string MapDemolish(DemolishMutator option) =>
DemolishMutator.FriendlyFire => "DemolishAll",
DemolishMutator.OnContact => "AlwaysDemolishOpposing",
DemolishMutator.OnContactFF => "AlwaysDemolish",
DemolishMutator.OnBallContact => "TeamDemoBall",
DemolishMutator.OnBallContactFF => "FFADemoBall",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

Expand Down Expand Up @@ -238,6 +256,117 @@ private static string MapAudio(AudioMutator option) =>
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapBallGravity(BallGravityMutator option) =>
option switch
{
BallGravityMutator.Default => "",
BallGravityMutator.Low => "LowGravityBall",
BallGravityMutator.High => "HighGravityBall",
BallGravityMutator.SuperHigh => "SuperGravityBall",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapTerritory(TerritoryMutator option) =>
option switch
{
TerritoryMutator.Default => "",
TerritoryMutator.Territory => "Territory",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapStaleBall(StaleBallMutator option) =>
option switch
{
StaleBallMutator.Default => "",
StaleBallMutator.ThirtySeconds => "ThirtySeconds",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapJump(JumpMutator option) =>
option switch
{
JumpMutator.Default => "",
JumpMutator.Grounded => "Grounded",
JumpMutator.Two => "2DoubleJumps",
JumpMutator.Three => "3DoubleJumps",
JumpMutator.Four => "4DoubleJumps",
JumpMutator.Unlimited => "UnlimitedJumps",
JumpMutator.NoJumps => "NoJumps",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapDodgeTimer(DodgeTimerMutator option) =>
option switch
{
DodgeTimerMutator.Default => "",
DodgeTimerMutator.TwoSeconds => "DodgeTwoSeconds",
DodgeTimerMutator.ThreeSeconds => "DodgeThreeSeconds",
DodgeTimerMutator.Unlimited => "DodgeUnlimitedSeconds",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapPossessionScore(PossessionScoreMutator option) =>
option switch
{
PossessionScoreMutator.Default => "",
PossessionScoreMutator.OneSecond => "Possession1Second",
PossessionScoreMutator.TwoSeconds => "Possession2Seconds",
PossessionScoreMutator.ThreeSeconds => "Possession3Seconds",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapDemolishScore(DemolishScoreMutator option) =>
option switch
{
DemolishScoreMutator.Default => "",
DemolishScoreMutator.One => "DemolishScore1",
DemolishScoreMutator.Two => "DemolishScore2",
DemolishScoreMutator.Three => "DemolishScore3",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapNormalGoalScore(NormalGoalScoreMutator option) =>
option switch
{
NormalGoalScoreMutator.Default => "",
NormalGoalScoreMutator.Zero => "GoalScore0",
NormalGoalScoreMutator.Two => "GoalScore2",
NormalGoalScoreMutator.Three => "GoalScore3",
NormalGoalScoreMutator.Five => "GoalScore5",
NormalGoalScoreMutator.Ten => "GoalScore10",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapAerialGoalScore(AerialGoalScoreMutator option) =>
option switch
{
AerialGoalScoreMutator.Default => "",
AerialGoalScoreMutator.Zero => "AerialGoalScore0",
AerialGoalScoreMutator.Two => "AerialGoalScore2",
AerialGoalScoreMutator.Three => "AerialGoalScore3",
AerialGoalScoreMutator.Five => "AerialGoalScore5",
AerialGoalScoreMutator.Ten => "AerialGoalScore10",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapAssistGoalScore(AssistGoalScoreMutator option) =>
option switch
{
AssistGoalScoreMutator.Default => "",
AssistGoalScoreMutator.One => "AssistScore1",
AssistGoalScoreMutator.Two => "AssistScore2",
AssistGoalScoreMutator.Three => "AssistScore3",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string MapInputRestriction(InputRestrictionMutator option) =>
option switch
{
InputRestrictionMutator.Default => "",
InputRestrictionMutator.Backwards => "BackwardsMode",
_ => throw new ArgumentOutOfRangeException(nameof(option), option, null),
};

private static string GetOption(string option)
{
if (option != "")
Expand Down Expand Up @@ -301,6 +430,16 @@ public static string MakeOpenCommand(MatchConfigurationT matchConfig)
command += GetOption(MapMaxTime(mutatorSettings.MaxTime));
command += GetOption(MapGameEvent(mutatorSettings.GameEvent));
command += GetOption(MapAudio(mutatorSettings.Audio));
command += GetOption(MapBallGravity(mutatorSettings.BallGravity));
command += GetOption(MapTerritory(mutatorSettings.Territory));
command += GetOption(MapStaleBall(mutatorSettings.StaleBall));
command += GetOption(MapJump(mutatorSettings.Jump));
command += GetOption(MapDodgeTimer(mutatorSettings.DodgeTimer));
command += GetOption(MapPossessionScore(mutatorSettings.PossessionScore));
command += GetOption(MapDemolishScore(mutatorSettings.DemolishScore));
command += GetOption(MapNormalGoalScore(mutatorSettings.NormalGoalScore));
command += GetOption(MapAerialGoalScore(mutatorSettings.AerialGoalScore));
command += GetOption(MapAssistGoalScore(mutatorSettings.AssistGoalScore));

return command;
}
Expand Down
2 changes: 1 addition & 1 deletion RLBotCS/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

if (args.Length > 0 && args[0] == "--version")
{
Console.WriteLine("RLBotServer v5.beta.4.8");
Console.WriteLine("RLBotServer v5.beta.4.9");
Environment.Exit(0);
}

Expand Down
62 changes: 62 additions & 0 deletions RLBotCS/ManagerTools/ConfigParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ public static class Fields
public const string MutatorsMaxTime = "max_time";
public const string MutatorsGameEvent = "game_event";
public const string MutatorsAudio = "audio";
public const string MutatorsBallGravity = "ball_gravity";
public const string MutatorsTerritory = "territory";
public const string MutatorsStaleBall = "stale_ball";
public const string MutatorsJump = "jump";
public const string MutatorsDodgeTimer = "dodge_timer";
public const string MutatorsPossessionScore = "possession_score";
public const string MutatorsDemolishScore = "demolish_score";
public const string MutatorsNormalGoalScore = "normal_goal_score";
public const string MutatorsAerialGoalScore = "aerial_goal_score";
public const string MutatorsAssistGoalScore = "assist_goal_score";
public const string MutatorsInputRestriction = "input_restriction";

public const string CarsList = "cars";
public const string ScriptsList = "scripts";
Expand Down Expand Up @@ -520,6 +531,57 @@ private MutatorSettingsT GetMutatorSettings(TomlTable mutatorTable) =>
GameEventMutator.Default
),
Audio = GetEnum(mutatorTable, Fields.MutatorsAudio, AudioMutator.Default),
BallGravity = GetEnum(
mutatorTable,
Fields.MutatorsBallGravity,
BallGravityMutator.Default
),
Territory = GetEnum(
mutatorTable,
Fields.MutatorsTerritory,
TerritoryMutator.Default
),
StaleBall = GetEnum(
mutatorTable,
Fields.MutatorsStaleBall,
StaleBallMutator.Default
),
Jump = GetEnum(mutatorTable, Fields.MutatorsJump, JumpMutator.Default),
DodgeTimer = GetEnum(
mutatorTable,
Fields.MutatorsDodgeTimer,
DodgeTimerMutator.Default
),
PossessionScore = GetEnum(
mutatorTable,
Fields.MutatorsPossessionScore,
PossessionScoreMutator.Default
),
DemolishScore = GetEnum(
mutatorTable,
Fields.MutatorsDemolishScore,
DemolishScoreMutator.Default
),
NormalGoalScore = GetEnum(
mutatorTable,
Fields.MutatorsNormalGoalScore,
NormalGoalScoreMutator.Default
),
AerialGoalScore = GetEnum(
mutatorTable,
Fields.MutatorsAerialGoalScore,
AerialGoalScoreMutator.Default
),
AssistGoalScore = GetEnum(
mutatorTable,
Fields.MutatorsAssistGoalScore,
AssistGoalScoreMutator.Default
),
InputRestriction = GetEnum(
mutatorTable,
Fields.MutatorsInputRestriction,
InputRestrictionMutator.Default
),
};

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion flatbuffers-schema