Class SceneInstanceDetails
- Namespace
- FishMMO.Server.Implementation.World.SceneServer
- Assembly
- FishMMO.Server.dll
Stores details about a scene instance managed by the server, including server IDs, name, handle, type, and character count. Tracks when the last character exited for stale scene detection.
public class SceneInstanceDetails : ISceneInstanceDetails
- Inheritance
-
SceneInstanceDetails
- Implements
- Inherited Members
Properties
CharacterCount
The current number of characters in this scene instance.
public int CharacterCount { get; set; }
Property Value
CreatedUtc
When the scene row this instance was loaded for was created.
public DateTime CreatedUtc { get; set; }
Property Value
Remarks
The row's creation time rather than the moment the scene finished loading, so the age this yields includes the time spent queued and loading. That is the age a lifetime cap has to measure: an instance that took a minute to come up has still been occupying a slot for that minute.
Distinct from LastExit, which measures how long an instance has been empty. The two bound different things — an abandoned instance and an endless one — and neither substitutes for the other.
Difficulty
Difficulty index this instance was opened at, into the dungeon's own difficulty list.
public int Difficulty { get; set; }
Property Value
Remarks
Meaningful only alongside Name: every dungeon declares its own list, and there is no global set of difficulty levels. Zero for an open-world scene and for a dungeon that declares no difficulties.
Handle
Runtime handle assigned to the loaded scene by this process's scene manager. Valid only inside the scene server that loaded it, and never to be persisted or sent to another process as an identifier — see SceneID.
public int Handle { get; set; }
Property Value
IsPrivate
Whether the owning party has hidden this instance from the dungeon finder's list.
public bool IsPrivate { get; set; }
Property Value
Remarks
A lock on the front door, not on the instance. A private instance is still enterable by the party that owns it — which is what keeps re-entry working for a run that has been closed to strangers — it simply stops being offered to everybody else.
LastExit
The time when the last character exited the scene.
public DateTime LastExit { get; set; }
Property Value
Name
The name of the scene instance.
public string Name { get; set; }
Property Value
OwnerCharacterID
Character the instance was created for. Zero for an open-world scene.
public long OwnerCharacterID { get; set; }
Property Value
Remarks
Taken from the scene row's character_id, which the dungeon finder stamps when it
requests the instance. Records who opened the run, which is not the same as who leads
it: leadership is the owning party's and moves with it — see PartyID.
The owner is the fallback authority for a run that has no party at all.
PartyID
Party that owns this instance, or 0 when an ungrouped character opened it.
public long PartyID { get; set; }
Property Value
Remarks
The durable identity of an instance's group, and the anchor for everything about controlling it: the instance's leader is this party's leader, kick authority is that leader's, and the dungeon finder resolves a party's own instance through this rather than through whoever happened to create it — so the run stays findable after its opener has left or logged out.
SceneID
Database ID of the scenes row this instance was loaded for. The identity of
the instance everywhere outside the hosting process.
public long SceneID { get; set; }
Property Value
Remarks
Handle cannot serve this purpose. It is the scene manager's own identifier for a loaded scene, assigned from a per-process counter, so two scene servers running the same build and loading the same scenes in the same order routinely allocate identical handles. Using it as a cross-process identity meant the world server's handle-to-server map collided between scene servers, and a scene server happily accepted a character routed to a different server's instance because the handle and scene name both matched. The row id is unique by construction.
SceneServerID
The scene server ID associated with this scene instance.
public long SceneServerID { get; set; }
Property Value
SceneType
The type of scene (OpenWorld, Group, PvP, etc.).
public SceneType SceneType { get; set; }
Property Value
StalePulse
Indicates whether the scene is stale (no characters present).
public bool StalePulse { get; }
Property Value
VacatedDeliberately
True when the instance emptied because its occupants CHOSE to leave, rather than because they went away.
public bool VacatedDeliberately { get; set; }
Property Value
Remarks
An empty instance means two very different things. Everyone walked out of the dungeon: the run is over, nobody is coming back, and holding the scene for a timeout wastes a placement slot. The last player's connection dropped: the run is not over, and reaping immediately would destroy their progress before they could reconnect to it.
Set by CharacterSystem.TryLeaveInstance, which is the only voluntary route out —
the leave-instance broadcast, the /leaveinstance command, and the forced return
when an instance is being closed. Cleared whenever anybody is present again, so a
returning player does not inherit the previous departure's verdict.
Note this is not the same distinction combat logout makes: that keeps a disconnected body counted as PRESENT so the scene never looks empty at all. This covers the case where the scene really is empty and the question is how long to hold it.
WorldServerID
The world server ID associated with this scene instance.
public long WorldServerID { get; set; }
Property Value
Methods
AddCharacterCount(int)
Adds or subtracts from the character count, updating LastExit if the scene becomes empty.
public void AddCharacterCount(int count)
Parameters
countintAmount to add or subtract from the character count.