This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
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.
In non-blocking mode, BWEnv will block the game for a specified maximum amount
of time only before continuing. This enables abiding time limits for a given
match-up without adding complicated timing logic to the TorchCraft client
program.
If the client does not send commands for the current frame back in time (e.g.
receive in BWEnv times out), the game continues and a new attempt to receive
them will take place in the very next frame and so on until we finally get a
reply. If BWEnv absolutely has to send the frame (e.g. the game or battle is
over), it will perform a blocking receive call before sending it to abide the
REQ/REP pattern.
Please note the interplay with the SET_COMBINE_FRAMES option: BWEnv can only
send frame data to the client after having a received a message with commands.
Hence, if it is unable to send new frame data it will keep combining frames and
eventually send the combined frame in the next execution of
Controller::onFrame()
after the successful receive. Hence, SET_COMBINE_FRAMESdefines a minimum number of combined frames for non-blocking mode.
The default behavior is blocking mode (i.e. the same as before). It can be
enabled specifically via the new SET_BLOCKING command. The timeout can also be
set via a new command; by default it's 50ms.