diff options
author | Mandarinka Tasty | 2018-08-04 07:35:49 +0200 |
---|---|---|
committer | UbitUmarov | 2018-09-30 04:36:39 +0100 |
commit | 5751add5379140634c6d873d324b444a8fd15504 (patch) | |
tree | 54552c776dfc9b591f4fbd39b95924ef73763dd2 /OpenSim/Region/CoreModules | |
parent | minor changes (diff) | |
download | opensim-SC-5751add5379140634c6d873d324b444a8fd15504.zip opensim-SC-5751add5379140634c6d873d324b444a8fd15504.tar.gz opensim-SC-5751add5379140634c6d873d324b444a8fd15504.tar.bz2 opensim-SC-5751add5379140634c6d873d324b444a8fd15504.tar.xz |
Implementation-and-design-of-ClientOnParcelGodMark
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 97 |
1 files changed, 92 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 19b714e..a7f708a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -101,6 +101,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
101 | private bool m_showBansLines = true; | 101 | private bool m_showBansLines = true; |
102 | private UUID DefaultGodParcelGroup; | 102 | private UUID DefaultGodParcelGroup; |
103 | private string DefaultGodParcelName; | 103 | private string DefaultGodParcelName; |
104 | private UUID DefaultGodParcelOwner; | ||
104 | 105 | ||
105 | // caches ExtendedLandData | 106 | // caches ExtendedLandData |
106 | private Cache parcelInfoCache; | 107 | private Cache parcelInfoCache; |
@@ -146,7 +147,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
146 | shouldLimitParcelLayerInfoToViewDistance = landManagementConfig.GetBoolean("LimitParcelLayerUpdateDistance", shouldLimitParcelLayerInfoToViewDistance); | 147 | shouldLimitParcelLayerInfoToViewDistance = landManagementConfig.GetBoolean("LimitParcelLayerUpdateDistance", shouldLimitParcelLayerInfoToViewDistance); |
147 | parcelLayerViewDistance = landManagementConfig.GetInt("ParcelLayerViewDistance", parcelLayerViewDistance); | 148 | parcelLayerViewDistance = landManagementConfig.GetInt("ParcelLayerViewDistance", parcelLayerViewDistance); |
148 | DefaultGodParcelGroup = new UUID(landManagementConfig.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString())); | 149 | DefaultGodParcelGroup = new UUID(landManagementConfig.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString())); |
149 | DefaultGodParcelName = landManagementConfig.GetString("DefaultAdministratorParcelName", "Default Parcel"); | 150 | DefaultGodParcelName = landManagementConfig.GetString("DefaultAdministratorParcelName", "Admin Parcel"); |
151 | DefaultGodParcelOwner = new UUID(landManagementConfig.GetString("DefaultAdministratorOwnerUUID", UUID.Zero.ToString())); | ||
150 | bool disablebans = landManagementConfig.GetBoolean("DisableParcelBans", !m_allowedForcefulBans); | 152 | bool disablebans = landManagementConfig.GetBoolean("DisableParcelBans", !m_allowedForcefulBans); |
151 | m_allowedForcefulBans = !disablebans; | 153 | m_allowedForcefulBans = !disablebans; |
152 | m_showBansLines = landManagementConfig.GetBoolean("ShowParcelBansLines", m_showBansLines); | 154 | m_showBansLines = landManagementConfig.GetBoolean("ShowParcelBansLines", m_showBansLines); |
@@ -232,6 +234,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
232 | client.OnParcelFreezeUser += ClientOnParcelFreezeUser; | 234 | client.OnParcelFreezeUser += ClientOnParcelFreezeUser; |
233 | client.OnSetStartLocationRequest += ClientOnSetHome; | 235 | client.OnSetStartLocationRequest += ClientOnSetHome; |
234 | client.OnParcelBuyPass += ClientParcelBuyPass; | 236 | client.OnParcelBuyPass += ClientParcelBuyPass; |
237 | client.OnParcelGodMark += ClientOnParcelGodMark; | ||
235 | } | 238 | } |
236 | 239 | ||
237 | public void EventMakeChildAgent(ScenePresence avatar) | 240 | public void EventMakeChildAgent(ScenePresence avatar) |
@@ -2138,16 +2141,100 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2138 | { | 2141 | { |
2139 | ILandObject land = null; | 2142 | ILandObject land = null; |
2140 | List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels(); | 2143 | List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels(); |
2144 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out ScenePresence sp); | ||
2145 | |||
2146 | if (sp == null) | ||
2147 | return; | ||
2148 | if (sp.IsChildAgent || sp.IsDeleted || sp.IsInTransit || sp.IsNPC) | ||
2149 | return; | ||
2150 | |||
2151 | if (!sp.IsGod) | ||
2152 | { | ||
2153 | client.SendAlertMessage("Request denied. You're not priviliged."); | ||
2154 | return; | ||
2155 | } | ||
2156 | if (!sp.IsViewerUIGod) | ||
2157 | { | ||
2158 | client.SendAlertMessage("Please activate God Mode."); | ||
2159 | return; | ||
2160 | } | ||
2161 | |||
2162 | bool GodParcelOwner = false; | ||
2163 | if (m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, DefaultGodParcelOwner) != null) | ||
2164 | GodParcelOwner = true; | ||
2165 | |||
2166 | bool GodParcelGroup = false; | ||
2167 | if (m_groupManager != null) | ||
2168 | { | ||
2169 | if (DefaultGodParcelGroup != UUID.Zero && m_groupManager.GetGroupRecord(DefaultGodParcelGroup) != null) | ||
2170 | GodParcelGroup = true; | ||
2171 | } | ||
2172 | |||
2173 | if (!GodParcelOwner && !GodParcelGroup) | ||
2174 | { | ||
2175 | client.SendAlertMessage("Please check ini files.\n[LandManagement] config section."); | ||
2176 | return; | ||
2177 | } | ||
2178 | |||
2141 | foreach (ILandObject landObject in Land) | 2179 | foreach (ILandObject landObject in Land) |
2142 | { | 2180 | { |
2143 | if (landObject.LandData.LocalID == landID) | 2181 | if (landObject.LandData.LocalID == landID) |
2144 | { | ||
2145 | land = landObject; | 2182 | land = landObject; |
2146 | } | ||
2147 | } | 2183 | } |
2148 | land.DeedToGroup(DefaultGodParcelGroup); | 2184 | if (land == null) |
2185 | return; | ||
2186 | |||
2187 | land.LandData.AnyAVSounds = false; | ||
2188 | land.LandData.AuthBuyerID = UUID.Zero; | ||
2189 | land.LandData.Category = ParcelCategory.Linden; | ||
2190 | land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); | ||
2191 | land.LandData.Description = String.Empty; | ||
2192 | land.LandData.Dwell = 0; | ||
2193 | land.LandData.Flags = (uint)ParcelFlags.None; | ||
2194 | land.LandData.GroupAVSounds = false; | ||
2195 | land.LandData.LandingType = (byte)LandingType.Direct; | ||
2196 | land.LandData.LastDwellTimeMS = Util.GetTimeStampMS(); | ||
2197 | land.LandData.MediaAutoScale = 0; | ||
2198 | land.LandData.MediaDescription = ""; | ||
2199 | land.LandData.MediaHeight = 0; | ||
2200 | land.LandData.MediaID = UUID.Zero; | ||
2201 | land.LandData.MediaLoop = false; | ||
2202 | land.LandData.MediaType = "none/none"; | ||
2203 | land.LandData.MediaURL = String.Empty; | ||
2204 | land.LandData.MediaWidth = 0; | ||
2205 | land.LandData.MusicURL = String.Empty; | ||
2206 | land.LandData.ObscureMedia = false; | ||
2207 | land.LandData.ObscureMusic = false; | ||
2208 | land.LandData.OtherCleanTime = 0; | ||
2209 | land.LandData.ParcelAccessList = new List<LandAccessEntry>(); | ||
2210 | land.LandData.PassHours = 0; | ||
2211 | land.LandData.PassPrice = 0; | ||
2212 | land.LandData.SalePrice = 0; | ||
2213 | land.LandData.SeeAVs = false; | ||
2214 | land.LandData.SnapshotID = UUID.Zero; | ||
2215 | land.LandData.Status = ParcelStatus.Leased; | ||
2216 | |||
2217 | if (GodParcelOwner) | ||
2218 | { | ||
2219 | land.LandData.OwnerID = DefaultGodParcelOwner; | ||
2220 | land.LandData.IsGroupOwned = false; | ||
2221 | } | ||
2222 | else | ||
2223 | { | ||
2224 | land.LandData.OwnerID = DefaultGodParcelGroup; | ||
2225 | land.LandData.IsGroupOwned = true; | ||
2226 | } | ||
2227 | |||
2228 | if (GodParcelGroup) | ||
2229 | land.LandData.GroupID = DefaultGodParcelGroup; | ||
2230 | else | ||
2231 | land.LandData.GroupID = UUID.Zero; | ||
2232 | |||
2149 | land.LandData.Name = DefaultGodParcelName; | 2233 | land.LandData.Name = DefaultGodParcelName; |
2150 | land.SendLandUpdateToAvatarsOverMe(); | 2234 | m_scene.ForEachClient(SendParcelOverlay); |
2235 | land.SendLandUpdateToClient(true, client); | ||
2236 | UpdateLandObject(land.LandData.LocalID, land.LandData); | ||
2237 | m_scene.EventManager.TriggerParcelPrimCountUpdate(); | ||
2151 | } | 2238 | } |
2152 | 2239 | ||
2153 | private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) | 2240 | private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) |