Class PacketSequencer
- Namespace
- Moffat.EndlessOnline.SDK.Packet
- Assembly
- Moffat.EndlessOnline.SDK.dll
A class for generating packet sequences
public sealed class PacketSequencer
- Inheritance
-
PacketSequencer
- Inherited Members
Constructors
PacketSequencer(ISequenceStart)
Constructs a new PacketSequencer with the provided ISequenceStart
public PacketSequencer(ISequenceStart start)
Parameters
startISequenceStartThe sequence start
Methods
NextSequence()
Calculates and returns the next sequence value, updating the sequence counter in the process
public int NextSequence()
Returns
- int
The next sequence value based on the SequenceStart value and the current counter
Remarks
Note: this is not a monotonic operation. The sequence counter increases from 0 to 9 before looping back to 0
WithSequenceStart(ISequenceStart)
Creates a new PacketSequencer with an updated sequence start, also known as the "starting counter ID"
public PacketSequencer WithSequenceStart(ISequenceStart start)
Parameters
startISequenceStartThe new sequence start
Returns
- PacketSequencer
A new packet sequencer instance with this sequencer's counter value and an updated sequence start value
Remarks
Note: this does not reset the sequence counter