Jump to content

OpenSimulator Internals/GridUserService

From Open Simulator Technical Help
Revision as of 06:55, 21 June 2026 by Jwbshaw (talk | contribs) (first)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

OpenSimulator Internals/GridUserService

[edit]

Overview

[edit]

GridUserService stores information about a user in this particular grid, for everyone who uses the grid -- local and foreign. This includes their home region, last region, online status, and last login/logout.

Must stay in the same process instance -- must update atomically with PresenceService on login and logout.

This is distinct from UserAccountService, which stores auth information for local accounts only.


Data Fields

[edit]
Field Type Notes
UserID VARCHAR(255) Primary key. String not UUID -- HyperGrid users have URI-based IDs.
HomeRegionID CHAR(36) UUID of home region
HomePosition CHAR(64) Vector3 as string e.g. <100, 100, 20>. Position in home region when returning home.
HomeLookAt CHAR(64) Unit vector as string. Direction avatar faces on return home. Z always 0. (0,1,0) = north, (1,0,0) = east, (0,-1,0) = south, (-1,0,0) = west.
LastRegionID CHAR(36) UUID of last region where user was present. For HyperGrid foreign users, reflects last region in this grid only.
LastPosition CHAR(64) Last reported position. Same format as HomePosition. Updated on teleport or logout only -- does not reflect current position.
LastLookAt CHAR(64) Last reported facing direction. Same format as HomeLookAt. Updated on teleport or logout only.
Online CHAR(5) "true" or "false" stored as string
Login CHAR(16) Unix timestamp stored as string
Logout CHAR(16) Unix timestamp stored as string. Not accurate if simulator crashed or was not cleanly shut down.

Records are added on first login but never removed. Online status less accurate than Presence table. Service ignores users marked online for more than 5 days.


Database

[edit]

See GridUser table for the full database schema.


See Also

[edit]