diff options
Diffstat (limited to 'indra/llmessage/llmessageconfig.cpp')
-rw-r--r-- | indra/llmessage/llmessageconfig.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/indra/llmessage/llmessageconfig.cpp b/indra/llmessage/llmessageconfig.cpp index 550071fade..ed51019a22 100644 --- a/indra/llmessage/llmessageconfig.cpp +++ b/indra/llmessage/llmessageconfig.cpp @@ -66,6 +66,7 @@ public: /* virtual */ void loadFile(); void loadServerDefaults(const LLSD& data); + void loadMaxQueuedEvents(const LLSD& data); void loadMessages(const LLSD& data); void loadCapBans(const LLSD& blacklist); void loadMessageBans(const LLSD& blacklist); @@ -73,6 +74,7 @@ public: public: LLSD mCapBans; + S32 mMaxQueuedEvents; }; std::string LLMessageConfigFile::filename() @@ -112,6 +114,7 @@ void LLMessageConfigFile::loadFile() } } loadServerDefaults(data); + loadMaxQueuedEvents(data); loadMessages(data); loadCapBans(data); loadMessageBans(data); @@ -122,6 +125,19 @@ void LLMessageConfigFile::loadServerDefaults(const LLSD& data) mServerDefault = data["serverDefaults"][sServerName].asString(); } +const S32 DEFAULT_MAX_QUEUED_EVENTS = 100; +void LLMessageConfigFile::loadMaxQueuedEvents(const LLSD& data) +{ + if (data.has("maxQueuedEvents")) + { + mMaxQueuedEvents = data["maxQueuedEvents"].asInteger(); + } + else + { + mMaxQueuedEvents = DEFAULT_MAX_QUEUED_EVENTS; + } +} + void LLMessageConfigFile::loadMessages(const LLSD& data) { mMessages = data["messages"]; @@ -191,10 +207,10 @@ void LLMessageConfig::useConfig(const LLSD& config) { LLMessageConfigFile &the_file = LLMessageConfigFile::instance(); the_file.loadServerDefaults(config); + the_file.loadMaxQueuedEvents(config); the_file.loadMessages(config); the_file.loadCapBans(config); the_file.loadMessageBans(config); - } //static @@ -213,6 +229,13 @@ LLMessageConfig::Flavor LLMessageConfig::getServerDefaultFlavor() } //static +S32 LLMessageConfig::getMaxQueuedEvents() +{ + LLMessageConfigFile& file = LLMessageConfigFile::instance(); + return file.mMaxQueuedEvents; +} + +//static LLMessageConfig::Flavor LLMessageConfig::getMessageFlavor(const std::string& msg_name) { LLMessageConfigFile& file = LLMessageConfigFile::instance(); |