|
wavelength 1.0.0
|
Abstract base of a message that travels between consoles. More...
#include <packet.h>


Public Types | |
| enum | RouteFlag { kRouteTransport = 1 , kRouteLaunchpad = 2 } |
| Bits of Route(). More... | |
Public Member Functions | |
| void | PrintExtra (PrnStream &stream) const override |
| Write the sender and the receiver that are set, as from: and to:. | |
| virtual int | Route ()=0 |
| Report the receivers a received packet goes to. | |
| unsigned char | GetFlags () const |
| int | GetReceiver () const |
| int | GetSender () const |
| void | SetSender (int nSender) |
| Public Member Functions inherited from Message | |
| virtual | ~Message () |
| Vtable slot 1. | |
| virtual Message * | Clone ()=0 |
| Produce a heap copy of this message. | |
| virtual int | Type ()=0 |
| Report this message's registered identity. | |
| virtual const char * | GetName () const =0 |
| Report this message's class name. | |
| virtual void | saveGuts (BinStream &stream) const |
| Write this message's payload to a stream. | |
| virtual void | restoreGuts (BinStream &stream) |
| Read this message's payload from a stream. | |
| virtual | ~Message () |
| virtual void | Unused1 () |
| Not called by the control. | |
| virtual int | Type ()=0 |
Static Public Attributes | |
| static constexpr int | kUnset = -2 |
| Value of mSender and mReceiver that marks the member as unset. | |
| static constexpr int | kAllPeers = -1 |
| Value of mReceiver that addresses every peer. | |
| static constexpr unsigned char | kFlagOrdered = 1 |
| Bit of mFlags that LaunchpadRT::Send() turns into the second delivery bit of the session library. | |
| static constexpr unsigned char | kFlagGuaranteed = 2 |
| Bit of mFlags that NetTransport::Send() turns into its guaranteed delivery bit. | |
Protected Member Functions | |
| Packet (unsigned char nFlags, int nReceiver) | |
| Construct a packet from an unset sender. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from Message | |
| static Message * | NewMessage (int nType) |
| Produce a message of the identified class through the factory list. | |
Abstract base of a message that travels between consoles.
The RTTI records Message as the one base. ExternalPacket and InternalPacket derive from it. Its vtable at 0x003d5d70 leaves Clone(), Type(), GetName(), and Route() pure. Every concrete packet's allocation stores the three members below, and the network receive routine at 0x00256440 writes the sender after its cast to this class.
| enum Packet::RouteFlag |
Bits of Route().
| Enumerator | |
|---|---|
| kRouteTransport | The packet goes to the sink of TheNetTransport. |
| kRouteLaunchpad | The packet goes to the online session itself. |
|
inlineprotected |
Construct a packet from an unset sender.
Inline. Every packet allocation expands it.
| nFlags | The delivery flags. |
| nReceiver | The peer the packet is for, kAllPeers, or kUnset. |
|
overridevirtual |
Write the sender and the receiver that are set, as from: and to:.
| stream | The stream to write to. |
Reimplemented from Message.
Reimplemented in PlayerUpdatePacket, RemixerUpdatePacket, ShareRemixPkt, StartGamePkt, TimeRequestPkt, TimeResponsePkt, UpdateRanksPkt, and WelcomePkt.
|
pure virtual |
Report the receivers a received packet goes to.
The receive routine passes the packet to every receiver whose RouteFlag the result sets. The name is inferred.
Implemented in ExternalPacket, and InternalPacket.
|
inline |
|
inline |
|
inline |
|
inline |
| nSender | The peer that sent the packet, or kUnset. |
|
staticconstexpr |
Value of mSender and mReceiver that marks the member as unset.
|
staticconstexpr |
Value of mReceiver that addresses every peer.
|
staticconstexpr |
Bit of mFlags that LaunchpadRT::Send() turns into the second delivery bit of the session library.
The name is inferred.
|
staticconstexpr |
Bit of mFlags that NetTransport::Send() turns into its guaranteed delivery bit.