aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
index e6131f1..6e3d1ff 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/POSTHandler.cs
@@ -73,6 +73,28 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
73 73
74 if (String.IsNullOrEmpty(param)) return CreateRegion(httpRequest, httpResponse); 74 if (String.IsNullOrEmpty(param)) return CreateRegion(httpRequest, httpResponse);
75 75
76 // Parse region ID and other parameters
77 param = param.TrimEnd(new char[]{'/'});
78 string[] comps = param.Split('/');
79 LLUUID regionID = (LLUUID)comps[0];
80
81 m_log.DebugFormat("{0} POST region UUID {1}", MsgID, regionID.ToString());
82 if (LLUUID.Zero == regionID) throw new Exception("missing region ID");
83
84 Scene scene = null;
85 App.SceneManager.TryGetScene(regionID, out scene);
86 if (null == scene) return Failure(httpResponse, OSHttpStatusCode.ClientErrorNotFound,
87 "POST", "cannot find region {0}", regionID.ToString());
88
89 if (2 == comps.Length) {
90 // check for {prims}
91 switch (comps[1].ToLower())
92 {
93 case "prims":
94 return LoadPrims(request, httpRequest, httpResponse, scene);
95 }
96 }
97
76 return Failure(httpResponse, OSHttpStatusCode.ClientErrorNotFound, 98 return Failure(httpResponse, OSHttpStatusCode.ClientErrorNotFound,
77 "POST", "url {0} not supported", param); 99 "POST", "url {0} not supported", param);
78 } 100 }
@@ -95,6 +117,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
95 117
96 return XmlWriterResult; 118 return XmlWriterResult;
97 } 119 }
120
121 public string LoadPrims(string requestBody, OSHttpRequest request, OSHttpResponse response, Scene scene)
122 {
123 scene.LoadPrimsFromXml2(new StringReader(requestBody), true);
124 return "";
125 }
126
98 #endregion POST methods 127 #endregion POST methods
99 } 128 }
100} 129}