getUserInfo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " |game1= arma3 |version1= 2.06 |branch = dev" to " |game1= arma3 |version1= 2.06")
No edit summary
 
(13 intermediate revisions by 5 users not shown)
Line 3: Line 3:
|game1= arma3
|game1= arma3
|version1= 2.06
|version1= 2.06
|gr1= Multiplayer
|gr1= Multiplayer
|gr2= Object Detection
|gr2= Object Detection
|serverExec= server
|serverExec= server


|descr= Returns extended information about given server user.
|descr= Returns extended information about given server user.


|s1= [[getUserInfo]] networkID
|s1= [[getUserInfo]] playerID
|p1= networkID : [[String]] - user network id (see [[getPlayerID]], [[allUsers]])
|p1= playerID: [[String]] - user DirectPlay ID (see [[getPlayerID]], [[Arma 3: Mission Event Handlers#PlayerConnected|PlayerConnected]])
 
|r1= [[Array]] in format [playerID, owner, playerUID, soldierName, displayName, steamProfileName, clientStateNumber, isHeadless, adminState, networkInfo, playerObject], where:
* 0 - playerID: [[String]] - user DirectPlay ID (see [[getPlayerID]], [[Arma 3: Mission Event Handlers#PlayerConnected|PlayerConnected]])
* 1 - owner: [[Number]] - user owner (see [[owner]])
* 2 - playerUID: [[String]] - player UID (see [[getPlayerUID]])
* 3 - soldierName: [[String]] - player name (see [[profileName]])
* 4 - displayName: [[String]] - player name including squad (see [[name]], [[squadParams]])
* 5 - steamProfileName: [[String]] - steam profile name (see [[profileNameSteam]])
* 6 - clientStateNumber: [[String]] user client state (see [[getClientStateNumber]])
* 7 - isHeadless: [[Boolean]] - whether or not this is a headless client (see [[hasInterface]], [[isServer]])
* 8 - adminState: [[Number]] - admin status of the user (see [[admin]])
* 9 - networkInfo: [[Array]] of [[Number]]s - format [ping, bandwidth, desync]
* 10 - playerObject: [[Object]] - user player entity (see [[player]], [[selectPlayer]])
 
{{Feature|informative|Returns an empty array if said player is not found.}}
 
|s2= playerID [[getUserInfo]] infoIndex
|s2since= Arma3 2.18
|p21= playerID: [[String]] - user DirectPlay ID (see [[getPlayerID]], [[Arma 3: Mission Event Handlers#PlayerConnected|PlayerConnected]])
|p22= infoIndex: [[Number]] - the index of the data in the return array (see main syntax)
|r2= [[Anything]] - depends on the requested index (see main syntax) or [[Nothing]]
 
|x1= <sqf>private _randomUserInfo = getUserInfo selectRandom allUsers;</sqf>


|r1= [[Array]] in format: [networkId, owner, playerUID, soldierName, soldierNameInclSquad, steamProfileName, clientStateNumber, isHeadless, adminState, [avgPing, avgBandwidth, desync], playerObject], where:
|x2= <sqf>
* networkId : [[String]] - user network id (see [[getPlayerID]], [[allUsers]])
_userInfo params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit"];
* owner : [[Number]] - user owner (see [[owner]])
_networkInfo params ["_avgPing", "_avgBandwidth", "_desync"];
* playerUID : [[String]] - player UID (see [[getPlayerUID]])
</sqf>
* soldierName : [[String]] - player name (see [[profileName]])
* soldierNameInclSquad : [[String]] - player name including squad (see [[name]], [[squadParams]])
* steamProfileName : [[String]] steam profile name (see [[profileNameSteam]])
* clientStateNumber : user client state (see [[getClientStateNumber]])
* isHeadless : [[Boolean]] - whether or not this is a headless client (see [[hasInterface]], [[isServer]])
* adminState : [[Number]] - admin status of the user (see [[admin]])
* [avgPing, avgBandwidth, desync] : [[Array]] of [[Number]]s - user ping, bandwidth and desync info
* playerObject : [[Object]] - user player entity (see [[player]], [[selectPlayer]])


|x1=
|x3= <sqf>private _myInfo = getUserInfo getPlayerID player; // this particular example only works if player is server host</sqf>
Execute on server: <code>[[private]] _randomUserInfo = [[getUserInfo]] [[selectRandom]] [[allUsers]];</code>


|seealso= [[allUsers]], [[getPlayerID]]
|seealso= [[allUsers]] [[getPlayerID]] [[getUnitFreefallInfo]]
}}
}}

Latest revision as of 18:24, 13 April 2024

Hover & click on the images for description

Description

Description:
Returns extended information about given server user.
Groups:
MultiplayerObject Detection

Syntax

Syntax:
getUserInfo playerID
Parameters:
playerID: String - user DirectPlay ID (see getPlayerID, PlayerConnected)
Return Value:
Array in format [playerID, owner, playerUID, soldierName, displayName, steamProfileName, clientStateNumber, isHeadless, adminState, networkInfo, playerObject], where:
Returns an empty array if said player is not found.

Alternative Syntax

Syntax:
playerID getUserInfo infoIndex
Parameters:
playerID: String - user DirectPlay ID (see getPlayerID, PlayerConnected)
infoIndex: Number - the index of the data in the return array (see main syntax)
Return Value:
Anything - depends on the requested index (see main syntax) or Nothing

Examples

Example 1:
private _randomUserInfo = getUserInfo selectRandom allUsers;
Example 2:
_userInfo params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit"]; _networkInfo params ["_avgPing", "_avgBandwidth", "_desync"];
Example 3:
private _myInfo = getUserInfo getPlayerID player; // this particular example only works if player is server host

Additional Information

See also:
allUsers getPlayerID getUnitFreefallInfo

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