wavelength 1.0.0
Loading...
Searching...
No Matches
lobbyconnectresultmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5#include "msg/message.h"
8#include "os/mem.h"
9
17public:
28
36 explicit LobbyConnectResultMsg(int nResult) : mResult(nResult) {
37 }
38
45 void *operator new(size_t nSize) {
46 return PoolMemAlloc(static_cast<int>(nSize), "LobbyConnectResultMsg", 0);
47 }
48
54 void operator delete(void *pBlock) {
55 PoolMemFree(pBlock);
56 }
57
63 Message *Clone() override {
64 return new LobbyConnectResultMsg(*this);
65 }
66
72 int Type() override {
74 }
75
81 const char *GetName() const override {
82 return "LobbyConnectResultMsg";
83 }
84
92 void PrintExtra(PrnStream &stream) const override;
93
95 const std::list<LobbyLocation> &GetLocations() const {
96 return mLocations;
97 }
98
100 std::list<LobbyLocation> &GetLocations() {
101 return mLocations;
102 }
103
105 int GetResult() const {
106 return mResult;
107 }
108
109private:
110 int mResult;
111 std::list<LobbyLocation> mLocations;
112};
const char * GetName() const override
Report this message's class name.
Definition lobbyconnectresultmsg.h:81
const std::list< LobbyLocation > & GetLocations() const
Definition lobbyconnectresultmsg.h:95
Result
Values of mResult.
Definition lobbyconnectresultmsg.h:19
@ kResultSuccess
Definition lobbyconnectresultmsg.h:26
@ kResultLookupFailed
Definition lobbyconnectresultmsg.h:22
@ kResultSessionFailed
Definition lobbyconnectresultmsg.h:23
@ kResultConnectFailed
Definition lobbyconnectresultmsg.h:24
@ kResultDNASFailed
Definition lobbyconnectresultmsg.h:25
@ kResultFailed
Definition lobbyconnectresultmsg.h:20
@ kResultLostInternet
Definition lobbyconnectresultmsg.h:21
LobbyConnectResultMsg(int nResult)
Construct a result with no locations.
Definition lobbyconnectresultmsg.h:36
std::list< LobbyLocation > & GetLocations()
Definition lobbyconnectresultmsg.h:100
int GetResult() const
Definition lobbyconnectresultmsg.h:105
void PrintExtra(PrnStream &stream) const override
Write the result, and the locations after a success.
Message * Clone() override
Produce a heap copy of this message.
Definition lobbyconnectresultmsg.h:63
int Type() override
Report this message's registered identity.
Definition lobbyconnectresultmsg.h:72
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Text output stream.
Definition prnstream.h:16
int g_nLobbyConnectResultMsgType
Identity that LobbyConnectResultMsg::Type() reports.
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.