wavelength 1.0.0
Loading...
Searching...
No Matches
inetconnectresultmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include "msg/message.h"
5#include "os/mem.h"
6#include "os/string.h"
7
15public:
17 enum Result {
27#ifdef VIDEO_STANDARD_PAL
28 kResultAuthFailed = -92,
29#endif
30 };
31
39 explicit InetConnectResultMsg(int nResult) : mResult(nResult) {
40 }
41
48 void *operator new(size_t nSize) {
49 return PoolMemAlloc(static_cast<int>(nSize), "InetConnectResultMsg", 0);
50 }
51
57 void operator delete(void *pBlock) {
58 PoolMemFree(pBlock);
59 }
60
66 Message *Clone() override {
67 return new InetConnectResultMsg(*this);
68 }
69
75 int Type() override {
77 }
78
84 const char *GetName() const override {
85 return "InetConnectResultMsg";
86 }
87
95 void PrintExtra(PrnStream &stream) const override;
96
97#ifndef VIDEO_STANDARD_PAL
98#endif
99
101 int GetResult() const {
102 return mResult;
103 }
104
105private:
106 int mResult;
107 String mError;
108};
void PrintExtra(PrnStream &stream) const override
Write the result, and the error text when it is not empty.
Message * Clone() override
Produce a heap copy of this message.
Definition inetconnectresultmsg.h:66
int Type() override
Report this message's registered identity.
Definition inetconnectresultmsg.h:75
Result
Values of mResult.
Definition inetconnectresultmsg.h:17
@ kResultConfigError
Definition inetconnectresultmsg.h:22
@ kResultTimeout
Definition inetconnectresultmsg.h:25
@ kResultSuccess
Definition inetconnectresultmsg.h:18
@ kResultOpenFailed
Definition inetconnectresultmsg.h:19
@ kResultFailed
Definition inetconnectresultmsg.h:26
@ kResultNoCombination
Definition inetconnectresultmsg.h:23
@ kResultConfigNotFound
Definition inetconnectresultmsg.h:20
@ kResultConfigWrongConsole
Definition inetconnectresultmsg.h:21
@ kResultHardwareError
Definition inetconnectresultmsg.h:24
const char * GetName() const override
Report this message's class name.
Definition inetconnectresultmsg.h:84
int GetResult() const
Definition inetconnectresultmsg.h:101
InetConnectResultMsg(int nResult)
Construct a result with no error text.
Definition inetconnectresultmsg.h:39
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Text output stream.
Definition prnstream.h:16
Growable text buffer that is also a PrnStream.
Definition string.h:19
int g_nInetConnectResultMsgType
Identity that InetConnectResultMsg::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.