aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/kowopenregionsettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/kowopenregionsettings.cpp')
-rw-r--r--linden/indra/newview/kowopenregionsettings.cpp162
1 files changed, 162 insertions, 0 deletions
diff --git a/linden/indra/newview/kowopenregionsettings.cpp b/linden/indra/newview/kowopenregionsettings.cpp
new file mode 100644
index 0000000..f568473
--- /dev/null
+++ b/linden/indra/newview/kowopenregionsettings.cpp
@@ -0,0 +1,162 @@
1/*
2 * @file kowopenregionsettings.cpp
3 * @brief Handler for OpenRegionInfo event queue message.
4 *
5 * Copyright (c) 2010, Patrick Sapinski
6 *
7 * The source code in this file ("Source Code") is provided to you
8 * under the terms of the GNU General Public License, version 2.0
9 * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
10 * this distribution, or online at
11 * http://secondlifegrid.net/programs/open_source/licensing/gplv2
12 *
13 * There are special exceptions to the terms and conditions of the GPL as
14 * it is applied to this Source Code. View the full text of the exception
15 * in the file doc/FLOSS-exception.txt in this software distribution, or
16 * online at
17 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29#include "llhttpnode.h"
30#include "hippoLimits.h"
31#include "llfloatertools.h"
32#include "llviewercontrol.h"
33
34//DEBUG includes
35//#include "llsdserialize.h" //LLSDNotationStreamer - for dumping LLSD to string
36
37class OpenRegionInfoUpdate : public LLHTTPNode
38{
39 /*virtual*/ void post(
40 LLHTTPNode::ResponsePtr response,
41 const LLSD& context,
42 const LLSD& input) const
43 {
44 if (!input.isMap() || !input.has("body"))
45 {
46 llinfos << "malformed OpenRegionInfo update!" << llendl;
47 return;
48 }
49
50 LLSD body = input["body"];
51 //llinfos << "data: " << LLSDNotationStreamer(body) << llendl;
52 //llinfos << "data: " << LLSDXMLStreamer(body) << llendl;
53
54 //set the default limits/settings for this simulator type, as limits from our
55 //previous region may not exist in this one
56 gHippoLimits->setLimits();
57
58 //limits are also reset in llviewermessage.cpp when we detect a new server
59 //version, in case the destination simulator does not support OpenRegionInfo.
60
61 BOOL limitschanged = FALSE;
62
63 if ( body.has("AllowMinimap") )
64 {
65 //IMPLEMENT ME
66 }
67 if ( body.has("AllowPhysicalPrims") )
68 {
69 //IMPLEMENT ME
70 }
71 if ( body.has("DrawDistance") )
72 {
73 //IMPLEMENT ME
74 }
75 if ( body.has("ForceDrawDistance") )
76 {
77 //IMPLEMENT ME
78 }
79 if ( body.has("LSLFunctions") )
80 {
81 //IMPLEMENT ME
82 }
83 if ( body.has("MaxDragDistance") )
84 {
85 //IMPLEMENT ME
86 }
87 if ( body.has("MinHoleSize") )
88 {
89 gHippoLimits->mMinHoleSize = body["MinHoleSize"].asReal();
90 }
91 if ( body.has("MaxHollowSize") )
92 {
93 gHippoLimits->mMaxHollow = body["MaxHollowSize"].asReal();
94 }
95 if ( body.has("MaxInventoryItemsTransfer") )
96 {
97 //IMPLEMENT ME
98 }
99 if ( body.has("MaxLinkCount") )
100 {
101 gHippoLimits->mMaxLinkedPrims = body["MaxLinkCount"].asInteger();
102 }
103 if ( body.has("MaxLinkCountPhys") )
104 {
105 //IMPLEMENT ME
106 }
107 if ( body.has("MaxPhysPrimScale") )
108 {
109 //IMPLEMENT ME
110 }
111 if ( body.has("MaxPos") )
112 {
113 //IMPLEMENT ME
114 }
115 if ( body.has("MaxPrimScale") )
116 {
117 gHippoLimits->mMaxPrimScale = body["MaxPrimScale"].asReal();
118 limitschanged = TRUE;
119 }
120 if ( body.has("MinPos") )
121 {
122 //IMPLEMENT ME
123 }
124 if ( body.has("MinPrimScale") )
125 {
126 gHippoLimits->mMinPrimScale = body["MinPrimScale"].asReal();
127 limitschanged = TRUE;
128 }
129 if ( body.has("OffsetOfUTC") )
130 {
131 //IMPLEMENT ME
132 }
133 if ( body.has("RenderWater") )
134 {
135 gSavedSettings.setBOOL("RenderWater", body["RenderWater"].asBoolean());
136 }
137 if ( body.has("SayDistance") )
138 {
139 //IMPLEMENT ME
140 }
141 if ( body.has("ShoutDistance") )
142 {
143 //IMPLEMENT ME
144 }
145 if ( body.has("ToggleTeenMode") )
146 {
147 gSavedSettings.setBOOL("ToggleTeenMode", body["ToggleTeenMode"].asBoolean());
148
149 }
150 if ( body.has("WhisperDistance") )
151 {
152 //IMPLEMENT ME
153 }
154
155 if (limitschanged)
156 gFloaterTools->updateToolsSizeLimits();
157 }
158};
159
160LLHTTPRegistration<OpenRegionInfoUpdate>
161gHTTPRegistrationOpenRegionInfoUpdate(
162 "/message/OpenRegionInfo"); \ No newline at end of file