Skip to content
Open
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
1 change: 0 additions & 1 deletion frontend/src/components/BotList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ function filterBots(
}

function scriptDuplicateAgentIdWarning(d: ToggleableScript): string | null {

const agentId = d.info.config.settings.agentId;

if (!agentId) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Teams/TeamBotList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import cannotAutoRunIcon from "../../assets/cannot_play.svg";
import defaultIcon from "../../assets/rlbot_mono.png";

import PlayerOverridesModal from "./PlayerOverridesModal.svelte";
import {Browser} from "@wailsio/runtime";
import { Browser } from "@wailsio/runtime";
import warningIcon from "../../assets/exclamation-triangle-fill.svg";

let {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function collectDuplicateAgentIds(
bots: DraggablePlayer[],
scripts: ToggleableScript[],
): Set<string> {
const agentIdTomlMap: { [id: string]: string } = {}
const agentIdTomlMap: { [id: string]: string } = {};
const duplicateAgentIds = new Set<string>();

for (const bot of bots) {
Expand Down
11 changes: 11 additions & 0 deletions players.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ func (botInfo BotInfo) ToPlayerConfig(team uint32) *flat.PlayerConfigurationT {
Hivemind: botInfo.Config.Settings.Hivemind,
}

// Add environment variables from the bot's config toml first
for k, v := range botInfo.Config.Settings.Environment {
customBot.Environment = append(customBot.Environment, &flat.EnvironmentVariableT{
Name: k,
Value: v,
})
}

// Then append torch paths (if found) so they combine properly with any toml-specified paths
setTorchEnv(botInfo.TomlPath, &customBot.Environment)

return &flat.PlayerConfigurationT{
Expand Down Expand Up @@ -279,6 +288,8 @@ type BotSettings struct {
RunCommandLinux string `toml:"run_command_linux" json:"runCommandLinux"`
// If bot can handle multiple agents with one client
Hivemind bool `toml:"hivemind" json:"hivemind"`
// Additional environment variables to set for the bot process
Environment map[string]string `toml:"environment" json:"environment"`
}

type BotDetails struct {
Expand Down
9 changes: 9 additions & 0 deletions scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ func (botInfo BotInfo) ToScriptConfig() *flat.ScriptConfigurationT {
ScriptId: 0, // let core do this
}

// Add environment variables from the script's config toml first
for k, v := range botInfo.Config.Settings.Environment {
scriptConfig.Environment = append(scriptConfig.Environment, &flat.EnvironmentVariableT{
Name: k,
Value: v,
})
}

// Then append torch paths (if found) so they combine properly with any toml-specified paths
setTorchEnv(botInfo.TomlPath, &scriptConfig.Environment)

return scriptConfig
Expand Down