CommandBridge 1.7.1 Help

Command Execution Examples

Below, you'll find demonstrations of how different commands are processed and visualized within a system using a Velocity network framework. This setup includes two backend servers: lobby and hub. To reload the configuration, use cb reload or commandbridge reload.

Delayed Commands

This section illustrates the handling of delayed commands within the system. Commands can be scheduled for later execution using the scheduler, where the delay is specified in seconds. In this example, the command is set to execute after a 3-second delay. The execution takes place on the lobby server, with other configurations disabled.

Delayed Commands

# Example of a delayed command name: examplecommand enabled: true commands: - command: 'say I love Coding!' delay: 3 # 3 seconds delay target-server-id: 'lobby' target-executor: 'player' wait-until-player-is-online: false disable-check-if-executor-is-player: false disable-check-if-executor-is-on-server: false

Multiple Commands

This animation demonstrates the execution of several commands in sequence, each set to execute immediately with no delay. These commands are processed on the lobby server, executed in the exact order as defined in the configuration file. This example highlights the system's ability to handle multiple, simultaneous command executions efficiently.

Multiply Commands

# Example of multiple commands executed simultaneously name: multicommands enabled: true commands: - command: 'first command' delay: 0 # No delay target-server-id: 'lobby' target-executor: 'player' wait-until-player-is-online: false disable-check-if-executor-is-player: false disable-check-if-executor-is-on-server: false - command: 'second command' delay: 0 # No delay target-server-id: 'lobby' target-executor: 'player' wait-until-player-is-online: false disable-check-if-executor-is-player: false disable-check-if-executor-is-on-server: false - command: 'third command' delay: 0 # No delays how commands are str uence of operations ov target-server-id: 'lobby' target-executor: 'player' wait-until-player-is-online: false disable-check-if-executor-is-player: false disable-check-if-executor-is-on-server: false

Multiple Commands with Delay

This animation showcases the execution of multiple commands with specified delays between each. It highlights how commands are strategically scheduled over time to ensure orderly processing. The commands are configured to run on the lobby server, with non-relevant configurations disabled for clarity. Each command is executed in the order specified in the configuration file, but only after the designated delay has elapsed, demonstrating the system's capacity to manage timed operations effectively.

Multiply Commands with Delay

# Example of multiple commands with delays name: multicommands enabled: true commands: - command: 'first command with 1sec delay' delay: 1 # 1 second delay target-server-id: 'lobby' target-executor: 'player' wait-until-player-is-online: false disable-check-if-executor-is-player: false disable-check-if-executor-is-on-server: false - command: 'second command with 2sec delay' delay: 2 # 2 seconds delay target-server-id: 'lobby' target-executor: 'player' wait-until-player-is-online: false disable-check-if-executor-is-player: false disable-check-if-executor-is-on-server: false - command: 'third command with 3sec delay' delay: 3 # 3 seconds delay target-server-id: 'lobby' target-executor: 'player' wait-until-player-is-online: false disable-check-if-executor-is-player: false disable-check-if-executor-is-on-server: false

Player is not on target Server

This example shows the system response when a player attempts to execute a command but is not currently located on the target server.

Player is not on target Server

# Handling when player is not on the target server name: examplecommand enabled: true commands: - command: 'I love Coding!' delay: 0 target-server-id: 'hub' target-executor: 'player' wait-until-player-is-online: false disable-check-if-executor-is-player: false disable-check-if-executor-is-on-server: false

You can disable the check by changing the following config to true:

disable-check-if-executor-is-on-server: true

Timeout Reached for Waiting

This image illustrates the system's behavior when a command, awaiting a player's action, reaches its timeout limit. Implementing a timeout is crucial for maintaining server performance; without it, commands waiting for offline players could indefinitely delay execution, only ceasing if the server shuts down. This setup ensures that operations do not hang and system resources are managed efficiently.

Timeout Reached for Waiting

Wait until player is on target Server

This example demonstrates the system waiting for the player to be detected on the target server (in this case the server hub) before executing further commands.

Wait until player is on target Server

# Command that waits for player to be online on the target server name: examplecommand enabled: true commands: - command: 'say Welcome!' delay: 0 target-server-id: 'hub' target-executor: 'player' wait-until-player-is-online: true disable-check-if-executor-is-player: false disable-check-if-executor-is-on-server: false

Wait until Player is Online - Console Perspective

This animation displays the console's viewpoint as it waits for a player to come online before executing commands. The console will provide detailed feedback on the status of the command and the player's connectivity only if the VerboseLogging feature is enabled. This feature is essential for troubleshooting and ensures transparent communication about command processing delays and player availability.

Wait until player is online CONSOLE

Disable Player Check

For scenarios where it is necessary to bypass the check determining if the executor is a player, the following configuration can be used:

disable-check-if-executor-is-player: true

This revision clarifies the purpose and application of disabling player checks, making it relevant for situations involving alternative executors like consoles or NPCs.

Last modified: 25 August 2024