Skip to content

remoteExec

ffredyk edited this page Jul 23, 2026 · 1 revision

remoteExec

Category

Multiplayer

Arity

Binary<args> remoteExec [commandName, target, isJip].

<any> remoteExec <array>   // [commandName, target, isJip]

Description

Schedules remote execution of a command on target machines. The left operand is passed as arguments. The right operand is an array:

  • commandName — string name of the command/function to execute
  • target — who executes it:
    • 0 = everyone
    • 2 = server only
    • -2 = everyone except server
    • Client ID = specific client
  • isJip — boolean: should Join-In-Progress clients also execute?

Uses spawn semantics (async). The command must be registered on the target machine.

Placeholder/stub — full networking implementation is the host's responsibility.

How It Works

Fires the host's remote execution event. The host must implement the actual network transport (UDP/TCP, serialization, client tracking). The command name and args are serialized and sent to target machines.

Usage

// Execute everywhere
[params] remoteExec ["fn_process", 0, false];

// Execute on server only
[data] remoteExec ["fn_saveToDB", 2, false];

// Execute everywhere except server
[notification] remoteExec ["fn_showHint", -2, false];

// Execute on specific client
[message] remoteExec ["fn_displayChat", _clientId, false];

Note: Full networking requires host implementation. See docs/multiplayer.md.

Thread Safety

Depends on host implementation. The stub is thread-safe.

See Also

SQ# Wiki

Home

Engine Docs

Migration

Commands

Value Constructors

Arithmetic

Comparison

Logic

Array

String

Math

Random

Type & Introspection

HashMap

Code Execution

Concurrency

Scheduler

Thread Safety

Error

Output

Time

Multiplayer

Compiler

Clone this wiki locally