diff options
author | Jacek Antonelli | 2008-12-01 17:39:58 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-01 17:40:06 -0600 |
commit | 7abecb48babe6a6f09bf6692ba55076546cfced9 (patch) | |
tree | 8d18a88513fb97adf32c10aae78f4be1984942db /linden/indra/llmessage/message.cpp | |
parent | Second Life viewer sources 1.21.6 (diff) | |
download | meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.zip meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.gz meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.bz2 meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.xz |
Second Life viewer sources 1.22.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmessage/message.cpp | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/linden/indra/llmessage/message.cpp b/linden/indra/llmessage/message.cpp index b20731a..9ca7211 100644 --- a/linden/indra/llmessage/message.cpp +++ b/linden/indra/llmessage/message.cpp | |||
@@ -763,7 +763,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) | |||
763 | clearReceiveState(); | 763 | clearReceiveState(); |
764 | valid_packet = FALSE; | 764 | valid_packet = FALSE; |
765 | } | 765 | } |
766 | 766 | ||
767 | if( valid_packet ) | 767 | if( valid_packet ) |
768 | { | 768 | { |
769 | logValidMsg(cdp, host, recv_reliable, recv_resent, (BOOL)(acks>0) ); | 769 | logValidMsg(cdp, host, recv_reliable, recv_resent, (BOOL)(acks>0) ); |
@@ -3956,22 +3956,27 @@ void LLMessageSystem::getString(const char *block, const char *var, | |||
3956 | blocknum); | 3956 | blocknum); |
3957 | } | 3957 | } |
3958 | 3958 | ||
3959 | S32 LLMessageSystem::getNumberOfBlocksFast(const char *blockname) | 3959 | BOOL LLMessageSystem::has(const char *blockname) const |
3960 | { | ||
3961 | return getNumberOfBlocks(blockname) > 0; | ||
3962 | } | ||
3963 | |||
3964 | S32 LLMessageSystem::getNumberOfBlocksFast(const char *blockname) const | ||
3960 | { | 3965 | { |
3961 | return mMessageReader->getNumberOfBlocks(blockname); | 3966 | return mMessageReader->getNumberOfBlocks(blockname); |
3962 | } | 3967 | } |
3963 | 3968 | ||
3964 | S32 LLMessageSystem::getNumberOfBlocks(const char *blockname) | 3969 | S32 LLMessageSystem::getNumberOfBlocks(const char *blockname) const |
3965 | { | 3970 | { |
3966 | return getNumberOfBlocksFast(LLMessageStringTable::getInstance()->getString(blockname)); | 3971 | return getNumberOfBlocksFast(LLMessageStringTable::getInstance()->getString(blockname)); |
3967 | } | 3972 | } |
3968 | 3973 | ||
3969 | S32 LLMessageSystem::getSizeFast(const char *blockname, const char *varname) | 3974 | S32 LLMessageSystem::getSizeFast(const char *blockname, const char *varname) const |
3970 | { | 3975 | { |
3971 | return mMessageReader->getSize(blockname, varname); | 3976 | return mMessageReader->getSize(blockname, varname); |
3972 | } | 3977 | } |
3973 | 3978 | ||
3974 | S32 LLMessageSystem::getSize(const char *blockname, const char *varname) | 3979 | S32 LLMessageSystem::getSize(const char *blockname, const char *varname) const |
3975 | { | 3980 | { |
3976 | return getSizeFast(LLMessageStringTable::getInstance()->getString(blockname), | 3981 | return getSizeFast(LLMessageStringTable::getInstance()->getString(blockname), |
3977 | LLMessageStringTable::getInstance()->getString(varname)); | 3982 | LLMessageStringTable::getInstance()->getString(varname)); |
@@ -3979,13 +3984,13 @@ S32 LLMessageSystem::getSize(const char *blockname, const char *varname) | |||
3979 | 3984 | ||
3980 | // size in bytes of variable length data | 3985 | // size in bytes of variable length data |
3981 | S32 LLMessageSystem::getSizeFast(const char *blockname, S32 blocknum, | 3986 | S32 LLMessageSystem::getSizeFast(const char *blockname, S32 blocknum, |
3982 | const char *varname) | 3987 | const char *varname) const |
3983 | { | 3988 | { |
3984 | return mMessageReader->getSize(blockname, blocknum, varname); | 3989 | return mMessageReader->getSize(blockname, blocknum, varname); |
3985 | } | 3990 | } |
3986 | 3991 | ||
3987 | S32 LLMessageSystem::getSize(const char *blockname, S32 blocknum, | 3992 | S32 LLMessageSystem::getSize(const char *blockname, S32 blocknum, |
3988 | const char *varname) | 3993 | const char *varname) const |
3989 | { | 3994 | { |
3990 | return getSizeFast(LLMessageStringTable::getInstance()->getString(blockname), blocknum, | 3995 | return getSizeFast(LLMessageStringTable::getInstance()->getString(blockname), blocknum, |
3991 | LLMessageStringTable::getInstance()->getString(varname)); | 3996 | LLMessageStringTable::getInstance()->getString(varname)); |
@@ -4021,3 +4026,18 @@ bool LLMessageSystem::checkAllMessages(S64 frame_count, LLPumpIO* http_pump) | |||
4021 | http_pump->callback(); | 4026 | http_pump->callback(); |
4022 | return (mPacketsIn - packetsIn) > 0; | 4027 | return (mPacketsIn - packetsIn) > 0; |
4023 | } | 4028 | } |
4029 | |||
4030 | void LLMessageSystem::banUdpMessage(const std::string& name) | ||
4031 | { | ||
4032 | message_template_name_map_t::iterator itt = mMessageTemplates.find( | ||
4033 | LLMessageStringTable::getInstance()->getString(name.c_str()) | ||
4034 | ); | ||
4035 | if(itt != mMessageTemplates.end()) | ||
4036 | { | ||
4037 | itt->second->banUdp(); | ||
4038 | } | ||
4039 | else | ||
4040 | { | ||
4041 | llwarns << "Attempted to ban an unknown message: " << name << "." << llendl; | ||
4042 | } | ||
4043 | } | ||