Struct PluginAppraisalState
- Namespace
- AcDream.Plugin.Abstractions
- Assembly
- AcDream.Plugin.Abstractions.dll
The state of the client's single shared appraisal slot, shared by the user's own assess action and every plugin's Identify request.
public readonly record struct PluginAppraisalState : IEquatable<PluginAppraisalState>
- Implements
- Inherited Members
Constructors
PluginAppraisalState(long, uint, uint, uint)
The state of the client's single shared appraisal slot, shared by the user's own assess action and every plugin's Identify request.
public PluginAppraisalState(long Revision, uint AwaitingObjectId, uint CurrentObjectId, uint LastAbandonedObjectId = 0)
Parameters
RevisionlongBumps on every state change to this slot; cheap to poll for "did anything happen" without comparing the other fields.
AwaitingObjectIduintThe object id currently awaiting a response, or 0 if none is in flight. Only one request -- of either origin -- can be in flight at a time; a plugin's own Identify can still be displaced by a later one (its response is then dropped), but never by the reverse: a plugin Identify while the user's own assess is awaiting is refused outright.
CurrentObjectIduintThe completion signal: the object id of the most recently completed appraisal response, of either origin. This is NOT the client's examination window's displayed object -- a plugin's background Identify never opens or retargets that window, so this can (and routinely does) advance to an object the window is not showing. Poll this against the id you passed to Identify to learn when your own request completed.
LastAbandonedObjectIduintThe failure signal: the object id of the most recent request that was given up on rather than answered -- because the server never replied within the slot's bound, or because the slot was taken over. Poll this against the id you passed to Identify to learn that your own request will never complete, so you can count the failure and stop asking about that object for ever. Like
CurrentObjectIdit is a one-shot signal: a fresh request for that same object clears it.
Properties
AwaitingObjectId
The object id currently awaiting a response, or 0 if none is in flight. Only one request -- of either origin -- can be in flight at a time; a plugin's own Identify can still be displaced by a later one (its response is then dropped), but never by the reverse: a plugin Identify while the user's own assess is awaiting is refused outright.
public uint AwaitingObjectId { get; init; }
Property Value
CurrentObjectId
The completion signal: the object id of the most recently completed appraisal response, of either origin. This is NOT the client's examination window's displayed object -- a plugin's background Identify never opens or retargets that window, so this can (and routinely does) advance to an object the window is not showing. Poll this against the id you passed to Identify to learn when your own request completed.
public uint CurrentObjectId { get; init; }
Property Value
CurrentObjectUnsuccessful
True when the answer that completed CurrentObjectId said the server could not appraise the object; false for a successful answer and when nothing has completed. It is read from the object the client holds, so an answer about an object the client does not know reads false, and so does one the server has since said something else about. The same caution as LastAppraisalUnsuccessful applies: an unsuccessful answer does not by itself mean the object is gone.
public bool CurrentObjectUnsuccessful { get; init; }
Property Value
LastAbandonedObjectId
The failure signal: the object id of the most recent request that was
given up on rather than answered -- because the server never replied
within the slot's bound, or because the slot was taken over. Poll this
against the id you passed to Identify to learn that your own request
will never complete, so you can count the failure and stop asking about
that object for ever. Like CurrentObjectId it is a
one-shot signal: a fresh request for that same object clears it.
public uint LastAbandonedObjectId { get; init; }
Property Value
Revision
Bumps on every state change to this slot; cheap to poll for "did anything happen" without comparing the other fields.
public long Revision { get; init; }