diff options
author | James Cook <james@lindenlab.com> | 2007-02-27 17:52:10 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2007-02-27 17:52:10 +0000 |
commit | b5342e238a96ee00d7d2afa3883b1596291587cc (patch) | |
tree | e5743463e674ae4f1cb420aab909ad997a8a869a /indra/llcommon/llliveappconfig.cpp | |
parent | 647d29b1a2d4712ea738b408be43e56895a715b1 (diff) |
svn merge -r58163:58241 loadstone-sim-standby, reduces database load from standby sims polling the database for a region to run
Diffstat (limited to 'indra/llcommon/llliveappconfig.cpp')
-rw-r--r-- | indra/llcommon/llliveappconfig.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/indra/llcommon/llliveappconfig.cpp b/indra/llcommon/llliveappconfig.cpp new file mode 100644 index 0000000000..8bcaeb898f --- /dev/null +++ b/indra/llcommon/llliveappconfig.cpp @@ -0,0 +1,46 @@ +/**
+ * @file llliveappconfig.cpp
+ * @brief Configuration information for an LLApp that overrides indra.xml
+ *
+ * Copyright (c) 2003-$CurrentYear$, Linden Research, Inc.
+ * $License$
+ */
+
+#include "linden_common.h"
+
+#include "llliveappconfig.h"
+
+#include "llapp.h"
+#include "llsd.h"
+#include "llsdserialize.h"
+
+LLLiveAppConfig::LLLiveAppConfig(LLApp* app, const std::string& filename, F32 refresh_period)
+: LLLiveFile(filename, refresh_period),
+ mApp(app)
+{ }
+
+
+LLLiveAppConfig::~LLLiveAppConfig()
+{ }
+
+// virtual
+void LLLiveAppConfig::loadFile()
+{
+ llinfos << "LLLiveAppConfig::loadFile(): reading from "
+ << filename() << llendl;
+ llifstream file(filename().c_str());
+ LLSD config;
+ if (file.is_open())
+ {
+ LLSDSerialize::fromXML(config, file);
+ if(!config.isMap())
+ {
+ llinfos << "LLDataserverConfig::loadFile(): not an map!"
+ << " Ignoring the data." << llendl;
+ return;
+ }
+ file.close();
+ }
+ mApp->setOptionData(
+ LLApp::PRIORITY_SPECIFIC_CONFIGURATION, config);
+}
|