Function: OpenBotRoster(npc, player)
Description:
Requests the bot roster UI with the NPC and current script identity. The roster service applies its own policy and validation.
Parameters:
npc: NPC spawn. player: connected player spawn.
Returns: Boolean indicating whether the service handled the request. True can mean the roster UI opened, or that the player has no saved companions and received an explanatory message. False indicates invalid input, a missing or changed original connection/Player, or service rejection.
Connection lifetime:
Each player or group-member connection resolved by this function is retained through the native call. A disconnect or reconnect during a callback cannot destroy that retained connection or switch the ongoing call to a replacement. A later Lua call resolves the current connection. This does not extend the lifetime of unrelated spawn or item userdata.
Deferred session identity:
The UI remembers weak references to the original NPC allocation, Player,
connection and zone, together with the connection's spawn-session generation.
A despawned NPC cannot be replaced by another NPC with the same runtime ID,
database ID, location or script. Player replacement, zoning or reconnecting
invalidates the old action. Idle session metadata does not keep these objects
alive.
Opening a newer UI or cancelling it supersedes an older pending opener, even if the newer opener finishes first. Each response claims its original nonce and stage once. Validation and the
resulting operation retain their original objects through callbacks; cleanup of
an older response preserves a newer session opened during that response. A Lua
call using an old Player object cannot open the UI for the connection's current
replacement Player. Native operation owners are released before the boolean
result is pushed to Lua.
Bot admission during teardown: The deferred operation also remembers the original Player registry admission revision. Beginning teardown revokes pending actions before Client/zone metadata must change. Reopening for a later audience cannot revive an older response. A live connection handoff can preserve ready Player-owned Bots while invalidating the old connection's pending actions. An interrupted activation keeps its original construction/retirement owner, and failed cleanup retains an exact retryable registration claim.
Group acceptance and peer replies: Native Bot activation/grouping retains the original actors, connection and group through acceptance callbacks. Pending work observes the original Bot allocation and an invitation revision; a stale peer reply cannot join a replacement Bot or consume a newer request. Updated peers must echo the invite_revision field. Interrupted current claims can retry, while cancellation and replacement supersede older claims.