Repository navigation
Run game commands from standard input outside headless mode - #670
Merged
Merged
Conversation
…lyConfig.EnableCommandConsole or PIXELY_COMMAND_CONSOLE
|
📦 Development package |
|
✅ Development package validation passed on all platforms. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A game's
AutomationCommands ran only in headless mode. This lets a game run them, for example cheats, from standard input while it runs normally: windows shown, physical input, real clock.Typing
godand Enter in the terminal ofdotnet runthen runs the command in the next frame.API
PixelyConfig.EnableCommandConsole, the last constructor parameter, false by default.PIXELY_COMMAND_CONSOLEoverrides it, with the same values as the other booleanPIXELY_*variables.Behavior
AutomationCommandConsoleruns atUpdateOrders.Input, like the headless console.;.@<n>, andquitrun. The built-in input,screenshotandwaitcommands are unknown here.@<n>, or aFormatExceptionfromExecuteis written to standard error and the app goes on. Any other exception ends the app, as in headless mode.PixelyConfig.Headlessthe setting does nothing, because headless mode has its own console. In the browser it does nothing either: the console is not registered there, and the setting raises no error.The
@<n>parsing and game command dispatch moved fromInputAutomationCommandInterpretertoAutomationCommandRegistry, so both consoles share them. Headless behavior is unchanged.Not included
The reading thread is not stopped when the app is disposed. A read blocked on a terminal cannot be cancelled, and the thread is a background thread, so it does not keep the process alive. It matters only for a process that runs a second app with the console on.