diff options
author | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
commit | b2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch) | |
tree | 3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/llmessage/lltemplatemessagereader.h | |
parent | Second Life viewer sources 1.14.0.1 (diff) | |
download | meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2 meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz |
Second Life viewer sources 1.15.0.2
Diffstat (limited to 'linden/indra/llmessage/lltemplatemessagereader.h')
-rw-r--r-- | linden/indra/llmessage/lltemplatemessagereader.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/linden/indra/llmessage/lltemplatemessagereader.h b/linden/indra/llmessage/lltemplatemessagereader.h new file mode 100644 index 0000000..dd5ee39 --- /dev/null +++ b/linden/indra/llmessage/lltemplatemessagereader.h | |||
@@ -0,0 +1,98 @@ | |||
1 | #ifndef LL_LLTEMPLATEMESSAGEREADER_H | ||
2 | #define LL_LLTEMPLATEMESSAGEREADER_H | ||
3 | |||
4 | #include "llmessagereader.h" | ||
5 | |||
6 | #include <map> | ||
7 | |||
8 | class LLMessageTemplate; | ||
9 | class LLMsgData; | ||
10 | |||
11 | class LLTemplateMessageReader : public LLMessageReader | ||
12 | { | ||
13 | public: | ||
14 | |||
15 | typedef std::map<U32, LLMessageTemplate*> message_template_number_map_t; | ||
16 | |||
17 | LLTemplateMessageReader(message_template_number_map_t&); | ||
18 | virtual ~LLTemplateMessageReader(); | ||
19 | |||
20 | /** All get* methods expect pointers to canonical strings. */ | ||
21 | virtual void getBinaryData(const char *blockname, const char *varname, | ||
22 | void *datap, S32 size, S32 blocknum = 0, | ||
23 | S32 max_size = S32_MAX); | ||
24 | virtual void getBOOL(const char *block, const char *var, BOOL &data, | ||
25 | S32 blocknum = 0); | ||
26 | virtual void getS8(const char *block, const char *var, S8 &data, | ||
27 | S32 blocknum = 0); | ||
28 | virtual void getU8(const char *block, const char *var, U8 &data, | ||
29 | S32 blocknum = 0); | ||
30 | virtual void getS16(const char *block, const char *var, S16 &data, | ||
31 | S32 blocknum = 0); | ||
32 | virtual void getU16(const char *block, const char *var, U16 &data, | ||
33 | S32 blocknum = 0); | ||
34 | virtual void getS32(const char *block, const char *var, S32 &data, | ||
35 | S32 blocknum = 0); | ||
36 | virtual void getF32(const char *block, const char *var, F32 &data, | ||
37 | S32 blocknum = 0); | ||
38 | virtual void getU32(const char *block, const char *var, U32 &data, | ||
39 | S32 blocknum = 0); | ||
40 | virtual void getU64(const char *block, const char *var, U64 &data, | ||
41 | S32 blocknum = 0); | ||
42 | virtual void getF64(const char *block, const char *var, F64 &data, | ||
43 | S32 blocknum = 0); | ||
44 | virtual void getVector3(const char *block, const char *var, | ||
45 | LLVector3 &vec, S32 blocknum = 0); | ||
46 | virtual void getVector4(const char *block, const char *var, | ||
47 | LLVector4 &vec, S32 blocknum = 0); | ||
48 | virtual void getVector3d(const char *block, const char *var, | ||
49 | LLVector3d &vec, S32 blocknum = 0); | ||
50 | virtual void getQuat(const char *block, const char *var, LLQuaternion &q, | ||
51 | S32 blocknum = 0); | ||
52 | virtual void getUUID(const char *block, const char *var, LLUUID &uuid, | ||
53 | S32 blocknum = 0); | ||
54 | virtual void getIPAddr(const char *block, const char *var, U32 &ip, | ||
55 | S32 blocknum = 0); | ||
56 | virtual void getIPPort(const char *block, const char *var, U16 &port, | ||
57 | S32 blocknum = 0); | ||
58 | virtual void getString(const char *block, const char *var, | ||
59 | S32 buffer_size, char *buffer, S32 blocknum = 0); | ||
60 | |||
61 | virtual S32 getNumberOfBlocks(const char *blockname); | ||
62 | virtual S32 getSize(const char *blockname, const char *varname); | ||
63 | virtual S32 getSize(const char *blockname, S32 blocknum, | ||
64 | const char *varname); | ||
65 | |||
66 | virtual void clearMessage(); | ||
67 | |||
68 | virtual const char* getMessageName() const; | ||
69 | virtual S32 getMessageSize() const; | ||
70 | |||
71 | virtual void copyToBuilder(LLMessageBuilder&) const; | ||
72 | |||
73 | BOOL validateMessage(const U8* buffer, S32 buffer_size, | ||
74 | const LLHost& sender); | ||
75 | BOOL readMessage(const U8* buffer, const LLHost& sender); | ||
76 | |||
77 | bool isTrusted() const; | ||
78 | bool isBanned(bool trusted_source) const; | ||
79 | |||
80 | private: | ||
81 | |||
82 | void getData(const char *blockname, const char *varname, void *datap, | ||
83 | S32 size = 0, S32 blocknum = 0, S32 max_size = S32_MAX); | ||
84 | |||
85 | BOOL decodeTemplate(const U8* buffer, S32 buffer_size, // inputs | ||
86 | LLMessageTemplate** msg_template ); // outputs | ||
87 | |||
88 | void logRanOffEndOfPacket( const LLHost& host ); | ||
89 | |||
90 | BOOL decodeData(const U8* buffer, const LLHost& sender ); | ||
91 | |||
92 | S32 mReceiveSize; | ||
93 | LLMessageTemplate* mCurrentRMessageTemplate; | ||
94 | LLMsgData* mCurrentRMessageData; | ||
95 | message_template_number_map_t& mMessageNumbers; | ||
96 | }; | ||
97 | |||
98 | #endif // LL_LLTEMPLATEMESSAGEREADER_H | ||