Table of Contents

Class SceneEntity

Namespace
FishMMO.Database.Npgsql.Entities
Assembly
FishMMO-DB.dll

Scene instance entity representing a currently loaded scene on a scene server.

public class SceneEntity : IVersionedEntity
Inheritance
SceneEntity
Implements
Inherited Members

Properties

CharacterCount

Number of characters currently in this scene.

public int CharacterCount { get; set; }

Property Value

int

CharacterID

Character ID of the player than opened this scene if it's instanced.

public long CharacterID { get; set; }

Property Value

long

Difficulty

Difficulty this instance was opened at, as an index into the dungeon's own difficulty list. 0 is the first entry a dungeon declares.

public int Difficulty { get; set; }

Property Value

int

Remarks

Stored per instance rather than per dungeon because the same dungeon runs at several difficulties at once, and the ruleset has to survive the round trip through the queue: the scene server that eventually loads this row is not the one that enqueued it and has nothing else to read the choice from. Every dungeon declares its own list, so this is meaningful only alongside SceneName.

ID

Primary key.

public long ID { get; set; }

Property Value

long

IsPrivate

True when the owning party has hidden this instance from the dungeon finder's list.

public bool IsPrivate { get; set; }

Property Value

bool

Remarks

A lock on the front door, not on the instance: a private instance is still enterable by the party that owns it, it simply stops being offered to everyone else. Public by default, because a finder whose list is empty by default is not a finder.

PartyID

Party that owns this instance, or 0 when it was opened by an ungrouped character.

public long PartyID { get; set; }

Property Value

long

Remarks

The durable answer to "whose dungeon is this". CharacterID records only who happened to open it, and that character can leave the party, log out, or be dropped from it — after which the remaining members could no longer resolve their own instance and would silently open a second one, splitting the group. Membership is looked up through this column so the instance survives any change to who created it.

RequestKey

The writer's once-per-request identity: a retry after a lost reply finds the row its first attempt wrote instead of writing a second one. Null for rows written without one.

public Guid? RequestKey { get; set; }

Property Value

Guid?

SceneHandle

The hosting scene server's own scene-manager handle for this instance.

public long SceneHandle { get; set; }

Property Value

long

Remarks

Diagnostic only. A scene-manager handle is assigned by the process that loaded the scene, so it is meaningful solely inside that process — two scene servers running the same build routinely produce the same value for different scenes. Anything that needs to identify a scene instance from outside its host uses ID.

A Unity scene handle is 64 bits (SceneHandle.GetRawData(), an entity ID whose top bits are its version). It is stored bit for bit, so a real handle can read as a negative bigint.

Before the row is Ready there is no handle, and the column has one other use: 0 while Pending, and while Loading the claim token of the dequeue that took the row, which is how a retried dequeue finds its own claim. SetReadyAsync replaces the token with the real handle. A token and a handle are told apart by the row's status, never by the value. See ISceneService.DequeueAsync.

SceneName

Scene name (e.g. the Unity scene asset name).

public string SceneName { get; set; }

Property Value

string

SceneServerID

Scene server that hosts this scene: the one that claimed it from the queue while it is Loading, and the one that made it Ready after. 0 while Pending.

public long SceneServerID { get; set; }

Property Value

long

SceneStatus

Current status of the scene (e.g. loading, running, unloading).

public int SceneStatus { get; set; }

Property Value

int

SceneType

Scene type (over-world vs instanced).

public int SceneType { get; set; }

Property Value

int

TimeCreated

Row creation timestamp (UTC).

public DateTime TimeCreated { get; set; }

Property Value

DateTime

Version

Concurrency version for optimistic locking.

public long Version { get; set; }

Property Value

long

WorldServerID

World server ID this scene belongs to.

public long WorldServerID { get; set; }

Property Value

long