diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
22 files changed, 814 insertions, 152 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index cb39e46..6f7256e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Xml; | ||
31 | using log4net; | 32 | using log4net; |
32 | using Mono.Addins; | 33 | using Mono.Addins; |
33 | using Nini.Config; | 34 | using Nini.Config; |
@@ -224,11 +225,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
224 | public UUID RezSingleAttachmentFromInventory( | 225 | public UUID RezSingleAttachmentFromInventory( |
225 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus) | 226 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus) |
226 | { | 227 | { |
227 | m_log.DebugFormat( | 228 | return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true, null); |
228 | "[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}", | 229 | } |
229 | (AttachmentPoint)AttachmentPt, itemID, remoteClient.Name); | 230 | |
230 | 231 | public UUID RezSingleAttachmentFromInventory( | |
231 | SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt); | 232 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc) |
233 | { | ||
234 | SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt, doc); | ||
232 | 235 | ||
233 | if (updateInventoryStatus) | 236 | if (updateInventoryStatus) |
234 | { | 237 | { |
@@ -245,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
245 | } | 248 | } |
246 | 249 | ||
247 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( | 250 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( |
248 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | 251 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt, XmlDocument doc) |
249 | { | 252 | { |
250 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); | 253 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); |
251 | if (invAccess != null) | 254 | if (invAccess != null) |
@@ -279,13 +282,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
279 | if (tainted) | 282 | if (tainted) |
280 | objatt.HasGroupChanged = true; | 283 | objatt.HasGroupChanged = true; |
281 | 284 | ||
285 | if (doc != null) | ||
286 | { | ||
287 | objatt.LoadScriptState(doc); | ||
288 | objatt.ResetOwnerChangeFlag(); | ||
289 | } | ||
290 | |||
282 | // Fire after attach, so we don't get messy perms dialogs | 291 | // Fire after attach, so we don't get messy perms dialogs |
283 | // 4 == AttachedRez | 292 | // 4 == AttachedRez |
284 | objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4); | 293 | objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4); |
285 | objatt.ResumeScripts(); | 294 | objatt.ResumeScripts(); |
286 | 295 | ||
287 | // Do this last so that event listeners have access to all the effects of the attachment | 296 | // Do this last so that event listeners have access to all the effects of the attachment |
288 | m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId); | 297 | //m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId); |
289 | } | 298 | } |
290 | else | 299 | else |
291 | { | 300 | { |
@@ -322,9 +331,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
322 | if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) | 331 | if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) |
323 | { | 332 | { |
324 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 333 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
325 | item = m_scene.InventoryService.GetItem(item); | 334 | if (m_scene.InventoryService != null) |
335 | item = m_scene.InventoryService.GetItem(item); | ||
326 | 336 | ||
327 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 337 | if (presence.Appearance != null) |
338 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | ||
328 | } | 339 | } |
329 | 340 | ||
330 | return att.UUID; | 341 | return att.UUID; |
@@ -367,6 +378,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
367 | { | 378 | { |
368 | // XXYY!! | 379 | // XXYY!! |
369 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 380 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
381 | if (item == null) | ||
382 | m_log.Error("[ATTACHMENT]: item == null"); | ||
383 | if (m_scene == null) | ||
384 | m_log.Error("[ATTACHMENT]: m_scene == null"); | ||
385 | if (m_scene.InventoryService == null) | ||
386 | m_log.Error("[ATTACHMENT]: m_scene.InventoryService == null"); | ||
370 | item = m_scene.InventoryService.GetItem(item); | 387 | item = m_scene.InventoryService.GetItem(item); |
371 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); | 388 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); |
372 | 389 | ||
@@ -455,6 +472,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
455 | if (group.GetFromItemID() == itemID) | 472 | if (group.GetFromItemID() == itemID) |
456 | { | 473 | { |
457 | m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); | 474 | m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); |
475 | // CM / XMREngine!!!! Needed to conclude attach event | ||
476 | SceneObjectSerializer.ToOriginalXmlFormat(group); | ||
458 | group.DetachToInventoryPrep(); | 477 | group.DetachToInventoryPrep(); |
459 | m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); | 478 | m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); |
460 | UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID); | 479 | UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index ef5efdd..2a590f1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -49,7 +49,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
49 | private int m_shoutdistance = 100; | 49 | private int m_shoutdistance = 100; |
50 | private int m_whisperdistance = 10; | 50 | private int m_whisperdistance = 10; |
51 | private List<Scene> m_scenes = new List<Scene>(); | 51 | private List<Scene> m_scenes = new List<Scene>(); |
52 | 52 | private List<string> FreezeCache = new List<string>(); | |
53 | private string m_adminPrefix = ""; | ||
53 | internal object m_syncy = new object(); | 54 | internal object m_syncy = new object(); |
54 | 55 | ||
55 | internal IConfig m_config; | 56 | internal IConfig m_config; |
@@ -76,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
76 | m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); | 77 | m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); |
77 | m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance); | 78 | m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance); |
78 | m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance); | 79 | m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance); |
80 | m_adminPrefix = config.Configs["Chat"].GetString("admin_prefix", ""); | ||
79 | } | 81 | } |
80 | 82 | ||
81 | public virtual void AddRegion(Scene scene) | 83 | public virtual void AddRegion(Scene scene) |
@@ -171,7 +173,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
171 | return; | 173 | return; |
172 | } | 174 | } |
173 | 175 | ||
174 | DeliverChatToAvatars(ChatSourceType.Agent, c); | 176 | if (FreezeCache.Contains(c.Sender.AgentId.ToString())) |
177 | { | ||
178 | if (c.Type != ChatTypeEnum.StartTyping || c.Type != ChatTypeEnum.StopTyping) | ||
179 | c.Sender.SendAgentAlertMessage("You may not talk as you are frozen.", false); | ||
180 | } | ||
181 | else | ||
182 | { | ||
183 | DeliverChatToAvatars(ChatSourceType.Agent, c); | ||
184 | } | ||
175 | } | 185 | } |
176 | 186 | ||
177 | public virtual void OnChatFromWorld(Object sender, OSChatMessage c) | 187 | public virtual void OnChatFromWorld(Object sender, OSChatMessage c) |
@@ -185,6 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
185 | protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c) | 195 | protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c) |
186 | { | 196 | { |
187 | string fromName = c.From; | 197 | string fromName = c.From; |
198 | string fromNamePrefix = ""; | ||
188 | UUID fromID = UUID.Zero; | 199 | UUID fromID = UUID.Zero; |
189 | string message = c.Message; | 200 | string message = c.Message; |
190 | IScene scene = c.Scene; | 201 | IScene scene = c.Scene; |
@@ -207,7 +218,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
207 | fromPos = avatar.AbsolutePosition; | 218 | fromPos = avatar.AbsolutePosition; |
208 | fromName = avatar.Name; | 219 | fromName = avatar.Name; |
209 | fromID = c.Sender.AgentId; | 220 | fromID = c.Sender.AgentId; |
210 | 221 | if (avatar.GodLevel >= 200) | |
222 | { | ||
223 | fromNamePrefix = m_adminPrefix; | ||
224 | } | ||
211 | break; | 225 | break; |
212 | 226 | ||
213 | case ChatSourceType.Object: | 227 | case ChatSourceType.Object: |
@@ -227,7 +241,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
227 | s.ForEachScenePresence( | 241 | s.ForEachScenePresence( |
228 | delegate(ScenePresence presence) | 242 | delegate(ScenePresence presence) |
229 | { | 243 | { |
230 | TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType); | 244 | ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); |
245 | if (Presencecheck != null) | ||
246 | { | ||
247 | // This will pass all chat from objects. Not | ||
248 | // perfect, but it will do. For now. Better | ||
249 | // than the prior behavior of muting all | ||
250 | // objects on a parcel with access restrictions | ||
251 | if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) | ||
252 | { | ||
253 | TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix+fromName, c.Type, message, sourceType); | ||
254 | } | ||
255 | } | ||
256 | |||
231 | } | 257 | } |
232 | ); | 258 | ); |
233 | } | 259 | } |
@@ -268,25 +294,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
268 | } | 294 | } |
269 | 295 | ||
270 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); | 296 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); |
271 | 297 | if (c.Scene != null) | |
272 | ((Scene)c.Scene).ForEachScenePresence( | 298 | { |
273 | delegate(ScenePresence presence) | 299 | ((Scene)c.Scene).ForEachScenePresence |
274 | { | 300 | ( |
275 | // ignore chat from child agents | 301 | delegate(ScenePresence presence) |
276 | if (presence.IsChildAgent) return; | 302 | { |
277 | 303 | // ignore chat from child agents | |
278 | IClientAPI client = presence.ControllingClient; | 304 | if (presence.IsChildAgent) return; |
279 | 305 | ||
280 | // don't forward SayOwner chat from objects to | 306 | IClientAPI client = presence.ControllingClient; |
281 | // non-owner agents | 307 | |
282 | if ((c.Type == ChatTypeEnum.Owner) && | 308 | // don't forward SayOwner chat from objects to |
283 | (null != c.SenderObject) && | 309 | // non-owner agents |
284 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | 310 | if ((c.Type == ChatTypeEnum.Owner) && |
285 | return; | 311 | (null != c.SenderObject) && |
286 | 312 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | |
287 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, | 313 | return; |
288 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | 314 | |
289 | }); | 315 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, |
316 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | ||
317 | } | ||
318 | ); | ||
319 | } | ||
290 | } | 320 | } |
291 | 321 | ||
292 | 322 | ||
@@ -315,5 +345,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
315 | presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, | 345 | presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, |
316 | fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); | 346 | fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); |
317 | } | 347 | } |
348 | |||
349 | Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>(); | ||
350 | public void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | ||
351 | { | ||
352 | System.Threading.Timer Timer; | ||
353 | if (flags == 0) | ||
354 | { | ||
355 | FreezeCache.Add(target.ToString()); | ||
356 | System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen); | ||
357 | Timer = new System.Threading.Timer(timeCB, target, 30000, 0); | ||
358 | Timers.Add(target, Timer); | ||
359 | } | ||
360 | else | ||
361 | { | ||
362 | FreezeCache.Remove(target.ToString()); | ||
363 | Timers.TryGetValue(target, out Timer); | ||
364 | Timers.Remove(target); | ||
365 | Timer.Dispose(); | ||
366 | } | ||
367 | } | ||
368 | |||
369 | private void OnEndParcelFrozen(object avatar) | ||
370 | { | ||
371 | UUID target = (UUID)avatar; | ||
372 | FreezeCache.Remove(target.ToString()); | ||
373 | System.Threading.Timer Timer; | ||
374 | Timers.TryGetValue(target, out Timer); | ||
375 | Timers.Remove(target); | ||
376 | Timer.Dispose(); | ||
377 | } | ||
318 | } | 378 | } |
319 | } | 379 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index 2b3d2a9..a514a83 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | |||
@@ -239,4 +239,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
239 | return result; | 239 | return result; |
240 | } | 240 | } |
241 | } | 241 | } |
242 | } \ No newline at end of file | 242 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 7a21d5e..21ed9dc 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -273,7 +273,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
273 | 273 | ||
274 | // Inform the friends that this user is online | 274 | // Inform the friends that this user is online |
275 | StatusChange(agentID, true); | 275 | StatusChange(agentID, true); |
276 | 276 | ||
277 | // Register that we need to send the list of online friends to this user | 277 | // Register that we need to send the list of online friends to this user |
278 | lock (m_NeedsListOfFriends) | 278 | lock (m_NeedsListOfFriends) |
279 | m_NeedsListOfFriends.Add(agentID); | 279 | m_NeedsListOfFriends.Add(agentID); |
@@ -701,7 +701,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
701 | // we're done | 701 | // we're done |
702 | return true; | 702 | return true; |
703 | } | 703 | } |
704 | 704 | ||
705 | return false; | 705 | return false; |
706 | } | 706 | } |
707 | 707 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index bafb802..d2dc1ab 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |||
@@ -156,6 +156,31 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
156 | return; | 156 | return; |
157 | } | 157 | } |
158 | 158 | ||
159 | DateTime dt = DateTime.UtcNow; | ||
160 | |||
161 | // Ticks from UtcNow, but make it look like local. Evil, huh? | ||
162 | dt = DateTime.SpecifyKind(dt, DateTimeKind.Local); | ||
163 | |||
164 | try | ||
165 | { | ||
166 | // Convert that to the PST timezone | ||
167 | TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles"); | ||
168 | dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo); | ||
169 | } | ||
170 | catch | ||
171 | { | ||
172 | //m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp."); | ||
173 | } | ||
174 | |||
175 | // And make it look local again to fool the unix time util | ||
176 | dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); | ||
177 | |||
178 | im.timestamp = (uint)Util.ToUnixTime(dt); | ||
179 | |||
180 | // If client is null, this message comes from storage and IS offline | ||
181 | if (client != null) | ||
182 | im.offline = 0; | ||
183 | |||
159 | if (m_TransferModule != null) | 184 | if (m_TransferModule != null) |
160 | { | 185 | { |
161 | im.fromAgentName = client.FirstName + " " + client.LastName; | 186 | im.fromAgentName = client.FirstName + " " + client.LastName; |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 9b1222b..2a405ac 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -145,8 +145,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
145 | ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; | 145 | ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; |
146 | if (!user.IsChildAgent) | 146 | if (!user.IsChildAgent) |
147 | { | 147 | { |
148 | // Local message | 148 | // m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); |
149 | m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); | ||
150 | user.ControllingClient.SendInstantMessage(im); | 149 | user.ControllingClient.SendInstantMessage(im); |
151 | 150 | ||
152 | // Message sent | 151 | // Message sent |
@@ -168,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
168 | // Local message | 167 | // Local message |
169 | ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; | 168 | ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; |
170 | 169 | ||
171 | m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); | 170 | // m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); |
172 | user.ControllingClient.SendInstantMessage(im); | 171 | user.ControllingClient.SendInstantMessage(im); |
173 | 172 | ||
174 | // Message sent | 173 | // Message sent |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index fdfcd10..feeb9e6 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | |||
@@ -172,13 +172,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
172 | 172 | ||
173 | private void RetrieveInstantMessages(IClientAPI client) | 173 | private void RetrieveInstantMessages(IClientAPI client) |
174 | { | 174 | { |
175 | if (m_RestURL != "") | 175 | if (m_RestURL == String.Empty) |
176 | { | 176 | return; |
177 | m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId); | ||
178 | 177 | ||
179 | List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>( | 178 | m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId); |
179 | |||
180 | List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>( | ||
180 | "POST", m_RestURL + "/RetrieveMessages/", client.AgentId); | 181 | "POST", m_RestURL + "/RetrieveMessages/", client.AgentId); |
181 | 182 | ||
183 | if (msglist != null) | ||
184 | { | ||
182 | foreach (GridInstantMessage im in msglist) | 185 | foreach (GridInstantMessage im in msglist) |
183 | { | 186 | { |
184 | // client.SendInstantMessage(im); | 187 | // client.SendInstantMessage(im); |
@@ -189,6 +192,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
189 | // Needed for proper state management for stored group | 192 | // Needed for proper state management for stored group |
190 | // invitations | 193 | // invitations |
191 | // | 194 | // |
195 | |||
196 | im.offline = 1; | ||
197 | |||
198 | // Reconstruct imSessionID | ||
199 | if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) | ||
200 | { | ||
201 | UUID fromAgentID = new UUID(im.fromAgentID); | ||
202 | UUID sessionID = fromAgentID ^ client.AgentId; | ||
203 | im.imSessionID = new Guid(sessionID.ToString()); | ||
204 | } | ||
205 | |||
192 | Scene s = FindScene(client.AgentId); | 206 | Scene s = FindScene(client.AgentId); |
193 | if (s != null) | 207 | if (s != null) |
194 | s.EventManager.TriggerIncomingInstantMessage(im); | 208 | s.EventManager.TriggerIncomingInstantMessage(im); |
@@ -198,26 +212,37 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
198 | 212 | ||
199 | private void UndeliveredMessage(GridInstantMessage im) | 213 | private void UndeliveredMessage(GridInstantMessage im) |
200 | { | 214 | { |
201 | if ((im.offline != 0) | 215 | if (im.dialog != (byte)InstantMessageDialog.MessageFromObject && |
202 | && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) | 216 | im.dialog != (byte)InstantMessageDialog.MessageFromAgent && |
217 | im.dialog != (byte)InstantMessageDialog.GroupNotice && | ||
218 | im.dialog != (byte)InstantMessageDialog.InventoryOffered) | ||
203 | { | 219 | { |
204 | bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( | 220 | return; |
205 | "POST", m_RestURL+"/SaveMessage/", im); | 221 | } |
206 | 222 | ||
207 | if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) | 223 | // It's not delivered. Make sure the scope id is saved |
208 | { | 224 | // We don't need the imSessionID here anymore, overwrite it |
209 | IClientAPI client = FindClient(new UUID(im.fromAgentID)); | 225 | Scene scene = FindScene(new UUID(im.fromAgentID)); |
210 | if (client == null) | 226 | if (scene == null) |
211 | return; | 227 | scene = m_SceneList[0]; |
212 | 228 | im.imSessionID = new Guid(scene.RegionInfo.ScopeID.ToString()); | |
213 | client.SendInstantMessage(new GridInstantMessage( | 229 | |
214 | null, new UUID(im.toAgentID), | 230 | bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( |
215 | "System", new UUID(im.fromAgentID), | 231 | "POST", m_RestURL+"/SaveMessage/", im); |
216 | (byte)InstantMessageDialog.MessageFromAgent, | 232 | |
217 | "User is not logged in. "+ | 233 | if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) |
218 | (success ? "Message saved." : "Message not saved"), | 234 | { |
219 | false, new Vector3())); | 235 | IClientAPI client = FindClient(new UUID(im.fromAgentID)); |
220 | } | 236 | if (client == null) |
237 | return; | ||
238 | |||
239 | client.SendInstantMessage(new GridInstantMessage( | ||
240 | null, new UUID(im.toAgentID), | ||
241 | "System", new UUID(im.fromAgentID), | ||
242 | (byte)InstantMessageDialog.MessageFromAgent, | ||
243 | "User is not logged in. "+ | ||
244 | (success ? "Message saved." : "Message not saved"), | ||
245 | false, new Vector3())); | ||
221 | } | 246 | } |
222 | } | 247 | } |
223 | } | 248 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index d1274e9..a08a628 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -159,10 +159,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
159 | 159 | ||
160 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) | 160 | private void OnInstantMessage(IClientAPI client, GridInstantMessage im) |
161 | { | 161 | { |
162 | m_log.DebugFormat( | 162 | //m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog); |
163 | "[INVENTORY TRANSFER]: {0} IM type received from {1}", | 163 | |
164 | (InstantMessageDialog)im.dialog, client.Name); | ||
165 | |||
166 | Scene scene = FindClientScene(client.AgentId); | 164 | Scene scene = FindClientScene(client.AgentId); |
167 | 165 | ||
168 | if (scene == null) // Something seriously wrong here. | 166 | if (scene == null) // Something seriously wrong here. |
@@ -248,6 +246,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
248 | im.imSessionID = itemID.Guid; | 246 | im.imSessionID = itemID.Guid; |
249 | } | 247 | } |
250 | 248 | ||
249 | im.offline = 1; // Remember these | ||
250 | |||
251 | // Send the IM to the recipient. The item is already | 251 | // Send the IM to the recipient. The item is already |
252 | // in their inventory, so it will not be lost if | 252 | // in their inventory, so it will not be lost if |
253 | // they are offline. | 253 | // they are offline. |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 81f49b6..1cd2ff4 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
99 | 99 | ||
100 | protected virtual void OnNewClient(IClientAPI client) | 100 | protected virtual void OnNewClient(IClientAPI client) |
101 | { | 101 | { |
102 | client.OnTeleportHomeRequest += TeleportHome; | 102 | client.OnTeleportHomeRequest += TeleportHomeFired; |
103 | } | 103 | } |
104 | 104 | ||
105 | public virtual void Close() | 105 | public virtual void Close() |
@@ -268,7 +268,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
268 | // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, | 268 | // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, |
269 | // it's actually doing a lot of work. | 269 | // it's actually doing a lot of work. |
270 | IPEndPoint endPoint = finalDestination.ExternalEndPoint; | 270 | IPEndPoint endPoint = finalDestination.ExternalEndPoint; |
271 | if (endPoint.Address != null) | 271 | if (endPoint != null && endPoint.Address != null) |
272 | { | 272 | { |
273 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from | 273 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from |
274 | // both regions | 274 | // both regions |
@@ -455,6 +455,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
455 | // Now let's make it officially a child agent | 455 | // Now let's make it officially a child agent |
456 | sp.MakeChildAgent(); | 456 | sp.MakeChildAgent(); |
457 | 457 | ||
458 | sp.Scene.CleanDroppedAttachments(); | ||
459 | |||
458 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 460 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
459 | 461 | ||
460 | if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 462 | if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
@@ -561,7 +563,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
561 | 563 | ||
562 | #region Teleport Home | 564 | #region Teleport Home |
563 | 565 | ||
564 | public virtual void TeleportHome(UUID id, IClientAPI client) | 566 | public void TeleportHomeFired(UUID id, IClientAPI client) |
567 | { | ||
568 | TeleportHome(id, client); | ||
569 | } | ||
570 | |||
571 | public virtual bool TeleportHome(UUID id, IClientAPI client) | ||
565 | { | 572 | { |
566 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); | 573 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); |
567 | 574 | ||
@@ -570,14 +577,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
570 | 577 | ||
571 | if (uinfo != null) | 578 | if (uinfo != null) |
572 | { | 579 | { |
580 | if (uinfo.HomeRegionID == UUID.Zero) | ||
581 | { | ||
582 | // can't find the Home region: Tell viewer and abort | ||
583 | client.SendTeleportFailed("You don't have a home position set."); | ||
584 | return false; | ||
585 | } | ||
573 | GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); | 586 | GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); |
574 | if (regionInfo == null) | 587 | if (regionInfo == null) |
575 | { | 588 | { |
576 | // can't find the Home region: Tell viewer and abort | 589 | // can't find the Home region: Tell viewer and abort |
577 | client.SendTeleportFailed("Your home region could not be found."); | 590 | client.SendTeleportFailed("Your home region could not be found."); |
578 | return; | 591 | return false; |
579 | } | 592 | } |
580 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", | 593 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", |
581 | regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); | 594 | regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); |
582 | 595 | ||
583 | // a little eekie that this goes back to Scene and with a forced cast, will fix that at some point... | 596 | // a little eekie that this goes back to Scene and with a forced cast, will fix that at some point... |
@@ -585,6 +598,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
585 | client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt, | 598 | client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt, |
586 | (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); | 599 | (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); |
587 | } | 600 | } |
601 | else | ||
602 | { | ||
603 | // can't find the Home region: Tell viewer and abort | ||
604 | client.SendTeleportFailed("Your home region could not be found."); | ||
605 | return false; | ||
606 | } | ||
607 | return true; | ||
588 | } | 608 | } |
589 | 609 | ||
590 | #endregion | 610 | #endregion |
@@ -872,15 +892,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
872 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); | 892 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); |
873 | 893 | ||
874 | IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); | 894 | IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); |
875 | if (eq != null) | 895 | IPEndPoint neighbourExternal = neighbourRegion.ExternalEndPoint; |
876 | { | 896 | if (neighbourExternal != null) |
877 | eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | ||
878 | capsPath, agent.UUID, agent.ControllingClient.SessionId); | ||
879 | } | ||
880 | else | ||
881 | { | 897 | { |
882 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | 898 | if (eq != null) |
883 | capsPath); | 899 | { |
900 | eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal, | ||
901 | capsPath, agent.UUID, agent.ControllingClient.SessionId); | ||
902 | } | ||
903 | else | ||
904 | { | ||
905 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal, | ||
906 | capsPath); | ||
907 | } | ||
884 | } | 908 | } |
885 | 909 | ||
886 | if (!WaitForCallback(agent.UUID)) | 910 | if (!WaitForCallback(agent.UUID)) |
@@ -978,10 +1002,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
978 | agent.Viewer = currentAgentCircuit.Viewer; | 1002 | agent.Viewer = currentAgentCircuit.Viewer; |
979 | } | 1003 | } |
980 | 1004 | ||
981 | InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; | 1005 | IPEndPoint external = region.ExternalEndPoint; |
982 | d.BeginInvoke(sp, agent, region, region.ExternalEndPoint, true, | 1006 | if (external != null) |
1007 | { | ||
1008 | InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; | ||
1009 | d.BeginInvoke(sp, agent, region, external, true, | ||
983 | InformClientOfNeighbourCompleted, | 1010 | InformClientOfNeighbourCompleted, |
984 | d); | 1011 | d); |
1012 | } | ||
985 | } | 1013 | } |
986 | #endregion | 1014 | #endregion |
987 | 1015 | ||
@@ -1110,6 +1138,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1110 | InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; | 1138 | InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; |
1111 | try | 1139 | try |
1112 | { | 1140 | { |
1141 | //neighbour.ExternalEndPoint may return null, which will be caught | ||
1113 | d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent, | 1142 | d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent, |
1114 | InformClientOfNeighbourCompleted, | 1143 | InformClientOfNeighbourCompleted, |
1115 | d); | 1144 | d); |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 1ac7508..47898cc 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
86 | 86 | ||
87 | protected override void OnNewClient(IClientAPI client) | 87 | protected override void OnNewClient(IClientAPI client) |
88 | { | 88 | { |
89 | client.OnTeleportHomeRequest += TeleportHome; | 89 | client.OnTeleportHomeRequest += TeleportHomeFired; |
90 | client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed); | 90 | client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed); |
91 | } | 91 | } |
92 | 92 | ||
@@ -174,7 +174,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
174 | return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); | 174 | return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); |
175 | } | 175 | } |
176 | 176 | ||
177 | public override void TeleportHome(UUID id, IClientAPI client) | 177 | public void TeleportHomeFired(UUID id, IClientAPI client) |
178 | { | ||
179 | TeleportHome(id, client); | ||
180 | } | ||
181 | |||
182 | public override bool TeleportHome(UUID id, IClientAPI client) | ||
178 | { | 183 | { |
179 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); | 184 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName); |
180 | 185 | ||
@@ -184,8 +189,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
184 | { | 189 | { |
185 | // local grid user | 190 | // local grid user |
186 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); | 191 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local"); |
187 | base.TeleportHome(id, client); | 192 | return base.TeleportHome(id, client); |
188 | return; | ||
189 | } | 193 | } |
190 | 194 | ||
191 | // Foreign user wants to go home | 195 | // Foreign user wants to go home |
@@ -195,7 +199,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
195 | { | 199 | { |
196 | client.SendTeleportFailed("Your information has been lost"); | 200 | client.SendTeleportFailed("Your information has been lost"); |
197 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information"); | 201 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information"); |
198 | return; | 202 | return false; |
199 | } | 203 | } |
200 | 204 | ||
201 | IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString()); | 205 | IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString()); |
@@ -205,7 +209,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
205 | { | 209 | { |
206 | client.SendTeleportFailed("Your home region could not be found"); | 210 | client.SendTeleportFailed("Your home region could not be found"); |
207 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found"); | 211 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found"); |
208 | return; | 212 | return false; |
209 | } | 213 | } |
210 | 214 | ||
211 | ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId); | 215 | ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId); |
@@ -213,7 +217,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
213 | { | 217 | { |
214 | client.SendTeleportFailed("Internal error"); | 218 | client.SendTeleportFailed("Internal error"); |
215 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be"); | 219 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be"); |
216 | return; | 220 | return false; |
217 | } | 221 | } |
218 | 222 | ||
219 | IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>(); | 223 | IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>(); |
@@ -223,6 +227,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
223 | aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName); | 227 | aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName); |
224 | 228 | ||
225 | DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq); | 229 | DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq); |
230 | return true; | ||
226 | } | 231 | } |
227 | #endregion | 232 | #endregion |
228 | 233 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index c1d6cd3..42e3359 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -219,6 +219,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
219 | 219 | ||
220 | Vector3 originalPosition = objectGroup.AbsolutePosition; | 220 | Vector3 originalPosition = objectGroup.AbsolutePosition; |
221 | 221 | ||
222 | // Restore attachment data after trip through the sim | ||
223 | if (objectGroup.RootPart.AttachPoint > 0) | ||
224 | inventoryStoredPosition = objectGroup.RootPart.AttachOffset; | ||
225 | objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint; | ||
226 | |||
222 | objectGroup.AbsolutePosition = inventoryStoredPosition; | 227 | objectGroup.AbsolutePosition = inventoryStoredPosition; |
223 | 228 | ||
224 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); | 229 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); |
@@ -491,6 +496,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
491 | 496 | ||
492 | if (item != null) | 497 | if (item != null) |
493 | { | 498 | { |
499 | if (item.ID == UUID.Zero) | ||
500 | { | ||
501 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 1"); | ||
502 | } | ||
503 | |||
494 | AssetBase rezAsset = m_Scene.AssetService.Get(item.AssetID.ToString()); | 504 | AssetBase rezAsset = m_Scene.AssetService.Get(item.AssetID.ToString()); |
495 | 505 | ||
496 | if (rezAsset != null) | 506 | if (rezAsset != null) |
@@ -513,17 +523,30 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
513 | itemId = item.ID; | 523 | itemId = item.ID; |
514 | } | 524 | } |
515 | 525 | ||
526 | if (item.ID == UUID.Zero) | ||
527 | { | ||
528 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 2"); | ||
529 | } | ||
530 | |||
516 | string xmlData = Utils.BytesToString(rezAsset.Data); | 531 | string xmlData = Utils.BytesToString(rezAsset.Data); |
517 | SceneObjectGroup group | 532 | SceneObjectGroup group |
518 | = SceneObjectSerializer.FromOriginalXmlFormat(itemId, xmlData); | 533 | = SceneObjectSerializer.FromOriginalXmlFormat(itemId, xmlData); |
519 | 534 | Vector3 storedPosition = group.AbsolutePosition; | |
535 | if (group.UUID == UUID.Zero) | ||
536 | { | ||
537 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 3"); | ||
538 | } | ||
520 | group.RootPart.FromFolderID = item.Folder; | 539 | group.RootPart.FromFolderID = item.Folder; |
521 | 540 | ||
522 | // If it's rezzed in world, select it. Much easier to | 541 | // If it's rezzed in world, select it. Much easier to |
523 | // find small items. | 542 | // find small items. |
524 | // | 543 | // |
525 | if (!attachment) | 544 | if (!attachment) |
545 | { | ||
526 | group.RootPart.CreateSelected = true; | 546 | group.RootPart.CreateSelected = true; |
547 | foreach (SceneObjectPart child in group.Parts) | ||
548 | child.CreateSelected = true; | ||
549 | } | ||
527 | 550 | ||
528 | if (!m_Scene.Permissions.CanRezObject( | 551 | if (!m_Scene.Permissions.CanRezObject( |
529 | group.PrimCount, remoteClient.AgentId, pos) | 552 | group.PrimCount, remoteClient.AgentId, pos) |
@@ -538,9 +561,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
538 | remoteClient.SendBulkUpdateInventory(item); | 561 | remoteClient.SendBulkUpdateInventory(item); |
539 | return null; | 562 | return null; |
540 | } | 563 | } |
541 | 564 | if (group.UUID == UUID.Zero) | |
565 | { | ||
566 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 4"); | ||
567 | } | ||
542 | group.ResetIDs(); | 568 | group.ResetIDs(); |
543 | 569 | if (group.UUID == UUID.Zero) | |
570 | { | ||
571 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 5"); | ||
572 | } | ||
544 | if (attachment) | 573 | if (attachment) |
545 | { | 574 | { |
546 | group.RootPart.Flags |= PrimFlags.Phantom; | 575 | group.RootPart.Flags |= PrimFlags.Phantom; |
@@ -572,7 +601,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
572 | { | 601 | { |
573 | group.SetFromItemID(itemID); | 602 | group.SetFromItemID(itemID); |
574 | } | 603 | } |
575 | 604 | if (group.UUID == UUID.Zero) | |
605 | { | ||
606 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 6"); | ||
607 | } | ||
576 | SceneObjectPart rootPart = null; | 608 | SceneObjectPart rootPart = null; |
577 | try | 609 | try |
578 | { | 610 | { |
@@ -587,7 +619,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
587 | 619 | ||
588 | m_log.Error("[AGENT INVENTORY]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment); | 620 | m_log.Error("[AGENT INVENTORY]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment); |
589 | } | 621 | } |
590 | 622 | if (group.UUID == UUID.Zero) | |
623 | { | ||
624 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 7"); | ||
625 | } | ||
591 | // Since renaming the item in the inventory does not affect the name stored | 626 | // Since renaming the item in the inventory does not affect the name stored |
592 | // in the serialization, transfer the correct name from the inventory to the | 627 | // in the serialization, transfer the correct name from the inventory to the |
593 | // object itself before we rez. | 628 | // object itself before we rez. |
@@ -613,6 +648,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
613 | group.ApplyNextOwnerPermissions(); | 648 | group.ApplyNextOwnerPermissions(); |
614 | } | 649 | } |
615 | } | 650 | } |
651 | if (group.UUID == UUID.Zero) | ||
652 | { | ||
653 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 8"); | ||
654 | } | ||
616 | 655 | ||
617 | foreach (SceneObjectPart part in group.Parts) | 656 | foreach (SceneObjectPart part in group.Parts) |
618 | { | 657 | { |
@@ -626,13 +665,23 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
626 | part.EveryoneMask = item.EveryOnePermissions; | 665 | part.EveryoneMask = item.EveryOnePermissions; |
627 | part.NextOwnerMask = item.NextPermissions; | 666 | part.NextOwnerMask = item.NextPermissions; |
628 | } | 667 | } |
629 | 668 | if (group.UUID == UUID.Zero) | |
669 | { | ||
670 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 9"); | ||
671 | } | ||
630 | rootPart.TrimPermissions(); | 672 | rootPart.TrimPermissions(); |
631 | 673 | if (group.UUID == UUID.Zero) | |
674 | { | ||
675 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 10"); | ||
676 | } | ||
632 | if (!attachment) | 677 | if (!attachment) |
633 | { | 678 | { |
634 | if (group.RootPart.Shape.PCode == (byte)PCode.Prim) | 679 | if (group.RootPart.Shape.PCode == (byte)PCode.Prim) |
635 | { | 680 | { |
681 | // Save attachment data | ||
682 | group.RootPart.AttachPoint = group.RootPart.Shape.State; | ||
683 | group.RootPart.AttachOffset = storedPosition; | ||
684 | |||
636 | group.ClearPartAttachmentData(); | 685 | group.ClearPartAttachmentData(); |
637 | } | 686 | } |
638 | 687 | ||
@@ -658,8 +707,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
658 | } | 707 | } |
659 | } | 708 | } |
660 | } | 709 | } |
661 | 710 | if (group.UUID == UUID.Zero) | |
662 | return rootPart.ParentGroup; | 711 | { |
712 | m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 11"); | ||
713 | } | ||
714 | return group; | ||
663 | } | 715 | } |
664 | } | 716 | } |
665 | 717 | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 9b565ed..1fd1f47 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
142 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); | 142 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); |
143 | return urlcode; | 143 | return urlcode; |
144 | } | 144 | } |
145 | string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/"; | 145 | string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString(); |
146 | 146 | ||
147 | UrlData urlData = new UrlData(); | 147 | UrlData urlData = new UrlData(); |
148 | urlData.hostID = host.UUID; | 148 | urlData.hostID = host.UUID; |
@@ -152,10 +152,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
152 | urlData.urlcode = urlcode; | 152 | urlData.urlcode = urlcode; |
153 | urlData.requests = new Dictionary<UUID, RequestData>(); | 153 | urlData.requests = new Dictionary<UUID, RequestData>(); |
154 | 154 | ||
155 | |||
156 | m_UrlMap[url] = urlData; | 155 | m_UrlMap[url] = urlData; |
157 | 156 | ||
158 | string uri = "/lslhttp/" + urlcode.ToString() + "/"; | 157 | string uri = "/lslhttp/" + urlcode.ToString(); |
159 | 158 | ||
160 | m_HttpServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, | 159 | m_HttpServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, |
161 | new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, | 160 | new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, |
@@ -386,6 +385,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
386 | 385 | ||
387 | return response; | 386 | return response; |
388 | } | 387 | } |
388 | |||
389 | public void HttpRequestHandler(UUID requestID, Hashtable request) | 389 | public void HttpRequestHandler(UUID requestID, Hashtable request) |
390 | { | 390 | { |
391 | lock (request) | 391 | lock (request) |
@@ -400,8 +400,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
400 | 400 | ||
401 | int pos1 = uri.IndexOf("/");// /lslhttp | 401 | int pos1 = uri.IndexOf("/");// /lslhttp |
402 | int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/ | 402 | int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/ |
403 | int pos3 = uri.IndexOf("/", pos2 + 1);// /lslhttp/<UUID>/ | 403 | int pos3 = pos2 + 37; // /lslhttp/urlcode |
404 | string uri_tmp = uri.Substring(0, pos3 + 1); | 404 | string uri_tmp = uri.Substring(0, pos3); |
405 | //HTTP server code doesn't provide us with QueryStrings | 405 | //HTTP server code doesn't provide us with QueryStrings |
406 | string pathInfo; | 406 | string pathInfo; |
407 | string queryString; | 407 | string queryString; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index e54ee02..ebfba2b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs | |||
@@ -57,9 +57,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
57 | config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); | 57 | config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); |
58 | config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); | 58 | config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); |
59 | config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); | 59 | config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); |
60 | config.Configs["GridService"].Set("Region_Test_Region_1", "DefaultRegion"); | 60 | config.Configs["GridService"].Set("Region_Test_Region_1", "DefaultRegion"); |
61 | config.Configs["GridService"].Set("Region_Test_Region_2", "FallbackRegion"); | 61 | config.Configs["GridService"].Set("Region_Test_Region_2", "FallbackRegion"); |
62 | config.Configs["GridService"].Set("Region_Test_Region_3", "FallbackRegion"); | 62 | config.Configs["GridService"].Set("Region_Test_Region_3", "FallbackRegion"); |
63 | config.Configs["GridService"].Set("Region_Other_Region_4", "FallbackRegion"); | 63 | config.Configs["GridService"].Set("Region_Other_Region_4", "FallbackRegion"); |
64 | 64 | ||
65 | m_LocalConnector = new LocalGridServicesConnector(config); | 65 | m_LocalConnector = new LocalGridServicesConnector(config); |
@@ -128,8 +128,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
128 | Assert.IsNotNull(result, "Retrieved GetRegionByName is null"); | 128 | Assert.IsNotNull(result, "Retrieved GetRegionByName is null"); |
129 | Assert.That(result.RegionName, Is.EqualTo("Test Region 1"), "Retrieved region's name does not match"); | 129 | Assert.That(result.RegionName, Is.EqualTo("Test Region 1"), "Retrieved region's name does not match"); |
130 | 130 | ||
131 | m_LocalConnector.RegisterRegion(UUID.Zero, r2); | 131 | m_LocalConnector.RegisterRegion(UUID.Zero, r2); |
132 | m_LocalConnector.RegisterRegion(UUID.Zero, r3); | 132 | m_LocalConnector.RegisterRegion(UUID.Zero, r3); |
133 | m_LocalConnector.RegisterRegion(UUID.Zero, r4); | 133 | m_LocalConnector.RegisterRegion(UUID.Zero, r4); |
134 | 134 | ||
135 | result = m_LocalConnector.GetRegionByUUID(UUID.Zero, new UUID(1)); | 135 | result = m_LocalConnector.GetRegionByUUID(UUID.Zero, new UUID(1)); |
@@ -154,38 +154,38 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
154 | Assert.IsNotNull(results, "Retrieved GetRegionRange collection is null"); | 154 | Assert.IsNotNull(results, "Retrieved GetRegionRange collection is null"); |
155 | Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected"); | 155 | Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected"); |
156 | 156 | ||
157 | results = m_LocalConnector.GetDefaultRegions(UUID.Zero); | 157 | results = m_LocalConnector.GetDefaultRegions(UUID.Zero); |
158 | Assert.IsNotNull(results, "Retrieved GetDefaultRegions collection is null"); | 158 | Assert.IsNotNull(results, "Retrieved GetDefaultRegions collection is null"); |
159 | Assert.That(results.Count, Is.EqualTo(1), "Retrieved default regions collection has not the expected size"); | 159 | Assert.That(results.Count, Is.EqualTo(1), "Retrieved default regions collection has not the expected size"); |
160 | Assert.That(results[0].RegionID, Is.EqualTo(new UUID(1)), "Retrieved default region's UUID does not match"); | 160 | Assert.That(results[0].RegionID, Is.EqualTo(new UUID(1)), "Retrieved default region's UUID does not match"); |
161 | 161 | ||
162 | results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r1.RegionLocX, r1.RegionLocY); | 162 | results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r1.RegionLocX, r1.RegionLocY); |
163 | Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 1 is null"); | 163 | Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 1 is null"); |
164 | Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 1 has not the expected size"); | 164 | Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 1 has not the expected size"); |
165 | Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); | 165 | Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); |
166 | Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); | 166 | Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); |
167 | Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); | 167 | Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); |
168 | 168 | ||
169 | results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r2.RegionLocX, r2.RegionLocY); | 169 | results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r2.RegionLocX, r2.RegionLocY); |
170 | Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 2 is null"); | 170 | Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 2 is null"); |
171 | Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 2 has not the expected size"); | 171 | Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 2 has not the expected size"); |
172 | Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 2-4-3"); | 172 | Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 2-4-3"); |
173 | Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 2-4-3"); | 173 | Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 2-4-3"); |
174 | Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 2-4-3"); | 174 | Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 2-4-3"); |
175 | 175 | ||
176 | results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r3.RegionLocX, r3.RegionLocY); | 176 | results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r3.RegionLocX, r3.RegionLocY); |
177 | Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 3 is null"); | 177 | Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 3 is null"); |
178 | Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 3 has not the expected size"); | 178 | Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 3 has not the expected size"); |
179 | Assert.That(results[0].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 3-4-2"); | 179 | Assert.That(results[0].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 3-4-2"); |
180 | Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 3-4-2"); | 180 | Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 3-4-2"); |
181 | Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 3-4-2"); | 181 | Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 3-4-2"); |
182 | 182 | ||
183 | results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r4.RegionLocX, r4.RegionLocY); | 183 | results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r4.RegionLocX, r4.RegionLocY); |
184 | Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 4 is null"); | 184 | Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 4 is null"); |
185 | Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 4 has not the expected size"); | 185 | Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 4 has not the expected size"); |
186 | Assert.That(results[0].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 4-3-2"); | 186 | Assert.That(results[0].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 4-3-2"); |
187 | Assert.That(results[1].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 4-3-2"); | 187 | Assert.That(results[1].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 4-3-2"); |
188 | Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 4-3-2"); | 188 | Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 4-3-2"); |
189 | 189 | ||
190 | results = m_LocalConnector.GetHyperlinks(UUID.Zero); | 190 | results = m_LocalConnector.GetHyperlinks(UUID.Zero); |
191 | Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null"); | 191 | Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null"); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index e32dbb3..329a259 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -290,6 +290,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
290 | return false; | 290 | return false; |
291 | } | 291 | } |
292 | 292 | ||
293 | public bool CloseChildAgent(GridRegion destination, UUID id) | ||
294 | { | ||
295 | if (destination == null) | ||
296 | return false; | ||
297 | |||
298 | foreach (Scene s in m_sceneList) | ||
299 | { | ||
300 | if (s.RegionInfo.RegionID == destination.RegionID) | ||
301 | { | ||
302 | //m_log.Debug("[LOCAL COMMS]: Found region to SendCloseAgent"); | ||
303 | return s.IncomingCloseChildAgent(id); | ||
304 | } | ||
305 | } | ||
306 | //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); | ||
307 | return false; | ||
308 | } | ||
309 | |||
293 | /** | 310 | /** |
294 | * Object-related communications | 311 | * Object-related communications |
295 | */ | 312 | */ |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 3f577f2..e16e273 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -252,6 +252,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
252 | return false; | 252 | return false; |
253 | } | 253 | } |
254 | 254 | ||
255 | public bool CloseChildAgent(GridRegion destination, UUID id) | ||
256 | { | ||
257 | if (destination == null) | ||
258 | return false; | ||
259 | |||
260 | // Try local first | ||
261 | if (m_localBackend.CloseChildAgent(destination, id)) | ||
262 | return true; | ||
263 | |||
264 | // else do the remote thing | ||
265 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | ||
266 | return m_remoteConnector.CloseChildAgent(destination, id); | ||
267 | |||
268 | return false; | ||
269 | } | ||
255 | 270 | ||
256 | public bool CloseAgent(GridRegion destination, UUID id) | 271 | public bool CloseAgent(GridRegion destination, UUID id) |
257 | { | 272 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index 7c12b8c..64788db 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
57 | if (account != null) | 57 | if (account != null) |
58 | m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); | 58 | m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); |
59 | 59 | ||
60 | m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); | 60 | // m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); |
61 | } | 61 | } |
62 | 62 | ||
63 | public UserAccount Get(UUID userID, out bool inCache) | 63 | public UserAccount Get(UUID userID, out bool inCache) |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 6b538f6..4af7a1b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -263,6 +263,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
263 | // being no copy/no mod for everyone | 263 | // being no copy/no mod for everyone |
264 | lock (part.TaskInventory) | 264 | lock (part.TaskInventory) |
265 | { | 265 | { |
266 | if (!ResolveUserUuid(part.CreatorID)) | ||
267 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
268 | |||
269 | if (!ResolveUserUuid(part.OwnerID)) | ||
270 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
271 | |||
272 | if (!ResolveUserUuid(part.LastOwnerID)) | ||
273 | part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
274 | |||
275 | // And zap any troublesome sit target information | ||
276 | part.SitTargetOrientation = new Quaternion(0, 0, 0, 1); | ||
277 | part.SitTargetPosition = new Vector3(0, 0, 0); | ||
278 | |||
279 | // Fix ownership/creator of inventory items | ||
280 | // Not doing so results in inventory items | ||
281 | // being no copy/no mod for everyone | ||
282 | part.TaskInventory.LockItemsForRead(true); | ||
266 | TaskInventoryDictionary inv = part.TaskInventory; | 283 | TaskInventoryDictionary inv = part.TaskInventory; |
267 | foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) | 284 | foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) |
268 | { | 285 | { |
@@ -275,6 +292,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
275 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 292 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
276 | } | 293 | } |
277 | } | 294 | } |
295 | part.TaskInventory.LockItemsForRead(false); | ||
278 | } | 296 | } |
279 | } | 297 | } |
280 | 298 | ||
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 5025c88..fb15d91 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -29,6 +29,7 @@ using System.Collections.Generic; | |||
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Security; | 31 | using System.Security; |
32 | using System.Timers; | ||
32 | using log4net; | 33 | using log4net; |
33 | using Nini.Config; | 34 | using Nini.Config; |
34 | using OpenMetaverse; | 35 | using OpenMetaverse; |
@@ -45,6 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
45 | private delegate void LookupUUIDS(List<UUID> uuidLst); | 46 | private delegate void LookupUUIDS(List<UUID> uuidLst); |
46 | 47 | ||
47 | private Scene m_scene; | 48 | private Scene m_scene; |
49 | private Timer m_regionChangeTimer = new Timer(); | ||
48 | 50 | ||
49 | private EstateTerrainXferHandler TerrainUploader; | 51 | private EstateTerrainXferHandler TerrainUploader; |
50 | 52 | ||
@@ -250,7 +252,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
250 | 252 | ||
251 | if ((estateAccessType & 4) != 0) // User add | 253 | if ((estateAccessType & 4) != 0) // User add |
252 | { | 254 | { |
253 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 255 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) |
254 | { | 256 | { |
255 | m_scene.RegionInfo.EstateSettings.AddEstateUser(user); | 257 | m_scene.RegionInfo.EstateSettings.AddEstateUser(user); |
256 | m_scene.RegionInfo.EstateSettings.Save(); | 258 | m_scene.RegionInfo.EstateSettings.Save(); |
@@ -265,7 +267,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
265 | } | 267 | } |
266 | if ((estateAccessType & 8) != 0) // User remove | 268 | if ((estateAccessType & 8) != 0) // User remove |
267 | { | 269 | { |
268 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 270 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) |
269 | { | 271 | { |
270 | m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user); | 272 | m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user); |
271 | m_scene.RegionInfo.EstateSettings.Save(); | 273 | m_scene.RegionInfo.EstateSettings.Save(); |
@@ -280,7 +282,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
280 | } | 282 | } |
281 | if ((estateAccessType & 16) != 0) // Group add | 283 | if ((estateAccessType & 16) != 0) // Group add |
282 | { | 284 | { |
283 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 285 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) |
284 | { | 286 | { |
285 | m_scene.RegionInfo.EstateSettings.AddEstateGroup(user); | 287 | m_scene.RegionInfo.EstateSettings.AddEstateGroup(user); |
286 | m_scene.RegionInfo.EstateSettings.Save(); | 288 | m_scene.RegionInfo.EstateSettings.Save(); |
@@ -294,7 +296,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
294 | } | 296 | } |
295 | if ((estateAccessType & 32) != 0) // Group remove | 297 | if ((estateAccessType & 32) != 0) // Group remove |
296 | { | 298 | { |
297 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 299 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) |
298 | { | 300 | { |
299 | m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); | 301 | m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); |
300 | m_scene.RegionInfo.EstateSettings.Save(); | 302 | m_scene.RegionInfo.EstateSettings.Save(); |
@@ -343,7 +345,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
343 | { | 345 | { |
344 | if (!s.IsChildAgent) | 346 | if (!s.IsChildAgent) |
345 | { | 347 | { |
346 | m_scene.TeleportClientHome(user, s.ControllingClient); | 348 | if (!m_scene.TeleportClientHome(user, s.ControllingClient)) |
349 | { | ||
350 | s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out."); | ||
351 | s.ControllingClient.Close(); | ||
352 | } | ||
347 | } | 353 | } |
348 | } | 354 | } |
349 | 355 | ||
@@ -477,7 +483,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
477 | ScenePresence s = m_scene.GetScenePresence(prey); | 483 | ScenePresence s = m_scene.GetScenePresence(prey); |
478 | if (s != null) | 484 | if (s != null) |
479 | { | 485 | { |
480 | m_scene.TeleportClientHome(prey, s.ControllingClient); | 486 | if (!m_scene.TeleportClientHome(prey, s.ControllingClient)) |
487 | { | ||
488 | s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); | ||
489 | s.ControllingClient.Close(); | ||
490 | } | ||
481 | } | 491 | } |
482 | } | 492 | } |
483 | } | 493 | } |
@@ -496,7 +506,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
496 | // Also make sure they are actually in the region | 506 | // Also make sure they are actually in the region |
497 | if (p != null && !p.IsChildAgent) | 507 | if (p != null && !p.IsChildAgent) |
498 | { | 508 | { |
499 | m_scene.TeleportClientHome(p.UUID, p.ControllingClient); | 509 | if (!m_scene.TeleportClientHome(p.UUID, p.ControllingClient)) |
510 | { | ||
511 | p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); | ||
512 | p.ControllingClient.Close(); | ||
513 | } | ||
500 | } | 514 | } |
501 | } | 515 | } |
502 | }); | 516 | }); |
@@ -896,6 +910,9 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
896 | m_scene.RegisterModuleInterface<IEstateModule>(this); | 910 | m_scene.RegisterModuleInterface<IEstateModule>(this); |
897 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; | 911 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; |
898 | m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; | 912 | m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight; |
913 | m_regionChangeTimer.AutoReset = false; | ||
914 | m_regionChangeTimer.Interval = 2000; | ||
915 | m_regionChangeTimer.Elapsed += RaiseRegionInfoChange; | ||
899 | 916 | ||
900 | m_scene.AddCommand(this, "set terrain texture", | 917 | m_scene.AddCommand(this, "set terrain texture", |
901 | "set terrain texture <number> <uuid> [<x>] [<y>]", | 918 | "set terrain texture <number> <uuid> [<x>] [<y>]", |
@@ -1166,6 +1183,12 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
1166 | 1183 | ||
1167 | protected void TriggerRegionInfoChange() | 1184 | protected void TriggerRegionInfoChange() |
1168 | { | 1185 | { |
1186 | m_regionChangeTimer.Stop(); | ||
1187 | m_regionChangeTimer.Start(); | ||
1188 | } | ||
1189 | |||
1190 | protected void RaiseRegionInfoChange(object sender, ElapsedEventArgs e) | ||
1191 | { | ||
1169 | ChangeDelegate change = OnRegionInfoChange; | 1192 | ChangeDelegate change = OnRegionInfoChange; |
1170 | 1193 | ||
1171 | if (change != null) | 1194 | if (change != null) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 634685a..5bd72ee 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -85,6 +85,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
85 | private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; | 85 | private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; |
86 | 86 | ||
87 | private bool m_allowedForcefulBans = true; | 87 | private bool m_allowedForcefulBans = true; |
88 | private UUID DefaultGodParcelGroup; | ||
89 | private string DefaultGodParcelName; | ||
88 | 90 | ||
89 | // caches ExtendedLandData | 91 | // caches ExtendedLandData |
90 | private Cache parcelInfoCache; | 92 | private Cache parcelInfoCache; |
@@ -99,6 +101,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
99 | 101 | ||
100 | public void Initialise(IConfigSource source) | 102 | public void Initialise(IConfigSource source) |
101 | { | 103 | { |
104 | IConfig cnf = source.Configs["LandManagement"]; | ||
105 | if (cnf != null) | ||
106 | { | ||
107 | DefaultGodParcelGroup = new UUID(cnf.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString())); | ||
108 | DefaultGodParcelName = cnf.GetString("DefaultAdministratorParcelName", "Default Parcel"); | ||
109 | } | ||
102 | } | 110 | } |
103 | 111 | ||
104 | public void AddRegion(Scene scene) | 112 | public void AddRegion(Scene scene) |
@@ -350,7 +358,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
350 | { | 358 | { |
351 | if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) | 359 | if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT) |
352 | { | 360 | { |
353 | if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) | 361 | if (parcelAvatarIsEntering.IsEitherBannedOrRestricted(avatar.UUID)) |
354 | { | 362 | { |
355 | SendYouAreBannedNotice(avatar); | 363 | SendYouAreBannedNotice(avatar); |
356 | ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar)); | 364 | ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar)); |
@@ -647,7 +655,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
647 | int x; | 655 | int x; |
648 | int y; | 656 | int y; |
649 | 657 | ||
650 | if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0) | 658 | if (x_float > Constants.RegionSize || x_float < 0 || y_float > Constants.RegionSize || y_float < 0) |
651 | return null; | 659 | return null; |
652 | 660 | ||
653 | try | 661 | try |
@@ -990,6 +998,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
990 | //Owner Flag | 998 | //Owner Flag |
991 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); | 999 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER); |
992 | } | 1000 | } |
1001 | else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID)) | ||
1002 | { | ||
1003 | tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_GROUP); | ||
1004 | } | ||
993 | else if (currentParcelBlock.LandData.SalePrice > 0 && | 1005 | else if (currentParcelBlock.LandData.SalePrice > 0 && |
994 | (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || | 1006 | (currentParcelBlock.LandData.AuthBuyerID == UUID.Zero || |
995 | currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) | 1007 | currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId)) |
@@ -1292,18 +1304,31 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1292 | 1304 | ||
1293 | public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) | 1305 | public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) |
1294 | { | 1306 | { |
1295 | for (int i = 0; i < data.Count; i++) | 1307 | lock (m_landList) |
1296 | { | 1308 | { |
1297 | IncomingLandObjectFromStorage(data[i]); | 1309 | //Remove all the land objects in the sim and then process our new data |
1310 | foreach (int n in m_landList.Keys) | ||
1311 | { | ||
1312 | m_scene.EventManager.TriggerLandObjectRemoved(m_landList[n].LandData.GlobalID); | ||
1313 | } | ||
1314 | m_landIDList.Initialize(); | ||
1315 | m_landList.Clear(); | ||
1316 | |||
1317 | for (int i = 0; i < data.Count; i++) | ||
1318 | { | ||
1319 | IncomingLandObjectFromStorage(data[i]); | ||
1320 | } | ||
1298 | } | 1321 | } |
1299 | } | 1322 | } |
1300 | 1323 | ||
1301 | public void IncomingLandObjectFromStorage(LandData data) | 1324 | public void IncomingLandObjectFromStorage(LandData data) |
1302 | { | 1325 | { |
1326 | |||
1303 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); | 1327 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); |
1304 | new_land.LandData = data.Copy(); | 1328 | new_land.LandData = data.Copy(); |
1305 | new_land.SetLandBitmapFromByteArray(); | 1329 | new_land.SetLandBitmapFromByteArray(); |
1306 | AddLandObject(new_land); | 1330 | AddLandObject(new_land); |
1331 | new_land.SendLandUpdateToAvatarsOverMe(); | ||
1307 | } | 1332 | } |
1308 | 1333 | ||
1309 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) | 1334 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) |
@@ -1576,5 +1601,321 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1576 | 1601 | ||
1577 | UpdateLandObject(localID, land.LandData); | 1602 | UpdateLandObject(localID, land.LandData); |
1578 | } | 1603 | } |
1604 | |||
1605 | public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID) | ||
1606 | { | ||
1607 | ILandObject land = null; | ||
1608 | List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels(); | ||
1609 | foreach (ILandObject landObject in Land) | ||
1610 | { | ||
1611 | if (landObject.LandData.LocalID == landID) | ||
1612 | { | ||
1613 | land = landObject; | ||
1614 | } | ||
1615 | } | ||
1616 | land.DeedToGroup(DefaultGodParcelGroup); | ||
1617 | land.LandData.Name = DefaultGodParcelName; | ||
1618 | land.SendLandUpdateToAvatarsOverMe(); | ||
1619 | } | ||
1620 | |||
1621 | private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID) | ||
1622 | { | ||
1623 | ScenePresence SP; | ||
1624 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP); | ||
1625 | List<SceneObjectGroup> returns = new List<SceneObjectGroup>(); | ||
1626 | if (SP.GodLevel != 0) | ||
1627 | { | ||
1628 | if (flags == 0) //All parcels, scripted or not | ||
1629 | { | ||
1630 | ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e) | ||
1631 | { | ||
1632 | if (e.OwnerID == targetID) | ||
1633 | { | ||
1634 | returns.Add(e); | ||
1635 | } | ||
1636 | } | ||
1637 | ); | ||
1638 | } | ||
1639 | if (flags == 4) //All parcels, scripted object | ||
1640 | { | ||
1641 | ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e) | ||
1642 | { | ||
1643 | if (e.OwnerID == targetID) | ||
1644 | { | ||
1645 | if (e.scriptScore >= 0.01) | ||
1646 | { | ||
1647 | returns.Add(e); | ||
1648 | } | ||
1649 | } | ||
1650 | } | ||
1651 | ); | ||
1652 | } | ||
1653 | if (flags == 4) //not target parcel, scripted object | ||
1654 | { | ||
1655 | ((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e) | ||
1656 | { | ||
1657 | if (e.OwnerID == targetID) | ||
1658 | { | ||
1659 | ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y); | ||
1660 | if (landobject.LandData.OwnerID != e.OwnerID) | ||
1661 | { | ||
1662 | if (e.scriptScore >= 0.01) | ||
1663 | { | ||
1664 | returns.Add(e); | ||
1665 | } | ||
1666 | } | ||
1667 | } | ||
1668 | } | ||
1669 | ); | ||
1670 | } | ||
1671 | foreach (SceneObjectGroup ol in returns) | ||
1672 | { | ||
1673 | ReturnObject(ol, client); | ||
1674 | } | ||
1675 | } | ||
1676 | } | ||
1677 | public void ReturnObject(SceneObjectGroup obj, IClientAPI client) | ||
1678 | { | ||
1679 | SceneObjectGroup[] objs = new SceneObjectGroup[1]; | ||
1680 | objs[0] = obj; | ||
1681 | ((Scene)client.Scene).returnObjects(objs, client.AgentId); | ||
1682 | } | ||
1683 | |||
1684 | Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>(); | ||
1685 | |||
1686 | public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | ||
1687 | { | ||
1688 | ScenePresence targetAvatar = null; | ||
1689 | ((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar); | ||
1690 | ScenePresence parcelManager = null; | ||
1691 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager); | ||
1692 | System.Threading.Timer Timer; | ||
1693 | |||
1694 | if (targetAvatar.GodLevel == 0) | ||
1695 | { | ||
1696 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | ||
1697 | if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land)) | ||
1698 | return; | ||
1699 | if (flags == 0) | ||
1700 | { | ||
1701 | targetAvatar.AllowMovement = false; | ||
1702 | targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has frozen you for 30 seconds. You cannot move or interact with the world."); | ||
1703 | parcelManager.ControllingClient.SendAlertMessage("Avatar Frozen."); | ||
1704 | System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen); | ||
1705 | Timer = new System.Threading.Timer(timeCB, targetAvatar, 30000, 0); | ||
1706 | Timers.Add(targetAvatar.UUID, Timer); | ||
1707 | } | ||
1708 | else | ||
1709 | { | ||
1710 | targetAvatar.AllowMovement = true; | ||
1711 | targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has unfrozen you."); | ||
1712 | parcelManager.ControllingClient.SendAlertMessage("Avatar Unfrozen."); | ||
1713 | Timers.TryGetValue(targetAvatar.UUID, out Timer); | ||
1714 | Timers.Remove(targetAvatar.UUID); | ||
1715 | Timer.Dispose(); | ||
1716 | } | ||
1717 | } | ||
1718 | } | ||
1719 | private void OnEndParcelFrozen(object avatar) | ||
1720 | { | ||
1721 | ScenePresence targetAvatar = (ScenePresence)avatar; | ||
1722 | targetAvatar.AllowMovement = true; | ||
1723 | System.Threading.Timer Timer; | ||
1724 | Timers.TryGetValue(targetAvatar.UUID, out Timer); | ||
1725 | Timers.Remove(targetAvatar.UUID); | ||
1726 | targetAvatar.ControllingClient.SendAgentAlertMessage("The freeze has worn off; you may go about your business.", false); | ||
1727 | } | ||
1728 | |||
1729 | |||
1730 | public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | ||
1731 | { | ||
1732 | ScenePresence targetAvatar = null; | ||
1733 | ((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar); | ||
1734 | ScenePresence parcelManager = null; | ||
1735 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager); | ||
1736 | //Just eject | ||
1737 | if (flags == 0) | ||
1738 | { | ||
1739 | if (targetAvatar.GodLevel == 0) | ||
1740 | { | ||
1741 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | ||
1742 | if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land)) | ||
1743 | return; | ||
1744 | |||
1745 | Vector3 position = new Vector3(0, 0, 0); | ||
1746 | List<ILandObject> allParcels = new List<ILandObject>(); | ||
1747 | allParcels = AllParcels(); | ||
1748 | if (allParcels.Count != 1) | ||
1749 | { | ||
1750 | foreach (ILandObject parcel in allParcels) | ||
1751 | { | ||
1752 | if (parcel.LandData.GlobalID != land.LandData.GlobalID) | ||
1753 | { | ||
1754 | if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true) | ||
1755 | { | ||
1756 | for (int x = 1; x <= Constants.RegionSize; x += 2) | ||
1757 | { | ||
1758 | for (int y = 1; y <= Constants.RegionSize; y += 2) | ||
1759 | { | ||
1760 | if (parcel.ContainsPoint(x, y)) | ||
1761 | { | ||
1762 | position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z); | ||
1763 | targetAvatar.TeleportWithMomentum(position); | ||
1764 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1765 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | ||
1766 | return; | ||
1767 | } | ||
1768 | } | ||
1769 | } | ||
1770 | } | ||
1771 | } | ||
1772 | } | ||
1773 | } | ||
1774 | Vector3 targetVector; | ||
1775 | if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y) | ||
1776 | { | ||
1777 | if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize) | ||
1778 | { | ||
1779 | targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ; | ||
1780 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1781 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1782 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | ||
1783 | return; | ||
1784 | } | ||
1785 | else | ||
1786 | { | ||
1787 | targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ; | ||
1788 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1789 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1790 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | ||
1791 | return; | ||
1792 | } | ||
1793 | } | ||
1794 | else | ||
1795 | { | ||
1796 | if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize) | ||
1797 | { | ||
1798 | targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ; | ||
1799 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1800 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1801 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | ||
1802 | return; | ||
1803 | } | ||
1804 | else | ||
1805 | { | ||
1806 | targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ; | ||
1807 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1808 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1809 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); | ||
1810 | return; | ||
1811 | } | ||
1812 | } | ||
1813 | } | ||
1814 | } | ||
1815 | //Eject and ban | ||
1816 | if (flags == 1) | ||
1817 | { | ||
1818 | if (targetAvatar.GodLevel == 0) | ||
1819 | { | ||
1820 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | ||
1821 | if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land)) | ||
1822 | return; | ||
1823 | |||
1824 | Vector3 position = new Vector3(0, 0, 0); | ||
1825 | List<ILandObject> allParcels = new List<ILandObject>(); | ||
1826 | allParcels = AllParcels(); | ||
1827 | if (allParcels.Count != 1) | ||
1828 | { | ||
1829 | foreach (ILandObject parcel in allParcels) | ||
1830 | { | ||
1831 | if (parcel.LandData.GlobalID != land.LandData.GlobalID) | ||
1832 | { | ||
1833 | if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true) | ||
1834 | { | ||
1835 | for (int x = 1; x <= Constants.RegionSize; x += 2) | ||
1836 | { | ||
1837 | for (int y = 1; y <= Constants.RegionSize; y += 2) | ||
1838 | { | ||
1839 | if (parcel.ContainsPoint(x, y)) | ||
1840 | { | ||
1841 | position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z); | ||
1842 | targetAvatar.TeleportWithMomentum(position); | ||
1843 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1844 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned."); | ||
1845 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
1846 | entry.AgentID = targetAvatar.UUID; | ||
1847 | entry.Flags = AccessList.Ban; | ||
1848 | entry.Time = new DateTime(); | ||
1849 | land.LandData.ParcelAccessList.Add(entry); | ||
1850 | return; | ||
1851 | } | ||
1852 | } | ||
1853 | } | ||
1854 | } | ||
1855 | } | ||
1856 | } | ||
1857 | } | ||
1858 | Vector3 targetVector; | ||
1859 | if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y) | ||
1860 | { | ||
1861 | if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize) | ||
1862 | { | ||
1863 | targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ; | ||
1864 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1865 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1866 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned."); | ||
1867 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
1868 | entry.AgentID = targetAvatar.UUID; | ||
1869 | entry.Flags = AccessList.Ban; | ||
1870 | entry.Time = new DateTime(); | ||
1871 | land.LandData.ParcelAccessList.Add(entry); | ||
1872 | return; | ||
1873 | } | ||
1874 | else | ||
1875 | { | ||
1876 | targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ; | ||
1877 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1878 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1879 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned."); | ||
1880 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
1881 | entry.AgentID = targetAvatar.UUID; | ||
1882 | entry.Flags = AccessList.Ban; | ||
1883 | entry.Time = new DateTime(); | ||
1884 | land.LandData.ParcelAccessList.Add(entry); | ||
1885 | return; | ||
1886 | } | ||
1887 | } | ||
1888 | else | ||
1889 | { | ||
1890 | if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize) | ||
1891 | { | ||
1892 | targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ; | ||
1893 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1894 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1895 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned."); | ||
1896 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
1897 | entry.AgentID = targetAvatar.UUID; | ||
1898 | entry.Flags = AccessList.Ban; | ||
1899 | entry.Time = new DateTime(); | ||
1900 | land.LandData.ParcelAccessList.Add(entry); | ||
1901 | return; | ||
1902 | } | ||
1903 | else | ||
1904 | { | ||
1905 | targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ; | ||
1906 | targetAvatar.TeleportWithMomentum(targetVector); | ||
1907 | targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname); | ||
1908 | parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned."); | ||
1909 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
1910 | entry.AgentID = targetAvatar.UUID; | ||
1911 | entry.Flags = AccessList.Ban; | ||
1912 | entry.Time = new DateTime(); | ||
1913 | land.LandData.ParcelAccessList.Add(entry); | ||
1914 | return; | ||
1915 | } | ||
1916 | } | ||
1917 | } | ||
1918 | } | ||
1919 | } | ||
1579 | } | 1920 | } |
1580 | } | 1921 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index d87352f..bd1dd66 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -288,6 +288,34 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
288 | return false; | 288 | return false; |
289 | } | 289 | } |
290 | 290 | ||
291 | public bool HasGroupAccess(UUID avatar) | ||
292 | { | ||
293 | if ((LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup) | ||
294 | { | ||
295 | IGroupsModule groupsModule = | ||
296 | m_scene.RequestModuleInterface<IGroupsModule>(); | ||
297 | |||
298 | List<UUID> agentGroups = new List<UUID>(); | ||
299 | if (groupsModule != null) | ||
300 | { | ||
301 | GroupMembershipData[] GroupMembership = | ||
302 | groupsModule.GetMembershipData(avatar); | ||
303 | |||
304 | if (GroupMembership != null) | ||
305 | { | ||
306 | for (int i = 0; i < GroupMembership.Length; i++) | ||
307 | { | ||
308 | if (LandData.GroupID == GroupMembership[i].GroupID) | ||
309 | { | ||
310 | return true; | ||
311 | } | ||
312 | } | ||
313 | } | ||
314 | } | ||
315 | } | ||
316 | return false; | ||
317 | } | ||
318 | |||
291 | public bool IsBannedFromLand(UUID avatar) | 319 | public bool IsBannedFromLand(UUID avatar) |
292 | { | 320 | { |
293 | if (m_scene.Permissions.IsAdministrator(avatar)) | 321 | if (m_scene.Permissions.IsAdministrator(avatar)) |
@@ -324,10 +352,14 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
324 | //If they are not on the access list and are not the owner | 352 | //If they are not on the access list and are not the owner |
325 | if (!LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar) | 353 | if (!LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar) |
326 | { | 354 | { |
327 | //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel | 355 | if (!HasGroupAccess(avatar)) |
328 | return true; | 356 | { |
357 | //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel | ||
358 | return true; | ||
359 | } | ||
329 | } | 360 | } |
330 | } | 361 | } |
362 | |||
331 | return false; | 363 | return false; |
332 | } | 364 | } |
333 | 365 | ||
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index f5f3839..289741f 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
412 | 412 | ||
413 | public string Name | 413 | public string Name |
414 | { | 414 | { |
415 | get { return "PermissionsModule"; } | 415 | get { return "DefaultPermissionsModule"; } |
416 | } | 416 | } |
417 | 417 | ||
418 | public bool IsSharedModule | 418 | public bool IsSharedModule |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 25d73c2..4611352 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -549,6 +549,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
549 | m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); | 549 | m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised()); |
550 | m_scene.SaveTerrain(); | 550 | m_scene.SaveTerrain(); |
551 | 551 | ||
552 | m_scene.EventManager.TriggerTerrainUpdate(); | ||
553 | |||
552 | // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. | 554 | // Clients who look at the map will never see changes after they looked at the map, so i've commented this out. |
553 | //m_scene.CreateTerrainTexture(true); | 555 | //m_scene.CreateTerrainTexture(true); |
554 | } | 556 | } |