resonance 1.0.1
Loading...
Searching...
No Matches
spjoinacceptpacket.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4#include <vector>
5
7#include "game/gameparams.h"
8#include "game/playerinfo.h"
10#include "os/hxstr.h"
11
12class IBStream;
13class OBStream;
14
32public:
43
54 static Message *New();
55
63 virtual Message *Clone();
64
72 virtual int Type();
73
81 virtual const char *GetName() const;
82
93 virtual void PrintExtra(std::ostream &stream) const;
94
103 virtual void saveGuts(OBStream &stream) const;
104
113 virtual void restoreGuts(IBStream &stream);
114
125
136
147
158
168 void AddPlayer(const PlayerInfo &player);
169
170private:
171 int mDestId; // +0x14
172 int mPlayerId; // +0x18
173 GameParams mParams; // +0x1c
174 HxStr mColorName; // +0x54
175 FreqAppearance mAppearance; // +0x5c
176 std::vector<PlayerInfo> mPlayers; // +0x70
177};
178
Appearance of a player's avatar.
Definition freqappearance.h:39
Settings a game session is started with.
Definition gameparams.h:42
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
A player's identity and settings.
Definition playerinfo.h:39
virtual const char * GetName() const
Report this packet's class name.
FreqAppearance GetAppearance()
Report the carried appearance.
static Message * New()
Produce a default-constructed packet on the heap.
SPJoinAcceptPacket()
Construct a packet with default settings, an empty colour, a fresh appearance, and no players.
HxStr GetUsername()
Report the username of the carried appearance.
virtual int Type()
Report this packet's registered identity.
virtual void PrintExtra(std::ostream &stream) const
Write plid:, destid:, the settings, clr:, and thm: with their values to a diagnostic stream.
void AddPlayer(const PlayerInfo &player)
Append one player to the player list.
GameParams GetParams()
Report the game settings.
HxStr GetColorName()
Report the colour name.
virtual Message * Clone()
Produce a heap copy of this packet.
virtual void restoreGuts(IBStream &stream)
Read the fields back in the order saveGuts() wrote them, resizing the record vector to the count read...
virtual void saveGuts(OBStream &stream) const
Write the Packet words, both identifiers, the settings, the colour, the appearance,...
ToSingleNetManagerPacket()
Route the packet with the pair 1 and 0.
Definition tosinglenetmanagerpacket.h:21
int g_nSPJoinAcceptPacketType
Identity that SPJoinAcceptPacket::Type() reports.