sendCommand
sendCommand<
Handle>(world,handle,payload, …optionsArguments):Promise<SettledCommandResult<Handle>>
Sends the player’s command under handle and resolves with its one
result: await sendCommand(world, city.commands.place, { tile, kind: "house" }). In a room it goes to the room the world is fed from; in a
game played alone, through the same queue, checks and results, to its
own next step. The promise never rejects: accepted with the value the
handle returns, refused with a reason from RefusalOf<handle>, or, in
a room, Unknown where her page lost the room before the result came,
so a game reads the state again rather than tell her it failed. Her
page refuses at once what it can check as the room would:
not-controlled for an entity she does not control, malformed for a
field out of its kind or a payload past maximumPayloadBytes,
too-fast by the room’s own credit, and too-many past 64 commands
with no result. Throws for a handle no listed plugin declares. As
Roblox’s RemoteFunction:InvokeServer, with a typed refusal and a
result that always arrives.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Handle extends AnyCommandHandle |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
handle |
Handle |
payload |
PayloadOf<Handle> |
…optionsArguments |
OptionsArguments<Handle> |
Returns
Section titled “Returns”Promise<SettledCommandResult<Handle>>