remoteExecutedOwner: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|arma3 |= Game " to "|arma3 |Game name= ")
Line 5: Line 5:
|arg=  |Multiplayer Arguments=
|arg=  |Multiplayer Arguments=
|eff=  |Multiplayer Effects=
|eff=  |Multiplayer Effects=
|exec= |= Exec
|exec= |Exec=
____________________________________________________________________________________________
____________________________________________________________________________________________
| Returns [[clientOwner]] of the PC, which initiated [[Remote Execution]] call. If used in SP or outside of remote executed context, the command returns 0. To check if the context was remote executed or remote executed from JIP queue, use [[isRemoteExecuted]] and [[isRemoteExecutedJIP]] |DESCRIPTION=
 
| Returns [[clientOwner]] of the PC, which initiated [[Remote Execution]] call. If used in SP or outside of remote executed context, the command returns 0.
{{Informative | To check if the context was remote executed or remote executed from JIP queue, use [[isRemoteExecuted]] and [[isRemoteExecutedJIP]].}} |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________
| '''remoteExecutedOwner''' |SYNTAX=
 
| [[remoteExecutedOwner]] |SYNTAX=


| [[Number]] - id of the client, which initiated remote execution |RETURNVALUE=
| [[Number]] - id of the client, which initiated remote execution |RETURNVALUE=
|x1= <code>_callerRE = [[remoteExecutedOwner]];</code> |EXAMPLE1=
|x1= <code>_callerRE = [[remoteExecutedOwner]];</code> |EXAMPLE1=
|x2= Send request to the server and get immediate response:<code>{
 
// in this scope, the remoteExecutedOwner equals clientOwner of the sender
|x2= Send request to the server and get immediate response:
// so using it as target in remoteExec will send response right back at him
<code>{
{{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}}
[
[
[[time]], // mission time value on the server
[[time]], {{cc|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",
[[_this]]
[[_this]]
];
];
}
}
]
]
[[remoteExec]] ["call", [[remoteExecutedOwner]]]; // server response to the sender
[[remoteExec]] ["call", [[remoteExecutedOwner]]]; {{cc|server response to the sender}}
}  
}  
[[remoteExec]] ["call", 2]; // send request to server</code> |EXAMPLE1=
[[remoteExec]] ["call", 2]; {{cc|send request to server}}</code> |EXAMPLE2=


| [[isRemoteExecuted]], [[isRemoteExecutedJIP]], [[remoteExec]], [[remoteExecCall]], [[canSuspend]], [[publicVariableClient]], [[admin]], [[owner]], [[clientOwner]], [[groupOwner]], [[didJIPOwner]] |SEEALSO=
| [[isRemoteExecuted]], [[isRemoteExecutedJIP]], [[remoteExec]], [[remoteExecCall]], [[canSuspend]], [[publicVariableClient]], [[admin]], [[owner]], [[clientOwner]], [[groupOwner]], [[didJIPOwner]] |SEEALSO=
Line 50: Line 56:
<dt class="note">[[User:Demellion|Demellion]]</dt>
<dt class="note">[[User:Demellion|Demellion]]</dt>
<dd class="note">
<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):
'''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 {}; // Not valid RE owner
<code>[[if]] ([[remoteExecutedOwner]] [[isEqualTo]] 0) [[exitWith]] {}; {{cc|invalid RE owner}}
_gearArray remoteExecCall ['someGearFunction',remoteExecutedOwner];
_gearArray [[remoteExecCall]] ['someGearFunction', [[remoteExecutedOwner]]];</code>
</code>
Will prevent from code being accidentally sent to everyone on the server.
Will prevent from code being accidentaly sent for everyone on the server.
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 23:02, 4 September 2019

Hover & click on the images for description

Description

Description:
Returns clientOwner of the PC, which initiated Remote Execution call. If used in SP or outside of remote executed context, the command returns 0.
To check if the context was remote executed or remote executed from JIP queue, use isRemoteExecuted and isRemoteExecutedJIP.
Groups:
Uncategorised

Syntax

Syntax:
remoteExecutedOwner
Return Value:
Number - id of the client, which initiated remote execution

Examples

Example 1:
_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:
isRemoteExecutedisRemoteExecutedJIPremoteExecremoteExecCallcanSuspendpublicVariableClientadminownerclientOwnergroupOwnerdidJIPOwner

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

Bottom Section

Posted on September 11, 2017 - 09:31 (UTC)
Demellion
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): if (remoteExecutedOwner isEqualTo 0) exitWith {}; // invalid RE owner _gearArray remoteExecCall ['someGearFunction', remoteExecutedOwner]; Will prevent from code being accidentally sent to everyone on the server.