Difference between revisions of "Osiris/API/CharacterGetReservedUserID"
From Divinity Engine Wiki
m (CharacterGetReservedUserID is a query, not a call) |
m |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
===== Full Definition(s) ===== | ===== Full Definition(s) ===== | ||
− | * query '''CharacterGetReservedUserID'''('''''[in]'''(CHARACTERGUID)'''''_Character''','''''[out]'''(INTEGER)'''''_User''') | + | * query '''CharacterGetReservedUserID'''('''''[in]'''(CHARACTERGUID)'''''_Character''', '''''[out]'''(INTEGER)'''''_User''') |
===== Description ===== | ===== Description ===== | ||
Returns the ID of the user that controls '''_Character''' in '''_User'''. | Returns the ID of the user that controls '''_Character''' in '''_User'''. | ||
===== Return Values ===== | ===== Return Values ===== | ||
− | * '''Success/Failure''': Fails if '''_Character''' does not exist or is | + | * '''Success/Failure''': Fails if '''_Character''' does not exist or is NULL. |
* '''_User''': The user ID of the player to which '''_Character''' is assigned. If it is not assigned to anyone, the special value '''-65536''' is returned. | * '''_User''': The user ID of the player to which '''_Character''' is assigned. If it is not assigned to anyone, the special value '''-65536''' is returned. | ||
===== Notes ===== | ===== Notes ===== | ||
* "Users" are the game term for human players in the game. Every client that connects to the game, including the one that started the host game, gets assigned a User ID. | * "Users" are the game term for human players in the game. Every client that connects to the game, including the one that started the host game, gets assigned a User ID. | ||
− | * User IDs are volatile: they can change at any time, in particular when loading a saved game, or when someone disconnects and reconnects. Never store this value in a database. Only use it immediately after requesting it, within the same frame. | + | * User IDs are volatile: they can change at any time, in particular when loading a saved game, or when someone disconnects and reconnects. Never store this value in a database. Only use it immediately after requesting it, within the same frame. If you need a persistent identifier for a user (or rather, user profile), pass the result of this query to [[Osiris/API/GetUserProfileID|GetUserProfileID]]. |
===== See Also ===== | ===== See Also ===== | ||
* [[Osiris/API/CharacterAssignToUser|CharacterAssignToUser]] | * [[Osiris/API/CharacterAssignToUser|CharacterAssignToUser]] | ||
− | |||
* [[Osiris/API/CharacterMakePlayer|CharacterMakePlayer]] | * [[Osiris/API/CharacterMakePlayer|CharacterMakePlayer]] | ||
* [[Osiris/API/CharacterRecruitCharacter|CharacterRecruitCharacter]] | * [[Osiris/API/CharacterRecruitCharacter|CharacterRecruitCharacter]] | ||
+ | * [[Osiris/API/GetUserProfileID|GetUserProfileID]] | ||
− | [[Category:Osiris Queries]] | + | [[Category:Osiris Queries|CharacterGetReservedUserID]] |
Latest revision as of 21:12, 24 January 2019
Full Definition(s)
- query CharacterGetReservedUserID([in](CHARACTERGUID)_Character, [out](INTEGER)_User)
Description
Returns the ID of the user that controls _Character in _User.
Return Values
- Success/Failure: Fails if _Character does not exist or is NULL.
- _User: The user ID of the player to which _Character is assigned. If it is not assigned to anyone, the special value -65536 is returned.
Notes
- "Users" are the game term for human players in the game. Every client that connects to the game, including the one that started the host game, gets assigned a User ID.
- User IDs are volatile: they can change at any time, in particular when loading a saved game, or when someone disconnects and reconnects. Never store this value in a database. Only use it immediately after requesting it, within the same frame. If you need a persistent identifier for a user (or rather, user profile), pass the result of this query to GetUserProfileID.