diff options
author | UbitUmarov | 2018-11-14 15:34:12 +0000 |
---|---|---|
committer | UbitUmarov | 2018-11-14 15:34:12 +0000 |
commit | 942fd5e6539721eb03cb0ebc3d6a130cd68801a3 (patch) | |
tree | dce2e7730cfc3387a59b20928d5b1a1039b31f1a /OpenSim/Region | |
parent | replace RemoteParcelRequest response encoding ( runprebuild needed) (diff) | |
download | opensim-SC-942fd5e6539721eb03cb0ebc3d6a130cd68801a3.zip opensim-SC-942fd5e6539721eb03cb0ebc3d6a130cd68801a3.tar.gz opensim-SC-942fd5e6539721eb03cb0ebc3d6a130cd68801a3.tar.bz2 opensim-SC-942fd5e6539721eb03cb0ebc3d6a130cd68801a3.tar.xz |
replace Enviroment response encoding ( runprebuild needed)
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs | 64 |
1 files changed, 40 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs b/OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs index c3cea7a..02378f2 100644 --- a/OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs +++ b/OpenSim/Region/CoreModules/World/LightShare/EnvironmentModule.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using System.Text; | ||
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Capabilities; | 33 | using OpenSim.Framework.Capabilities; |
@@ -55,8 +56,6 @@ namespace OpenSim.Region.CoreModules.World.LightShare | |||
55 | private static readonly string capsName = "EnvironmentSettings"; | 56 | private static readonly string capsName = "EnvironmentSettings"; |
56 | private static readonly string capsBase = "/CAPS/0020/"; | 57 | private static readonly string capsBase = "/CAPS/0020/"; |
57 | 58 | ||
58 | private LLSDEnvironmentSetResponse setResponse = null; | ||
59 | |||
60 | #region INonSharedRegionModule | 59 | #region INonSharedRegionModule |
61 | public void Initialise(IConfigSource source) | 60 | public void Initialise(IConfigSource source) |
62 | { | 61 | { |
@@ -105,7 +104,6 @@ namespace OpenSim.Region.CoreModules.World.LightShare | |||
105 | if (!Enabled) | 104 | if (!Enabled) |
106 | return; | 105 | return; |
107 | 106 | ||
108 | setResponse = new LLSDEnvironmentSetResponse(); | ||
109 | scene.EventManager.OnRegisterCaps += OnRegisterCaps; | 107 | scene.EventManager.OnRegisterCaps += OnRegisterCaps; |
110 | } | 108 | } |
111 | 109 | ||
@@ -179,7 +177,16 @@ namespace OpenSim.Region.CoreModules.World.LightShare | |||
179 | } | 177 | } |
180 | 178 | ||
181 | if (String.IsNullOrEmpty(env)) | 179 | if (String.IsNullOrEmpty(env)) |
182 | env = EnvironmentSettings.EmptySettings(UUID.Zero, regionID); | 180 | { |
181 | StringBuilder sb = LLSDxmlEncode.Start(); | ||
182 | LLSDxmlEncode.AddArray(sb); | ||
183 | LLSDxmlEncode.AddMap(sb); | ||
184 | LLSDxmlEncode.AddElem("messageID", UUID.Zero, sb); | ||
185 | LLSDxmlEncode.AddElem("regionID", regionID, sb); | ||
186 | LLSDxmlEncode.AddEndMap(sb); | ||
187 | LLSDxmlEncode.AddEndArray(sb); | ||
188 | env = LLSDxmlEncode.End(sb); | ||
189 | } | ||
183 | 190 | ||
184 | return env; | 191 | return env; |
185 | } | 192 | } |
@@ -191,33 +198,42 @@ namespace OpenSim.Region.CoreModules.World.LightShare | |||
191 | // m_log.DebugFormat("[{0}]: Environment SET handle from agentID {1} in region {2}", | 198 | // m_log.DebugFormat("[{0}]: Environment SET handle from agentID {1} in region {2}", |
192 | // Name, agentID, caps.RegionName); | 199 | // Name, agentID, caps.RegionName); |
193 | 200 | ||
194 | setResponse.regionID = regionID; | 201 | bool success = false; |
195 | setResponse.success = false; | 202 | string fail_reason = ""; |
196 | 203 | ||
197 | if (!m_scene.Permissions.CanIssueEstateCommand(agentID, false)) | 204 | if (!m_scene.Permissions.CanIssueEstateCommand(agentID, false)) |
198 | { | 205 | { |
199 | setResponse.fail_reason = "Insufficient estate permissions, settings has not been saved."; | 206 | fail_reason = "Insufficient estate permissions, settings has not been saved."; |
200 | return LLSDHelpers.SerialiseLLSDReply(setResponse); | ||
201 | } | 207 | } |
202 | 208 | else | |
203 | try | ||
204 | { | 209 | { |
205 | m_scene.SimulationDataService.StoreRegionEnvironmentSettings(regionID, request); | 210 | try |
206 | setResponse.success = true; | 211 | { |
207 | 212 | m_scene.SimulationDataService.StoreRegionEnvironmentSettings(regionID, request); | |
208 | m_log.InfoFormat("[{0}]: New Environment settings has been saved from agentID {1} in region {2}", | 213 | success = true; |
209 | Name, agentID, caps.RegionName); | 214 | |
210 | } | 215 | m_log.InfoFormat("[{0}]: New Environment settings has been saved from agentID {1} in region {2}", |
211 | catch (Exception e) | 216 | Name, agentID, caps.RegionName); |
212 | { | 217 | } |
213 | m_log.ErrorFormat("[{0}]: Environment settings has not been saved for region {1}, Exception: {2} - {3}", | 218 | catch (Exception e) |
214 | Name, caps.RegionName, e.Message, e.StackTrace); | 219 | { |
215 | 220 | m_log.ErrorFormat("[{0}]: Environment settings has not been saved for region {1}, Exception: {2} - {3}", | |
216 | setResponse.success = false; | 221 | Name, caps.RegionName, e.Message, e.StackTrace); |
217 | setResponse.fail_reason = String.Format("Environment Set for region {0} has failed, settings has not been saved.", caps.RegionName); | 222 | |
223 | success = false; | ||
224 | fail_reason = String.Format("Environment Set for region {0} has failed, settings not saved.", caps.RegionName); | ||
225 | } | ||
218 | } | 226 | } |
219 | 227 | ||
220 | return LLSDHelpers.SerialiseLLSDReply(setResponse); | 228 | StringBuilder sb = LLSDxmlEncode.Start(); |
229 | LLSDxmlEncode.AddMap(sb); | ||
230 | LLSDxmlEncode.AddElem("messageID", UUID.Zero, sb); | ||
231 | LLSDxmlEncode.AddElem("regionID", regionID, sb); | ||
232 | LLSDxmlEncode.AddElem("success", success, sb); | ||
233 | if(!success) | ||
234 | LLSDxmlEncode.AddElem("fail_reason", fail_reason, sb); | ||
235 | LLSDxmlEncode.AddEndMap(sb); | ||
236 | return LLSDxmlEncode.End(sb); | ||
221 | } | 237 | } |
222 | } | 238 | } |
223 | } | 239 | } |