resonance 1.0.1
Loading...
Searching...
No Matches
gamechatpacket.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
6#include "os/hxstr.h"
7
8class IBStream;
9class OBStream;
10
26public:
34
45 GameChatPacket(const HxStr &sender, const HxStr &text);
46
57 static Message *New();
58
66 virtual Message *Clone();
67
75 virtual int Type();
76
84 virtual const char *GetName() const;
85
93 virtual void PrintExtra(std::ostream &stream) const;
94
102 virtual void saveGuts(OBStream &stream) const;
103
113 virtual void restoreGuts(IBStream &stream);
114
125
136
137private:
138 // PrintExtra() writes the two strings with nothing between them. Both titles are inferred from
139 // the class name, a chat line and the player who sent it.
140 HxStr mSender; // +0x14
141 HxStr mText; // +0x1c
142};
143
152extern int g_nGameChatPacketType;
static Message * New()
Produce a packet with two empty strings on the heap.
virtual const char * GetName() const
Report this packet's class name.
virtual void restoreGuts(IBStream &stream)
Read the Packet words and then both strings back from a stream.
virtual Message * Clone()
Produce a heap copy of this packet.
GameChatPacket(const HxStr &sender, const HxStr &text)
Construct a packet carrying two strings.
GameChatPacket()
Construct a packet with two empty strings.
Definition gamechatpacket.h:32
virtual void PrintExtra(std::ostream &stream) const
Write both strings to a diagnostic stream, with nothing between them.
virtual int Type()
Report this packet's registered identity.
virtual void saveGuts(OBStream &stream) const
Write the Packet words and then both strings to a stream.
HxStr GetSender()
Report the first string.
HxStr GetText()
Report the second string.
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Input half of the byte stream interface.
Definition ibstream.h:36
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
Output half of the byte stream interface.
Definition obstream.h:25
ToAllOtherNetManagersPacket()
Route the packet with the pair 2 and 0.
Definition toallothernetmanagerspacket.h:21
int g_nGameChatPacketType
Identity that GameChatPacket::Type() reports.