remoteExecutedOwner: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[[Cc]ategory:[ _]?Arma[ _]3:[ _]?([^|]*)]]" to "{{GameCategory|arma3|$1}}")
No edit summary
 
(43 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________
|arma3 |Game name=
|1.70|Game Version=
|arg=  |Multiplayer Arguments=
|eff=  |Multiplayer Effects=
|serverExec= |Exec=


|gr1 = Multiplayer |GROUP1=
|game1= arma3
____________________________________________________________________________________________
|version1= 1.70


| 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.
|gr1= Multiplayer
{{Informative | To check if the context is remote executed, use [[isRemoteExecuted]] or [[isRemoteExecutedJIP]].}} |DESCRIPTION=
____________________________________________________________________________________________


| [[remoteExecutedOwner]] |SYNTAX=
|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]].
}}


| [[Number]] |RETURNVALUE=
|s1= [[remoteExecutedOwner]]


|x1= <code>_callerRE = [[remoteExecutedOwner]];</code> |EXAMPLE1=
|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:
<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 received!\nMission time value on the server is: %1",
[[_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> |EXAMPLE2=
remoteExec ["call", 2]; // send request to server
</sqf>


| [[isRemoteExecuted]], [[isRemoteExecutedJIP]], [[remoteExec]], [[remoteExecCall]], [[canSuspend]], [[publicVariableClient]], [[admin]], [[owner]], [[clientOwner]], [[groupOwner]], [[didJIPOwner]] |SEEALSO=
|seealso= [[isRemoteExecuted]] [[isRemoteExecutedJIP]] [[remoteExecutedJIPID]] [[remoteExec]] [[remoteExecCall]] [[canSuspend]] [[publicVariableClient]] [[admin]] [[owner]] [[clientOwner]] [[groupOwner]] [[didJIPOwner]]
}}
}}


<dl class='command_description'>
{{GameCategory|arma3|Remote Execution}}
<!-- BEGIN Note Section -->
<!-- END Note Section -->
</dl>


<h3 style='display:none'>Bottom Section</h3>
{{Note
<!-- Appropriate categories go here -->
|user= Demellion
 
|timestamp= 20170911093100
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
|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):
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
<sqf>
{{GameCategory|arma3| Remote Execution}}
if (remoteExecutedOwner isEqualTo 0) exitWith {}; // invalid RE owner
 
_gearArray remoteExecCall ['someGearFunction', remoteExecutedOwner];
<!-- CONTINUE Notes -->
</sqf>
<dl class="command_description">
<dd class="notedate">Posted on September 11, 2017 - 09:31 (UTC)</dd>
<dt class="note">[[User:Demellion|Demellion]]</dt>
<dd class="note">
'''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):
<code>[[if]] ([[remoteExecutedOwner]] [[isEqualTo]] 0) [[exitWith]] {}; {{cc|invalid RE owner}}
_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>
<!-- DISCONTINUE Notes -->

Latest revision as of 13:57, 14 July 2024

Hover & click on the images for description

Description

Description:
Returns the machine network ID of the client that initiated Remote Execution.
Running this command
  • in a Single Player environment
  • outside of a remote-executed context
  • in a remote-executed context received from a Headless Client
will return 0 by design. To check if the context is remote executed, use isRemoteExecuted or isRemoteExecutedJIP.
Groups:
Multiplayer

Syntax

Syntax:
remoteExecutedOwner
Return Value:
Number - returns zero in the specific cases listed in the Description

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 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
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.