A sequence start sent in the InitInitServerPacket (connection initialization).
More...
#include <eolib/packet/sequence_start.hpp>
Inherits eolib::packet::SequenceStart.
|
| int | Value () const noexcept override |
| | Gets the sequence start value.
|
| int | Seq1 () const noexcept |
| | Gets the seq1 byte value sent in the InitInitServerPacket.
|
| int | Seq2 () const noexcept |
| | Gets the seq2 byte value sent in the InitInitServerPacket.
|
| virtual | ~SequenceStart ()=default |
|
| static InitSequenceStart | FromInitValues (int seq1, int seq2) noexcept |
| | Creates an instance from the seq1 and seq2 values in the InitInitServerPacket.
|
| template<typename Urbg> |
| static InitSequenceStart | Generate (Urbg &rng) |
| | Generates an instance with a random value in the range [0, MaxValue).
|
| static InitSequenceStart | Generate () |
| | Generates an instance with a random value in the range [0, MaxValue), using a thread-local random engine.
|
|
| static constexpr int | MaxValue = 1757 |
| | The exclusive upper bound of generated values.
|
A sequence start sent in the InitInitServerPacket (connection initialization).
◆ FromInitValues()
| InitSequenceStart eolib::packet::InitSequenceStart::FromInitValues |
( |
int | seq1, |
|
|
int | seq2 ) |
|
staticnoexcept |
Creates an instance from the seq1 and seq2 values in the InitInitServerPacket.
- Parameters
-
| seq1 | the seq1 byte value. |
| seq2 | the seq2 byte value. |
- Returns
- the sequence start.
◆ Generate() [1/2]
template<typename Urbg>
| InitSequenceStart eolib::packet::InitSequenceStart::Generate |
( |
Urbg & | rng | ) |
|
|
inlinestatic |
Generates an instance with a random value in the range [0, MaxValue).
- Parameters
-
| rng | the uniform random bit generator to use, e.g. std::mt19937. |
- Returns
- the generated instance.
◆ Generate() [2/2]
| InitSequenceStart eolib::packet::InitSequenceStart::Generate |
( |
| ) |
|
|
static |
Generates an instance with a random value in the range [0, MaxValue), using a thread-local random engine.
- Returns
- the generated instance.
◆ Value()
| int eolib::packet::InitSequenceStart::Value |
( |
| ) |
const |
|
overridevirtualnoexcept |
◆ Seq1()
| int eolib::packet::InitSequenceStart::Seq1 |
( |
| ) |
const |
|
noexcept |
Gets the seq1 byte value sent in the InitInitServerPacket.
- Returns
- the
seq1 value.
◆ Seq2()
| int eolib::packet::InitSequenceStart::Seq2 |
( |
| ) |
const |
|
noexcept |
Gets the seq2 byte value sent in the InitInitServerPacket.
- Returns
- the
seq2 value.
◆ MaxValue
| int eolib::packet::InitSequenceStart::MaxValue = 1757 |
|
staticconstexpr |
The exclusive upper bound of generated values.