remoteExecutedOwner: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>_([a-zA-Z0-9_]+) = \[\[([a-zA-Z0-9]+)\]\];?<\/code>" to "<sqf>_$1 = $2;</sqf>")
m (Some wiki formatting)
Line 7: Line 7:


|descr= Returns the [[Multiplayer_Scripting#Machine_network_ID | machine network ID]] of the client that initiated [[Remote Execution]]. If used in SP or outside of remote executed context, the command returns 0.
|descr= Returns the [[Multiplayer_Scripting#Machine_network_ID | machine network ID]] of the client that initiated [[Remote Execution]]. If used in SP or outside of remote executed context, the command returns 0.
{{Feature | Informative | To check if the context is remote executed, use [[isRemoteExecuted]] or [[isRemoteExecutedJIP]].}}
{{Feature|informative|To check if the context is remote executed, use [[isRemoteExecuted]] or [[isRemoteExecutedJIP]].}}


|s1= [[remoteExecutedOwner]]
|s1= [[remoteExecutedOwner]]
Line 13: Line 13:
|r1= [[Number]]
|r1= [[Number]]


|x1= <sqf>_callerRE = remoteExecutedOwner;</sqf>
|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:
<code>{
<sqf>
{{cc|in this scope, the remoteExecutedOwner equals clientOwner of the sender}}
{
{{cc|so using it as target in remoteExec will send response right back at him}}
// 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]], {{cc|mission time value on the server}}
time, // mission time value on the server
{
{
[[hint]] [[format]]
hint format
[
[
"Request recieved!\nMission time value on the server is: %1",
"Request recieved!\nMission time value on the server is: %1",
[[Magic Variables#this|_this]]
_this
];
];
}
}
]
]
[[remoteExec]] ["call", [[remoteExecutedOwner]]]; {{cc|server response to the sender}}
remoteExec ["call", remoteExecutedOwner]; // server response to the sender
}  
}  
[[remoteExec]] ["call", 2]; {{cc|send request to server}}</code>
remoteExec ["call", 2]; // send request to server
</sqf>


|seealso= [[isRemoteExecuted]] [[isRemoteExecutedJIP]] [[remoteExec]] [[remoteExecCall]] [[canSuspend]] [[publicVariableClient]] [[admin]] [[owner]] [[clientOwner]] [[groupOwner]] [[didJIPOwner]]
|seealso= [[isRemoteExecuted]] [[isRemoteExecutedJIP]] [[remoteExec]] [[remoteExecCall]] [[canSuspend]] [[publicVariableClient]] [[admin]] [[owner]] [[clientOwner]] [[groupOwner]] [[didJIPOwner]]
Line 38: Line 40:
{{GameCategory|arma3|Remote Execution}}
{{GameCategory|arma3|Remote Execution}}


<dl class="command_description">
{{Note
 
|user= Demellion
<dt></dt>
|timestamp= 20170911093100
<dd class="notedate">Posted on September 11, 2017 - 09:31 (UTC)</dd>
|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):
<dt class="note">[[User:Demellion|Demellion]]</dt>
<sqf>
<dd class="note">
if (remoteExecutedOwner isEqualTo 0) exitWith {}; // invalid RE owner
'''NOTE''': 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):
_gearArray remoteExecCall ['someGearFunction', remoteExecutedOwner];
<code>[[if]] ([[remoteExecutedOwner]] [[isEqualTo]] 0) [[exitWith]] {}; {{cc|invalid RE owner}}
</sqf>
_gearArray [[remoteExecCall]] ['someGearFunction', [[remoteExecutedOwner]]];</code>
Will prevent from code being accidentally sent to everyone on the server.
Will prevent from code being accidentally sent to everyone on the server.
</dd>
}}
 
</dl>

Revision as of 21:43, 7 May 2022

Hover & click on the images for description

Description

Description:
Returns the machine network ID of the client that initiated Remote Execution. If used in SP or outside of remote executed context, the command returns 0.
To check if the context is remote executed, use isRemoteExecuted or isRemoteExecutedJIP.
Groups:
Multiplayer

Syntax

Syntax:
remoteExecutedOwner
Return Value:
Number

Examples

Example 1:
private _callerRE = remoteExecutedOwner;
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 recieved!\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 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
Demellion - c
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):
if (remoteExecutedOwner isEqualTo 0) exitWith {}; // invalid RE owner _gearArray remoteExecCall ['someGearFunction', remoteExecutedOwner];
Will prevent from code being accidentally sent to everyone on the server.