New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utility and server: Get mod search paths from env MOD_SEARCH_PATHS #12828

Merged
merged 2 commits into from Apr 14, 2017

Conversation

Projects
None yet
3 participants
@Phrohdoh
Member

Phrohdoh commented Feb 21, 2017

This will allow thirdparty game developers to write and invoke custom and shipped utility commands.

The mod template will want this so it can wrap the utility in a shell script like the example below.

# utility.sh in the mod template
MODLAUNCHER=$(python -c "import os; print(os.path.realpath('$0'))")
MOD_ROOT=$(dirname "$MODLAUNCHER")
ENGINE_ROOT="$MOD_ROOT/engine"

MOD_SEARCH_PATHS="$ENGINE_ROOT/mods,$MOD_ROOT/mods" mono ./engine/OpenRA.Utility.exe "$@"
$ ./utility.sh
Run `OpenRA.Utility.exe [MOD]` to see a list of available commands.
The available mods are: all, cnc, d2k, modchooser, ra, ts, ra2

$ ./utility.sh ra2 | grep "import.*map"
  --import-ra-map FILENAME
  --import-td-map FILENAME
  --import-ts-map FILENAME
thill@tmba /Users/.../openra $ MOD_SEARCH_PATHS=. orautil
Run `OpenRA.Utility.exe [MOD]` to see a list of available commands.
The available mods are:

thill@tmba /Users/.../openra $ MOD_SEARCH_PATHS=./mods orautil
Run `OpenRA.Utility.exe [MOD]` to see a list of available commands.
The available mods are: all, cnc, d2k, modchooser, ra, ts

thill@tmba /Users/.../openra $ orautil
Run `OpenRA.Utility.exe [MOD]` to see a list of available commands.
The available mods are: all, cnc, d2k, modchooser, ra, ts

thill@tmba /Users/.../openra-ra2 $ MOD_SEARCH_PATHS=$(pwd)/mods,$(pwd)/engine/mods orautil
Run `OpenRA.Utility.exe [MOD]` to see a list of available commands.
The available mods are: ra2, all, cnc, d2k, modchooser, ra, ts

@Phrohdoh Phrohdoh referenced this pull request Feb 21, 2017

Closed

Add utility.sh #2

@Phrohdoh Phrohdoh changed the title from Add 'Engine.ModSearchPaths' support to the utility to Utility: Get mod search paths from env MOD_SEARCH_PATHS Mar 11, 2017

@Phrohdoh

This comment has been minimized.

Show comment
Hide comment
@Phrohdoh

Phrohdoh Mar 11, 2017

Member

This has been updated to get the search path from the environment variable MOD_SEARCH_PATHS.

Member

Phrohdoh commented Mar 11, 2017

This has been updated to get the search path from the environment variable MOD_SEARCH_PATHS.

Comments addressed.

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Mar 12, 2017

Member

Could you please make the same changes to the dedicated server exe?

Member

pchote commented Mar 12, 2017

Could you please make the same changes to the dedicated server exe?

@Phrohdoh

This comment has been minimized.

Show comment
Hide comment
@Phrohdoh
Member

Phrohdoh commented Mar 13, 2017

@pchote done.

@Phrohdoh Phrohdoh changed the title from Utility: Get mod search paths from env MOD_SEARCH_PATHS to Utility and server: Get mod search paths from env MOD_SEARCH_PATHS Mar 13, 2017

@pchote

pchote approved these changes Apr 2, 2017

Works as advertised, and good to merge with the simplification suggested above

@pchote pchote requested review from chrisforbes, obrakmann and atlimit8 Apr 9, 2017

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote Apr 14, 2017

Member

Can we please get a second review here? This is holding up work on the mod template.

Member

pchote commented Apr 14, 2017

Can we please get a second review here? This is holding up work on the mod template.

@obrakmann

👍

@obrakmann obrakmann merged commit 63e4fbc into OpenRA:bleed Apr 14, 2017

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@obrakmann

This comment has been minimized.

Show comment
Hide comment
@obrakmann
Contributor

obrakmann commented Apr 14, 2017

@Phrohdoh Phrohdoh deleted the Phrohdoh:util-engine-mod-search-paths branch Apr 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment