Interface IPartySystem<TConnection>
- Namespace
- FishMMO.Server.Core.World.SceneServer
- Assembly
- FishMMO.Server.dll
Engine-agnostic public API for party management on a scene server. Implementations manage party membership state for characters connected to this scene server, synchronize party updates with persistence, and notify local party members of changes.
public interface IPartySystem<TConnection> : IServerBehaviour, IServerComponent
Type Parameters
TConnection
Methods
AddPartyCharacterTracker(long, long)
Register that a character is currently connected to this scene server and is a member of the specified party. Implementations typically track this to push party updates only to active members on the server.
void AddPartyCharacterTracker(long partyID, long characterID)
Parameters
CharacterSystem_OnConnect(TConnection, IPlayerCharacter)
Called by the character system when a character connects. Implementations should use this callback to add the character to party trackers and to persist or broadcast party state as needed.
void CharacterSystem_OnConnect(TConnection conn, IPlayerCharacter character)
Parameters
connTConnectionOpaque connection object representing the client's connection.
characterIPlayerCharacterThe player character that connected.
CharacterSystem_OnDisconnect(TConnection, IPlayerCharacter)
Called by the character system when a character disconnects. Implementations should remove the character from trackers and persist any party updates.
void CharacterSystem_OnDisconnect(TConnection conn, IPlayerCharacter character)
Parameters
connTConnectionOpaque connection object.
characterIPlayerCharacterThe player character that disconnected.
RemoveCharacterFromPartyAsync(long, long, string)
Drops a character out of a party it cannot belong to, with no connection involved.
Task<bool> RemoveCharacterFromPartyAsync(long characterID, long partyID, string reason)
Parameters
characterIDlongCharacter being removed.
partyIDlongParty it is being removed from.
reasonstringWhy, for the log line.
Returns
- Task<bool>
True when the character no longer belongs to the party — including when it never did. False means the removal could not be attempted and the membership row still stands, so a caller that was clearing the way for something else must not proceed.
Remarks
For a character that is still loading and has no spawned object to broadcast to — principally one that has arrived on a world server other than the one its party belongs to. Parties are replicated by a pump scoped to a single world server, so a membership that crossed would never converge.
The character's rank is not a parameter. It is re-read from the membership row, because
every caller's copy of it comes from IPartyController.Rank — a cache the update
pump refreshes — and whether leadership has to move is decided from that rank.
RemovePartyCharacterTracker(long, long)
Remove the mapping that a character is connected to this scene server for the given party. If no members remain for a party this method may allow implementations to drop cached state for that party.
void RemovePartyCharacterTracker(long partyID, long characterID)
Parameters
TryAddCharacterToPartyAsync(TConnection, long, long, float)
Adds a character to an existing party without an invitation, so that joining another group's dungeon instance also joins that group.
Task<bool> TryAddCharacterToPartyAsync(TConnection conn, long characterID, long partyID, float healthPCT)
Parameters
connTConnectionThe joining character's connection.
characterIDlongThe joining character.
partyIDlongParty that owns the instance being joined.
healthPCTfloatCurrent health fraction, for the party roster.
Returns
Remarks
Not a general-purpose membership API and not an invitation bypass. The only intended caller is the dungeon finder, which reaches it only after establishing that the party has published a joinable instance — an explicit and revocable offer by its leader — and only for a character who has no party of their own to be removed from.
Enforces the same party size limit the invitation path does, so a full party's instance is simply not joinable.
TryCreatePartyForInstanceAsync(TConnection, long, long, string, float)
Forms a party of one for a character opening a dungeon instance others may join.
Task<long> TryCreatePartyForInstanceAsync(TConnection conn, long characterID, long worldServerID, string sceneName, float healthPCT)
Parameters
connTConnectionThe character's connection.
characterIDlongThe character forming the party.
worldServerIDlongWorld server the party will belong to.
sceneNamestringScene name, for the create broadcast's location field.
healthPCTfloatCurrent health fraction, for the party roster.
Returns
Remarks
An instance is owned by a party and joining one joins that party, so an instance opened by an ungrouped character has no group for a joiner to be added to. Rather than refusing to let ungrouped players advertise a run at all, choosing to open one publicly forms the party that listing implies. A private or solo run creates nothing.