remoteExecutedOwner: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\| *Exec *= * " to " ") |
Killzone Kid (talk | contribs) No edit summary |
||
(36 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| | |game1= arma3 | ||
|version1= 1.70 | |||
| | |gr1= Multiplayer | ||
| [[ | |descr= Returns the [[Multiplayer_Scripting#Machine_network_ID | machine network ID]] of the client that initiated [[Remote Execution]]. | ||
{{Feature|important| | |||
Running this command | |||
* in a Single Player environment | |||
* outside of a remote-executed context | |||
* in a remote-executed context received from a [[Arma 3: Headless Client|Headless Client]] | |||
will return '''0''' by design. To check if the context is remote executed, use [[isRemoteExecuted]] or [[isRemoteExecutedJIP]]. | |||
}} | |||
| [[ | |s1= [[remoteExecutedOwner]] | ||
|x1= < | |r1= [[Number]] - returns zero in the specific cases listed in the {{Link|#Description}} | ||
|x1= <sqf>private _callerRE = remoteExecutedOwner;</sqf> | |||
|x2= Send request to the server and get immediate response: | |x2= Send request to the server and get immediate response: | ||
< | <sqf> | ||
{ | |||
// in this scope, the remoteExecutedOwner equals clientOwner of the sender | |||
// so using it as target in remoteExec will send response right back at him | |||
[ | [ | ||
time, // mission time value on the server | |||
{ | { | ||
hint format | |||
[ | [ | ||
"Request | "Request received!\nMission time value on the server is: %1", | ||
_this | |||
]; | ]; | ||
} | } | ||
] | ] | ||
remoteExec ["call", remoteExecutedOwner]; // server response to the sender | |||
} | } | ||
remoteExec ["call", 2]; // send request to server | |||
</sqf> | |||
| [[isRemoteExecuted]] | |seealso= [[isRemoteExecuted]] [[isRemoteExecutedJIP]] [[remoteExecutedJIPID]] [[remoteExec]] [[remoteExecCall]] [[canSuspend]] [[publicVariableClient]] [[admin]] [[owner]] [[clientOwner]] [[groupOwner]] [[didJIPOwner]] | ||
}} | }} | ||
{{GameCategory|arma3|Remote Execution}} | |||
{{ | {{Note | ||
|user= Demellion | |||
|timestamp= 20170911093100 | |||
|text= Always be sure to check if the [[remoteExecutedOwner]] is not equal to 0 when sending a [[remoteExec]]/[[remoteExecCall]] packet back, as this will result in sending packet to ANYONE (0): | |||
<sqf> | |||
if (remoteExecutedOwner isEqualTo 0) exitWith {}; // invalid RE owner | |||
_gearArray remoteExecCall ['someGearFunction', remoteExecutedOwner]; | |||
</sqf> | |||
< | |||
_gearArray | |||
Will prevent from code being accidentally sent to everyone on the server. | Will prevent from code being accidentally sent to everyone on the server. | ||
}} | |||
Latest revision as of 13:57, 14 July 2024
Description
- Description:
- Returns the machine network ID of the client that initiated Remote Execution.
- Groups:
- Multiplayer
Syntax
- Syntax:
- remoteExecutedOwner
- Return Value:
- Number - returns zero in the specific cases listed in the Description
Examples
- Example 1:
- Example 2:
- Send request to the server and get immediate response:
{ // in this scope, the remoteExecutedOwner equals clientOwner of the sender // so using it as target in remoteExec will send response right back at him [ time, // mission time value on the server { hint format [ "Request received!\nMission time value on the server is: %1", _this ]; } ] remoteExec ["call", remoteExecutedOwner]; // server response to the sender } remoteExec ["call", 2]; // send request to server
Additional Information
- See also:
- isRemoteExecuted isRemoteExecutedJIP remoteExecutedJIPID remoteExec remoteExecCall canSuspend publicVariableClient admin owner clientOwner groupOwner didJIPOwner
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on Sep 11, 2017 - 09:31 (UTC)
-
Always be sure to check if the remoteExecutedOwner is not equal to 0 when sending a remoteExec/remoteExecCall packet back, as this will result in sending packet to ANYONE (0):
Will prevent from code being accidentally sent to everyone on the server.if (remoteExecutedOwner isEqualTo 0) exitWith {}; // invalid RE owner _gearArray remoteExecCall ['someGearFunction', remoteExecutedOwner];