diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules')
8 files changed, 281 insertions, 63 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 83b534b..d39c224 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -1097,7 +1097,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1097 | 1097 | ||
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | public void SendAvatarDataImmediate(ISceneEntity avatar) | 1100 | public void SendEntityFullUpdateImmediate(ISceneEntity ent) |
1101 | { | ||
1102 | |||
1103 | } | ||
1104 | |||
1105 | public void SendEntityTerseUpdateImmediate(ISceneEntity ent) | ||
1101 | { | 1106 | { |
1102 | 1107 | ||
1103 | } | 1108 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs index ed27385..92b5831 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs | |||
@@ -134,11 +134,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
134 | private int llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint) | 134 | private int llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint) |
135 | { | 135 | { |
136 | SceneObjectPart hostPart = m_scene.GetSceneObjectPart(host); | 136 | SceneObjectPart hostPart = m_scene.GetSceneObjectPart(host); |
137 | |||
138 | if (hostPart == null) | 137 | if (hostPart == null) |
139 | return 0; | 138 | return 0; |
140 | 139 | ||
141 | if (hostPart.ParentGroup.IsAttachment) | 140 | SceneObjectGroup hostgroup = hostPart.ParentGroup; |
141 | |||
142 | if (hostgroup== null || hostgroup.IsAttachment) | ||
142 | return 0; | 143 | return 0; |
143 | 144 | ||
144 | IAttachmentsModule attachmentsModule = m_scene.RequestModuleInterface<IAttachmentsModule>(); | 145 | IAttachmentsModule attachmentsModule = m_scene.RequestModuleInterface<IAttachmentsModule>(); |
@@ -156,32 +157,32 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
156 | if (!m_scene.TryGetScenePresence(item.PermsGranter, out target)) | 157 | if (!m_scene.TryGetScenePresence(item.PermsGranter, out target)) |
157 | return 0; | 158 | return 0; |
158 | 159 | ||
159 | if (target.UUID != hostPart.ParentGroup.OwnerID) | 160 | if (target.UUID != hostgroup.OwnerID) |
160 | { | 161 | { |
161 | uint effectivePerms = hostPart.ParentGroup.GetEffectivePermissions(); | 162 | uint effectivePerms = hostgroup.EffectiveOwnerPerms; |
162 | 163 | ||
163 | if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) | 164 | if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) |
164 | return 0; | 165 | return 0; |
165 | 166 | ||
166 | hostPart.ParentGroup.SetOwnerId(target.UUID); | 167 | hostgroup.SetOwner(target.UUID, target.ControllingClient.ActiveGroupId); |
167 | hostPart.ParentGroup.SetRootPartOwner(hostPart.ParentGroup.RootPart, target.UUID, target.ControllingClient.ActiveGroupId); | ||
168 | 168 | ||
169 | if (m_scene.Permissions.PropagatePermissions()) | 169 | if (m_scene.Permissions.PropagatePermissions()) |
170 | { | 170 | { |
171 | foreach (SceneObjectPart child in hostPart.ParentGroup.Parts) | 171 | foreach (SceneObjectPart child in hostgroup.Parts) |
172 | { | 172 | { |
173 | child.Inventory.ChangeInventoryOwner(target.UUID); | 173 | child.Inventory.ChangeInventoryOwner(target.UUID); |
174 | child.TriggerScriptChangedEvent(Changed.OWNER); | 174 | child.TriggerScriptChangedEvent(Changed.OWNER); |
175 | child.ApplyNextOwnerPermissions(); | 175 | child.ApplyNextOwnerPermissions(); |
176 | } | 176 | } |
177 | hostgroup.AggregatePerms(); | ||
177 | } | 178 | } |
178 | 179 | ||
179 | hostPart.ParentGroup.RootPart.ObjectSaleType = 0; | 180 | hostgroup.RootPart.ObjectSaleType = 0; |
180 | hostPart.ParentGroup.RootPart.SalePrice = 10; | 181 | hostgroup.RootPart.SalePrice = 10; |
181 | 182 | ||
182 | hostPart.ParentGroup.HasGroupChanged = true; | 183 | hostgroup.HasGroupChanged = true; |
183 | hostPart.ParentGroup.RootPart.SendPropertiesToClient(target.ControllingClient); | 184 | hostgroup.RootPart.SendPropertiesToClient(target.ControllingClient); |
184 | hostPart.ParentGroup.RootPart.ScheduleFullUpdate(); | 185 | hostgroup.RootPart.ScheduleFullUpdate(); |
185 | } | 186 | } |
186 | 187 | ||
187 | return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, false, true) ? 1 : 0; | 188 | return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, false, true) ? 1 : 0; |
diff --git a/OpenSim/Region/OptionalModules/Framework/Monitoring/EtcdMonitoringModule.cs b/OpenSim/Region/OptionalModules/Framework/Monitoring/EtcdMonitoringModule.cs new file mode 100644 index 0000000..921bbfb --- /dev/null +++ b/OpenSim/Region/OptionalModules/Framework/Monitoring/EtcdMonitoringModule.cs | |||
@@ -0,0 +1,195 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using System.Text; | ||
32 | using log4net; | ||
33 | using Mono.Addins; | ||
34 | using Nini.Config; | ||
35 | using OpenMetaverse; | ||
36 | using OpenSim.Framework; | ||
37 | using OpenSim.Framework.Console; | ||
38 | using OpenSim.Region.Framework.Interfaces; | ||
39 | using OpenSim.Region.Framework.Scenes; | ||
40 | using netcd; | ||
41 | using netcd.Serialization; | ||
42 | using netcd.Advanced; | ||
43 | using netcd.Advanced.Requests; | ||
44 | |||
45 | namespace OpenSim.Region.OptionalModules.Framework.Monitoring | ||
46 | { | ||
47 | /// <summary> | ||
48 | /// Allows to store monitoring data in etcd, a high availability | ||
49 | /// name-value store. | ||
50 | /// </summary> | ||
51 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EtcdMonitoringModule")] | ||
52 | public class EtcdMonitoringModule : INonSharedRegionModule, IEtcdModule | ||
53 | { | ||
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
55 | |||
56 | protected Scene m_scene; | ||
57 | protected IEtcdClient m_client; | ||
58 | protected bool m_enabled = false; | ||
59 | protected string m_etcdBasePath = String.Empty; | ||
60 | protected bool m_appendRegionID = true; | ||
61 | |||
62 | public string Name | ||
63 | { | ||
64 | get { return "EtcdMonitoringModule"; } | ||
65 | } | ||
66 | |||
67 | public Type ReplaceableInterface | ||
68 | { | ||
69 | get { return null; } | ||
70 | } | ||
71 | |||
72 | public void Initialise(IConfigSource source) | ||
73 | { | ||
74 | if (source.Configs["Etcd"] == null) | ||
75 | return; | ||
76 | |||
77 | IConfig etcdConfig = source.Configs["Etcd"]; | ||
78 | |||
79 | string etcdUrls = etcdConfig.GetString("EtcdUrls", String.Empty); | ||
80 | if (etcdUrls == String.Empty) | ||
81 | return; | ||
82 | |||
83 | m_etcdBasePath = etcdConfig.GetString("BasePath", m_etcdBasePath); | ||
84 | m_appendRegionID = etcdConfig.GetBoolean("AppendRegionID", m_appendRegionID); | ||
85 | |||
86 | if (!m_etcdBasePath.EndsWith("/")) | ||
87 | m_etcdBasePath += "/"; | ||
88 | |||
89 | try | ||
90 | { | ||
91 | string[] endpoints = etcdUrls.Split(new char[] {','}); | ||
92 | List<Uri> uris = new List<Uri>(); | ||
93 | foreach (string endpoint in endpoints) | ||
94 | uris.Add(new Uri(endpoint.Trim())); | ||
95 | |||
96 | m_client = new EtcdClient(uris.ToArray(), new DefaultSerializer(), new DefaultSerializer()); | ||
97 | } | ||
98 | catch (Exception e) | ||
99 | { | ||
100 | m_log.DebugFormat("[ETCD]: Error initializing connection: " + e.ToString()); | ||
101 | return; | ||
102 | } | ||
103 | |||
104 | m_log.DebugFormat("[ETCD]: Etcd module configured"); | ||
105 | m_enabled = true; | ||
106 | } | ||
107 | |||
108 | public void Close() | ||
109 | { | ||
110 | //m_client = null; | ||
111 | m_scene = null; | ||
112 | } | ||
113 | |||
114 | public void AddRegion(Scene scene) | ||
115 | { | ||
116 | m_scene = scene; | ||
117 | |||
118 | if (m_enabled) | ||
119 | { | ||
120 | if (m_appendRegionID) | ||
121 | m_etcdBasePath += m_scene.RegionInfo.RegionID.ToString() + "/"; | ||
122 | |||
123 | m_log.DebugFormat("[ETCD]: Using base path {0} for all keys", m_etcdBasePath); | ||
124 | |||
125 | try | ||
126 | { | ||
127 | m_client.Advanced.CreateDirectory(new CreateDirectoryRequest() {Key = m_etcdBasePath}); | ||
128 | } | ||
129 | catch (Exception e) | ||
130 | { | ||
131 | m_log.ErrorFormat("Exception trying to create base path {0}: " + e.ToString(), m_etcdBasePath); | ||
132 | } | ||
133 | |||
134 | scene.RegisterModuleInterface<IEtcdModule>(this); | ||
135 | } | ||
136 | } | ||
137 | |||
138 | public void RemoveRegion(Scene scene) | ||
139 | { | ||
140 | } | ||
141 | |||
142 | public void RegionLoaded(Scene scene) | ||
143 | { | ||
144 | } | ||
145 | |||
146 | public bool Store(string k, string v) | ||
147 | { | ||
148 | return Store(k, v, 0); | ||
149 | } | ||
150 | |||
151 | public bool Store(string k, string v, int ttl) | ||
152 | { | ||
153 | Response resp = m_client.Advanced.SetKey(new SetKeyRequest() { Key = m_etcdBasePath + k, Value = v, TimeToLive = ttl }); | ||
154 | |||
155 | if (resp == null) | ||
156 | return false; | ||
157 | |||
158 | if (resp.ErrorCode.HasValue) | ||
159 | { | ||
160 | m_log.DebugFormat("[ETCD]: Error {0} ({1}) storing {2} => {3}", resp.Cause, (int)resp.ErrorCode, m_etcdBasePath + k, v); | ||
161 | |||
162 | return false; | ||
163 | } | ||
164 | |||
165 | return true; | ||
166 | } | ||
167 | |||
168 | public string Get(string k) | ||
169 | { | ||
170 | Response resp = m_client.Advanced.GetKey(new GetKeyRequest() { Key = m_etcdBasePath + k }); | ||
171 | |||
172 | if (resp == null) | ||
173 | return String.Empty; | ||
174 | |||
175 | if (resp.ErrorCode.HasValue) | ||
176 | { | ||
177 | m_log.DebugFormat("[ETCD]: Error {0} ({1}) getting {2}", resp.Cause, (int)resp.ErrorCode, m_etcdBasePath + k); | ||
178 | |||
179 | return String.Empty; | ||
180 | } | ||
181 | |||
182 | return resp.Node.Value; | ||
183 | } | ||
184 | |||
185 | public void Delete(string k) | ||
186 | { | ||
187 | m_client.Advanced.DeleteKey(new DeleteKeyRequest() { Key = m_etcdBasePath + k }); | ||
188 | } | ||
189 | |||
190 | public void Watch(string k, Action<string> callback) | ||
191 | { | ||
192 | m_client.Advanced.WatchKey(new WatchKeyRequest() { Key = m_etcdBasePath + k, Callback = (x) => { callback(x.Node.Value); } }); | ||
193 | } | ||
194 | } | ||
195 | } | ||
diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs index 52fa908..e8cb052 100644 --- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs +++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs | |||
@@ -329,7 +329,7 @@ namespace OpenSim.Region.OptionalModules.Materials | |||
329 | AssetBase matAsset = m_scene.AssetService.Get(id.ToString()); | 329 | AssetBase matAsset = m_scene.AssetService.Get(id.ToString()); |
330 | if (matAsset == null || matAsset.Data == null || matAsset.Data.Length == 0 ) | 330 | if (matAsset == null || matAsset.Data == null || matAsset.Data.Length == 0 ) |
331 | { | 331 | { |
332 | m_log.WarnFormat("[Materials]: Prim \"{0}\" ({1}) contains unknown material ID {2}", part.Name, part.UUID, id); | 332 | //m_log.WarnFormat("[Materials]: Prim \"{0}\" ({1}) contains unknown material ID {2}", part.Name, part.UUID, id); |
333 | return; | 333 | return; |
334 | } | 334 | } |
335 | 335 | ||
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index 9c0fa75..61b6d68 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | |||
@@ -52,6 +52,7 @@ namespace OpenSim.Region.OptionalModules | |||
52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
53 | private bool m_enabled; | 53 | private bool m_enabled; |
54 | 54 | ||
55 | private Scene m_scene; | ||
55 | public string Name { get { return "PrimLimitsModule"; } } | 56 | public string Name { get { return "PrimLimitsModule"; } } |
56 | 57 | ||
57 | public Type ReplaceableInterface { get { return null; } } | 58 | public Type ReplaceableInterface { get { return null; } } |
@@ -77,11 +78,12 @@ namespace OpenSim.Region.OptionalModules | |||
77 | public void AddRegion(Scene scene) | 78 | public void AddRegion(Scene scene) |
78 | { | 79 | { |
79 | if (!m_enabled) | 80 | if (!m_enabled) |
80 | { | ||
81 | return; | 81 | return; |
82 | } | 82 | |
83 | m_scene = scene; | ||
83 | scene.Permissions.OnRezObject += CanRezObject; | 84 | scene.Permissions.OnRezObject += CanRezObject; |
84 | scene.Permissions.OnObjectEntry += CanObjectEnter; | 85 | scene.Permissions.OnObjectEntry += CanObjectEnter; |
86 | scene.Permissions.OnObjectEnterWithScripts += CanObjectEnterWithScripts; | ||
85 | scene.Permissions.OnDuplicateObject += CanDuplicateObject; | 87 | scene.Permissions.OnDuplicateObject += CanDuplicateObject; |
86 | 88 | ||
87 | m_log.DebugFormat("[PRIM LIMITS]: Region {0} added", scene.RegionInfo.RegionName); | 89 | m_log.DebugFormat("[PRIM LIMITS]: Region {0} added", scene.RegionInfo.RegionName); |
@@ -89,14 +91,13 @@ namespace OpenSim.Region.OptionalModules | |||
89 | 91 | ||
90 | public void RemoveRegion(Scene scene) | 92 | public void RemoveRegion(Scene scene) |
91 | { | 93 | { |
92 | if (m_enabled) | 94 | if (!m_enabled) |
93 | { | ||
94 | return; | 95 | return; |
95 | } | ||
96 | 96 | ||
97 | scene.Permissions.OnRezObject -= CanRezObject; | 97 | m_scene.Permissions.OnRezObject -= CanRezObject; |
98 | scene.Permissions.OnObjectEntry -= CanObjectEnter; | 98 | m_scene.Permissions.OnObjectEntry -= CanObjectEnter; |
99 | scene.Permissions.OnDuplicateObject -= CanDuplicateObject; | 99 | scene.Permissions.OnObjectEnterWithScripts -= CanObjectEnterWithScripts; |
100 | m_scene.Permissions.OnDuplicateObject -= CanDuplicateObject; | ||
100 | } | 101 | } |
101 | 102 | ||
102 | public void RegionLoaded(Scene scene) | 103 | public void RegionLoaded(Scene scene) |
@@ -104,11 +105,12 @@ namespace OpenSim.Region.OptionalModules | |||
104 | m_dialogModule = scene.RequestModuleInterface<IDialogModule>(); | 105 | m_dialogModule = scene.RequestModuleInterface<IDialogModule>(); |
105 | } | 106 | } |
106 | 107 | ||
107 | private bool CanRezObject(int objectCount, UUID ownerID, Vector3 objectPosition, Scene scene) | 108 | private bool CanRezObject(int objectCount, UUID ownerID, Vector3 objectPosition) |
108 | { | 109 | { |
109 | ILandObject lo = scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); | 110 | |
111 | ILandObject lo = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); | ||
110 | 112 | ||
111 | string response = DoCommonChecks(objectCount, ownerID, lo, scene); | 113 | string response = DoCommonChecks(objectCount, ownerID, lo); |
112 | 114 | ||
113 | if (response != null) | 115 | if (response != null) |
114 | { | 116 | { |
@@ -119,88 +121,99 @@ namespace OpenSim.Region.OptionalModules | |||
119 | } | 121 | } |
120 | 122 | ||
121 | //OnDuplicateObject | 123 | //OnDuplicateObject |
122 | private bool CanDuplicateObject(int objectCount, UUID objectID, UUID ownerID, Scene scene, Vector3 objectPosition) | 124 | private bool CanDuplicateObject(SceneObjectGroup sog, ScenePresence sp) |
123 | { | 125 | { |
124 | ILandObject lo = scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); | 126 | Vector3 objectPosition = sog.AbsolutePosition; |
127 | ILandObject lo = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); | ||
125 | 128 | ||
126 | string response = DoCommonChecks(objectCount, ownerID, lo, scene); | 129 | string response = DoCommonChecks(sog.PrimCount, sp.UUID, lo); |
127 | 130 | ||
128 | if (response != null) | 131 | if (response != null) |
129 | { | 132 | { |
130 | m_dialogModule.SendAlertToUser(ownerID, response); | 133 | m_dialogModule.SendAlertToUser(sp.UUID, response); |
131 | return false; | 134 | return false; |
132 | } | 135 | } |
133 | return true; | 136 | return true; |
134 | } | 137 | } |
135 | 138 | ||
136 | private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) | 139 | private bool CanObjectEnter(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint) |
137 | { | 140 | { |
138 | if (newPoint.X < -1f || newPoint.X > (scene.RegionInfo.RegionSizeX + 1) || | 141 | float newX = newPoint.X; |
139 | newPoint.Y < -1f || newPoint.Y > (scene.RegionInfo.RegionSizeY) ) | 142 | float newY = newPoint.Y; |
143 | if (newX < -1.0f || newX > (m_scene.RegionInfo.RegionSizeX + 1.0f) || | ||
144 | newY < -1.0f || newY > (m_scene.RegionInfo.RegionSizeY + 1.0f) ) | ||
140 | return true; | 145 | return true; |
141 | 146 | ||
142 | SceneObjectPart obj = scene.GetSceneObjectPart(objectID); | 147 | if (sog == null) |
143 | |||
144 | if (obj == null) | ||
145 | return false; | 148 | return false; |
146 | 149 | ||
147 | // Prim counts are determined by the location of the root prim. if we're | 150 | ILandObject newParcel = m_scene.LandChannel.GetLandObject(newX, newY); |
148 | // moving a child prim, just let it pass | ||
149 | if (!obj.IsRoot) | ||
150 | { | ||
151 | return true; | ||
152 | } | ||
153 | |||
154 | ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); | ||
155 | 151 | ||
156 | if (newParcel == null) | 152 | if (newParcel == null) |
157 | return true; | 153 | return true; |
158 | 154 | ||
159 | Vector3 oldPoint = obj.GroupPosition; | 155 | if(!enteringRegion) |
160 | ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); | ||
161 | |||
162 | // The prim hasn't crossed a region boundry so we don't need to worry | ||
163 | // about prim counts here | ||
164 | if(oldParcel != null && oldParcel.Equals(newParcel)) | ||
165 | { | 156 | { |
166 | return true; | 157 | Vector3 oldPoint = sog.AbsolutePosition; |
158 | ILandObject oldParcel = m_scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); | ||
159 | if(oldParcel != null && oldParcel.Equals(newParcel)) | ||
160 | return true; | ||
167 | } | 161 | } |
168 | 162 | ||
169 | int objectCount = obj.ParentGroup.PrimCount; | 163 | int objectCount = sog.PrimCount; |
170 | int usedPrims = newParcel.PrimCounts.Total; | ||
171 | int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); | ||
172 | 164 | ||
173 | // TODO: Add Special Case here for temporary prims | 165 | // TODO: Add Special Case here for temporary prims |
174 | 166 | ||
175 | string response = DoCommonChecks(objectCount, obj.OwnerID, newParcel, scene); | 167 | string response = DoCommonChecks(objectCount, sog.OwnerID, newParcel); |
176 | 168 | ||
177 | if (response != null) | 169 | if (response != null) |
178 | { | 170 | { |
179 | m_dialogModule.SendAlertToUser(obj.OwnerID, response); | 171 | if(m_dialogModule != null) |
172 | m_dialogModule.SendAlertToUser(sog.OwnerID, response); | ||
180 | return false; | 173 | return false; |
181 | } | 174 | } |
182 | return true; | 175 | return true; |
183 | } | 176 | } |
184 | 177 | ||
185 | private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo, Scene scene) | 178 | private bool CanObjectEnterWithScripts(SceneObjectGroup sog, ILandObject newParcel) |
179 | { | ||
180 | if (sog == null) | ||
181 | return false; | ||
182 | |||
183 | if (newParcel == null) | ||
184 | return true; | ||
185 | |||
186 | int objectCount = sog.PrimCount; | ||
187 | |||
188 | // TODO: Add Special Case here for temporary prims | ||
189 | |||
190 | string response = DoCommonChecks(objectCount, sog.OwnerID, newParcel); | ||
191 | |||
192 | if (response != null) | ||
193 | return false; | ||
194 | |||
195 | return true; | ||
196 | } | ||
197 | |||
198 | private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo) | ||
186 | { | 199 | { |
187 | string response = null; | 200 | string response = null; |
188 | 201 | ||
189 | int OwnedParcelsCapacity = lo.GetSimulatorMaxPrimCount(); | 202 | int OwnedParcelsCapacity = lo.GetSimulatorMaxPrimCount(); |
190 | if ((objectCount + lo.PrimCounts.Total) > OwnedParcelsCapacity) | 203 | if ((objectCount + lo.PrimCounts.Total) > OwnedParcelsCapacity) |
191 | { | 204 | { |
192 | response = "Unable to rez object because the parcel is too full"; | 205 | response = "Unable to rez object because the parcel is full"; |
193 | } | 206 | } |
194 | else | 207 | else |
195 | { | 208 | { |
196 | int maxPrimsPerUser = scene.RegionInfo.MaxPrimsPerUser; | 209 | int maxPrimsPerUser = m_scene.RegionInfo.MaxPrimsPerUser; |
197 | if (maxPrimsPerUser >= 0) | 210 | if (maxPrimsPerUser >= 0) |
198 | { | 211 | { |
199 | // per-user prim limit is set | 212 | // per-user prim limit is set |
200 | if (ownerID != lo.LandData.OwnerID || lo.LandData.IsGroupOwned) | 213 | if (ownerID != lo.LandData.OwnerID || lo.LandData.IsGroupOwned) |
201 | { | 214 | { |
202 | // caller is not the sole Parcel owner | 215 | // caller is not the sole Parcel owner |
203 | EstateSettings estateSettings = scene.RegionInfo.EstateSettings; | 216 | EstateSettings estateSettings = m_scene.RegionInfo.EstateSettings; |
204 | if (ownerID != estateSettings.EstateOwner) | 217 | if (ownerID != estateSettings.EstateOwner) |
205 | { | 218 | { |
206 | // caller is NOT the Estate owner | 219 | // caller is NOT the Estate owner |
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index a9fdb66..6cf0092 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | |||
@@ -665,7 +665,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
665 | taskItem.AssetID = asset.FullID; | 665 | taskItem.AssetID = asset.FullID; |
666 | 666 | ||
667 | host.Inventory.AddInventoryItem(taskItem, false); | 667 | host.Inventory.AddInventoryItem(taskItem, false); |
668 | 668 | host.ParentGroup.AggregatePerms(); | |
669 | m_comms.DispatchReply(scriptID,1,assetID.ToString(),reqID.ToString()); | 669 | m_comms.DispatchReply(scriptID,1,assetID.ToString(),reqID.ToString()); |
670 | } | 670 | } |
671 | 671 | ||
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 6a7c735..151a202 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -813,7 +813,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
813 | { | 813 | { |
814 | } | 814 | } |
815 | 815 | ||
816 | public void SendAvatarDataImmediate(ISceneEntity avatar) | 816 | public void SendEntityFullUpdateImmediate(ISceneEntity avatar) |
817 | { | ||
818 | } | ||
819 | |||
820 | public void SendEntityTerseUpdateImmediate(ISceneEntity ent) | ||
817 | { | 821 | { |
818 | } | 822 | } |
819 | 823 | ||
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs index e22c6ea..b26fa32 100644 --- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs | |||
@@ -523,9 +523,9 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator | |||
523 | 523 | ||
524 | rootPart.AddFlag(PrimFlags.Phantom); | 524 | rootPart.AddFlag(PrimFlags.Phantom); |
525 | 525 | ||
526 | m_scene.AddNewSceneObject(sceneObject, true); | ||
527 | sceneObject.SetGroup(groupID, null); | 526 | sceneObject.SetGroup(groupID, null); |
528 | 527 | m_scene.AddNewSceneObject(sceneObject, true); | |
528 | sceneObject.AggregatePerms(); | ||
529 | return sceneObject; | 529 | return sceneObject; |
530 | } | 530 | } |
531 | 531 | ||