|
resonance 1.0.1
|
Network packet the game sends between game systems. More...
#include <gempacket.h>


Public Member Functions | |
| GemPacket () | |
| Construct a packet with the payload unset beyond the Packet words and the position. | |
| GemPacket (const Gem &fields, int nTr) | |
| Report one gem event. | |
| virtual Message * | Clone () |
| Produce a heap copy of this packet. | |
| virtual int | Type () |
| Report this packet's registered identity. | |
| virtual const char * | GetName () const |
| Report this packet's class name. | |
| virtual void | PrintExtra (std::ostream &stream) const |
| Write a description of the packet to a diagnostic stream. | |
| virtual void | saveGuts (OBStream &stream) const |
| Write the packet to a stream. | |
| virtual void | restoreGuts (IBStream &stream) |
| Read the packet back from a stream. | |
| Public Member Functions inherited from ToAllOtherGameSystemsPacket | |
| ToAllOtherGameSystemsPacket () | |
| Route the packet with the pair 2 and 3. | |
| Public Member Functions inherited from Message | |
| void * | operator new (size_t nSize) |
| Allocate a message from the tagged heap under the tag MSG. | |
| void | operator delete (void *pBlock) |
| Release a message to the tagged heap under the tag MSG. | |
| virtual | ~Message () |
| Vtable slot 1. | |
| std::ostream & | Print (std::ostream &stream) const |
| Write this message to a diagnostic stream as {GetName() PrintExtra()}. | |
Static Public Member Functions | |
| static Message * | New () |
| Produce a default-constructed packet on the heap. | |
| Static Public Member Functions inherited from Message | |
| static Message * | NewMessage (int nType) |
| Produce a message of the identified class through the factory list. | |
Public Attributes | |
| Gem | mFields |
| The gem. | |
| int | mTr |
| The track, labelled tr: by PrintExtra(). | |
Additional Inherited Members | |
| Protected Member Functions inherited from Packet | |
| Packet (int nDestination, int nDestinationSystem) | |
| Set the two routing words and mark the remaining two as unset. | |
| Protected Attributes inherited from Packet | |
| int | mDestination |
| int | mDestinationSystem |
| int | mClientId |
| The client the packet concerns, or -1 until set. | |
| int | mTargetClientId |
| A second client identifier, -1 until set. | |
Network packet the game sends between game systems.
Its RTTI descriptor is at 0x008ef710. It has ToAllOtherGameSystemsPacket as its one base. The object is 0x2c bytes and its vtable is at 0x00814380, with eight entries and a zero terminator at index 8. Slot 1 is the compiler-generated destructor, slots 2 through 4 supply the three pure slots Packet does not implement, and slots 5, 6, and 7 override Message::PrintExtra(), Packet::saveGuts(), and Packet::restoreGuts(). The four words Packet provides are declared there rather than here.
This class shares its RTTI accessor and vtable with ToAllOtherGameSystemsPacket, its own base, which has no implementation of its own. The vtable belongs to this class.
The payload layout is recovered from the three field routines rather than from the copy constructor. The copy constructor at 0x003f3d18 moves +0x14 through +0x23 with two unaligned 64-bit pairs, which reads as two eight-byte members and is the compiler merging adjacent four-byte fields. Gem::saveGuts() at 0x001a2560, Gem::restoreGuts() at 0x001a2630, and Gem::Print() at 0x001a2ce0 transfer the same region as five separate four-byte lvalues, and Gem::Print() labels each one, which is what recovers both the widths and the names.
The allocation tag on both the allocation in Clone() and the release in the destructor is MSG, which is the tag Message declares rather than one of this class.
The destructor at 0x003f16d8 is compiler-generated and has no declaration here.
|
inline |
|
inline |
Report one gem event.
Inline, with no address of its own. PhraseMgr::AddGem() at 0x001bab84 expands it on its stack. That routine fills a local Gem with mGem, mBar, mLoc, and mPlayer, leaving mTrans unset, copies the whole subobject in, and passes the manager's word at +0x30 as the track.
| fields | The gem event. |
| nTr | The track. |
|
static |
Produce a default-constructed packet on the heap.
The registry the translation unit at 0x003ed2e0 builds stores this address against g_nGemPacketType.
|
virtual |
Produce a heap copy of this packet.
Implements Message.
|
virtual |
Report this packet's registered identity.
Implements Message.
|
virtual |
|
virtual |
Write a description of the packet to a diagnostic stream.
Slot 5, overriding Message::PrintExtra().
| stream | The stream to write to. |
Reimplemented from Message.
|
virtual |
Write the packet to a stream.
Slot 6, overriding Packet::saveGuts(). mClientId is written a second time after the payload, repeating the transfer the Packet prefix already performed, and restoreGuts() reads the same word twice to match.
| stream | The stream to write to. |
Reimplemented from Packet.
|
virtual |
Read the packet back from a stream.
Slot 7, overriding Packet::restoreGuts().
| stream | The stream to read from. |
Reimplemented from Packet.
| Gem GemPacket::mFields |
| int GemPacket::mTr |
The track, labelled tr: by PrintExtra().
+0x28
PhraseMgr::PostGemMsg() compares it with the track the manager serves.