diff options
author | Diva Canto | 2014-06-02 08:45:39 -0700 |
---|---|---|
committer | Diva Canto | 2014-06-02 08:45:39 -0700 |
commit | 77913eb6791227a14adf8bd06a41f5ed30eddf0f (patch) | |
tree | e2b1786dde481536b19b46712bbb69e2c18ee248 /OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |
parent | Fixes a permissions bug where a user with group powers to always rez was not ... (diff) | |
download | opensim-SC_OLD-77913eb6791227a14adf8bd06a41f5ed30eddf0f.zip opensim-SC_OLD-77913eb6791227a14adf8bd06a41f5ed30eddf0f.tar.gz opensim-SC_OLD-77913eb6791227a14adf8bd06a41f5ed30eddf0f.tar.bz2 opensim-SC_OLD-77913eb6791227a14adf8bd06a41f5ed30eddf0f.tar.xz |
Added a ResetLand method to RemoteAdmin, whereby all land is reset with the given parameters.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 44da48a..1e6e68b 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -162,6 +162,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
162 | availableMethods["admin_acl_list"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListList); | 162 | availableMethods["admin_acl_list"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListList); |
163 | availableMethods["admin_estate_reload"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcEstateReload); | 163 | availableMethods["admin_estate_reload"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcEstateReload); |
164 | 164 | ||
165 | // Land management | ||
166 | availableMethods["admin_reset_land"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcResetLand); | ||
167 | |||
165 | // Either enable full remote functionality or just selected features | 168 | // Either enable full remote functionality or just selected features |
166 | string enabledMethods = m_config.GetString("enabled_methods", "all"); | 169 | string enabledMethods = m_config.GetString("enabled_methods", "all"); |
167 | 170 | ||
@@ -2063,6 +2066,56 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2063 | responseData["success"] = true; | 2066 | responseData["success"] = true; |
2064 | } | 2067 | } |
2065 | 2068 | ||
2069 | private void XmlRpcResetLand(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient) | ||
2070 | { | ||
2071 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
2072 | Hashtable responseData = (Hashtable)response.Value; | ||
2073 | |||
2074 | string musicURL = string.Empty; | ||
2075 | UUID groupID = UUID.Zero; | ||
2076 | uint flags = 0; | ||
2077 | bool set_group = false, set_music = false, set_flags = false; | ||
2078 | |||
2079 | if (requestData.Contains("group") && requestData["group"] != null) | ||
2080 | set_group = UUID.TryParse(requestData["group"].ToString(), out groupID); | ||
2081 | if (requestData.Contains("music") && requestData["music"] != null) | ||
2082 | { | ||
2083 | musicURL = requestData["music"].ToString(); | ||
2084 | set_music = true; | ||
2085 | } | ||
2086 | if (requestData.Contains("flags") && requestData["flags"] != null) | ||
2087 | set_flags = UInt32.TryParse(requestData["flags"].ToString(), out flags); | ||
2088 | |||
2089 | m_log.InfoFormat("[RADMIN]: Received Reset Land Request group={0} musicURL={1} flags={2}", | ||
2090 | (set_group ? groupID.ToString() : "unchanged"), | ||
2091 | (set_music ? musicURL : "unchanged"), | ||
2092 | (set_flags ? flags.ToString() : "unchanged")); | ||
2093 | |||
2094 | m_application.SceneManager.ForEachScene(delegate(Scene s) | ||
2095 | { | ||
2096 | List<ILandObject> parcels = s.LandChannel.AllParcels(); | ||
2097 | foreach (ILandObject p in parcels) | ||
2098 | { | ||
2099 | if (set_music) | ||
2100 | p.LandData.MusicURL = musicURL; | ||
2101 | |||
2102 | if (set_group) | ||
2103 | p.LandData.GroupID = groupID; | ||
2104 | |||
2105 | if (set_flags) | ||
2106 | p.LandData.Flags = flags; | ||
2107 | |||
2108 | s.LandChannel.UpdateLandObject(p.LandData.LocalID, p.LandData); | ||
2109 | } | ||
2110 | } | ||
2111 | ); | ||
2112 | |||
2113 | responseData["success"] = true; | ||
2114 | |||
2115 | m_log.Info("[RADMIN]: Reset Land Request complete"); | ||
2116 | } | ||
2117 | |||
2118 | |||
2066 | /// <summary> | 2119 | /// <summary> |
2067 | /// Parse a float with the given parameter name from a request data hash table. | 2120 | /// Parse a float with the given parameter name from a request data hash table. |
2068 | /// </summary> | 2121 | /// </summary> |