diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
13 files changed, 514 insertions, 192 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index de99b94..f8681e7 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; |
@@ -135,7 +136,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
135 | // If we're an NPC then skip all the item checks and manipulations since we don't have an | 136 | // If we're an NPC then skip all the item checks and manipulations since we don't have an |
136 | // inventory right now. | 137 | // inventory right now. |
137 | if (sp.PresenceType == PresenceType.Npc) | 138 | if (sp.PresenceType == PresenceType.Npc) |
138 | RezSingleAttachmentFromInventoryInternal(sp, UUID.Zero, attach.AssetID, p); | 139 | RezSingleAttachmentFromInventoryInternal(sp, UUID.Zero, attach.AssetID, p, null); |
139 | else | 140 | else |
140 | RezSingleAttachmentFromInventory(sp, attach.ItemID, p); | 141 | RezSingleAttachmentFromInventory(sp, attach.ItemID, p); |
141 | } | 142 | } |
@@ -265,6 +266,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
265 | } | 266 | } |
266 | 267 | ||
267 | public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt) | 268 | public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt) |
269 | { | ||
270 | return RezSingleAttachmentFromInventory(sp, itemID, AttachmentPt, true, null); | ||
271 | } | ||
272 | |||
273 | public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc) | ||
268 | { | 274 | { |
269 | if (!Enabled) | 275 | if (!Enabled) |
270 | return null; | 276 | return null; |
@@ -303,7 +309,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
303 | return null; | 309 | return null; |
304 | } | 310 | } |
305 | 311 | ||
306 | SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(sp, itemID, UUID.Zero, AttachmentPt); | 312 | SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(sp, itemID, UUID.Zero, AttachmentPt, doc); |
307 | 313 | ||
308 | if (att == null) | 314 | if (att == null) |
309 | DetachSingleAttachmentToInv(sp, itemID); | 315 | DetachSingleAttachmentToInv(sp, itemID); |
@@ -542,15 +548,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
542 | 548 | ||
543 | if (!silent) | 549 | if (!silent) |
544 | { | 550 | { |
545 | // Killing it here will cause the client to deselect it | ||
546 | // It then reappears on the avatar, deselected | ||
547 | // through the full update below | ||
548 | // | ||
549 | if (so.IsSelected) | ||
550 | { | ||
551 | m_scene.SendKillObject(so.RootPart.LocalId); | ||
552 | } | ||
553 | |||
554 | so.IsSelected = false; // fudge.... | 551 | so.IsSelected = false; // fudge.... |
555 | so.ScheduleGroupForFullUpdate(); | 552 | so.ScheduleGroupForFullUpdate(); |
556 | } | 553 | } |
@@ -574,11 +571,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
574 | 571 | ||
575 | Vector3 inventoryStoredPosition = new Vector3 | 572 | Vector3 inventoryStoredPosition = new Vector3 |
576 | (((grp.AbsolutePosition.X > (int)Constants.RegionSize) | 573 | (((grp.AbsolutePosition.X > (int)Constants.RegionSize) |
577 | ? Constants.RegionSize - 6 | 574 | ? (float)Constants.RegionSize - 6 |
578 | : grp.AbsolutePosition.X) | 575 | : grp.AbsolutePosition.X) |
579 | , | 576 | , |
580 | (grp.AbsolutePosition.Y > (int)Constants.RegionSize) | 577 | (grp.AbsolutePosition.Y > (int)Constants.RegionSize) |
581 | ? Constants.RegionSize - 6 | 578 | ? (float)Constants.RegionSize - 6 |
582 | : grp.AbsolutePosition.Y, | 579 | : grp.AbsolutePosition.Y, |
583 | grp.AbsolutePosition.Z); | 580 | grp.AbsolutePosition.Z); |
584 | 581 | ||
@@ -696,8 +693,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
696 | } | 693 | } |
697 | } | 694 | } |
698 | 695 | ||
699 | private SceneObjectGroup RezSingleAttachmentFromInventoryInternal( | 696 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( |
700 | IScenePresence sp, UUID itemID, UUID assetID, uint attachmentPt) | 697 | IScenePresence sp, UUID itemID, UUID assetID, uint attachmentPt, XmlDocument doc) |
701 | { | 698 | { |
702 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); | 699 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); |
703 | if (invAccess != null) | 700 | if (invAccess != null) |
@@ -705,7 +702,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
705 | lock (sp.AttachmentsSyncLock) | 702 | lock (sp.AttachmentsSyncLock) |
706 | { | 703 | { |
707 | SceneObjectGroup objatt; | 704 | SceneObjectGroup objatt; |
708 | 705 | ||
709 | if (itemID != UUID.Zero) | 706 | if (itemID != UUID.Zero) |
710 | objatt = invAccess.RezObject(sp.ControllingClient, | 707 | objatt = invAccess.RezObject(sp.ControllingClient, |
711 | itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, | 708 | itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, |
@@ -714,11 +711,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
714 | objatt = invAccess.RezObject(sp.ControllingClient, | 711 | objatt = invAccess.RezObject(sp.ControllingClient, |
715 | null, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, | 712 | null, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, |
716 | false, false, sp.UUID, true); | 713 | false, false, sp.UUID, true); |
717 | 714 | ||
718 | // m_log.DebugFormat( | 715 | // m_log.DebugFormat( |
719 | // "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}", | 716 | // "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}", |
720 | // objatt.Name, remoteClient.Name, AttachmentPt); | 717 | // objatt.Name, remoteClient.Name, AttachmentPt); |
721 | 718 | ||
722 | if (objatt != null) | 719 | if (objatt != null) |
723 | { | 720 | { |
724 | // HasGroupChanged is being set from within RezObject. Ideally it would be set by the caller. | 721 | // HasGroupChanged is being set from within RezObject. Ideally it would be set by the caller. |
@@ -726,7 +723,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
726 | bool tainted = false; | 723 | bool tainted = false; |
727 | if (attachmentPt != 0 && attachmentPt != objatt.AttachmentPoint) | 724 | if (attachmentPt != 0 && attachmentPt != objatt.AttachmentPoint) |
728 | tainted = true; | 725 | tainted = true; |
729 | 726 | ||
730 | // This will throw if the attachment fails | 727 | // This will throw if the attachment fails |
731 | try | 728 | try |
732 | { | 729 | { |
@@ -737,21 +734,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
737 | m_log.ErrorFormat( | 734 | m_log.ErrorFormat( |
738 | "[ATTACHMENTS MODULE]: Failed to attach {0} {1} for {2}, exception {3}{4}", | 735 | "[ATTACHMENTS MODULE]: Failed to attach {0} {1} for {2}, exception {3}{4}", |
739 | objatt.Name, objatt.UUID, sp.Name, e.Message, e.StackTrace); | 736 | objatt.Name, objatt.UUID, sp.Name, e.Message, e.StackTrace); |
740 | 737 | ||
741 | // Make sure the object doesn't stick around and bail | 738 | // Make sure the object doesn't stick around and bail |
742 | sp.RemoveAttachment(objatt); | 739 | sp.RemoveAttachment(objatt); |
743 | m_scene.DeleteSceneObject(objatt, false); | 740 | m_scene.DeleteSceneObject(objatt, false); |
744 | return null; | 741 | return null; |
745 | } | 742 | } |
746 | 743 | ||
747 | if (tainted) | 744 | if (tainted) |
748 | objatt.HasGroupChanged = true; | 745 | objatt.HasGroupChanged = true; |
749 | 746 | ||
750 | // Fire after attach, so we don't get messy perms dialogs | 747 | // Fire after attach, so we don't get messy perms dialogs |
751 | // 4 == AttachedRez | 748 | // 4 == AttachedRez |
752 | objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4); | 749 | objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4); |
753 | objatt.ResumeScripts(); | 750 | objatt.ResumeScripts(); |
754 | 751 | ||
755 | // Do this last so that event listeners have access to all the effects of the attachment | 752 | // Do this last so that event listeners have access to all the effects of the attachment |
756 | m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, sp.UUID); | 753 | m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, sp.UUID); |
757 | 754 | ||
@@ -763,9 +760,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
763 | "[ATTACHMENTS MODULE]: Could not retrieve item {0} for attaching to avatar {1} at point {2}", | 760 | "[ATTACHMENTS MODULE]: Could not retrieve item {0} for attaching to avatar {1} at point {2}", |
764 | itemID, sp.Name, attachmentPt); | 761 | itemID, sp.Name, attachmentPt); |
765 | } | 762 | } |
763 | |||
764 | if (doc != null) | ||
765 | { | ||
766 | objatt.LoadScriptState(doc); | ||
767 | objatt.ResetOwnerChangeFlag(); | ||
768 | } | ||
769 | |||
770 | // Fire after attach, so we don't get messy perms dialogs | ||
771 | // 4 == AttachedRez | ||
772 | objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4); | ||
773 | objatt.ResumeScripts(); | ||
774 | |||
775 | // Do this last so that event listeners have access to all the effects of the attachment | ||
776 | m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, sp.UUID); | ||
766 | } | 777 | } |
767 | } | 778 | } |
768 | 779 | ||
769 | return null; | 780 | return null; |
770 | } | 781 | } |
771 | 782 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 07d1cb3..d866636 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -327,8 +327,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
327 | if (checkonly) | 327 | if (checkonly) |
328 | return false; | 328 | return false; |
329 | 329 | ||
330 | m_log.InfoFormat("[AVFACTORY]: missing baked texture {0}, requesting rebake", face.TextureID); | ||
331 | |||
332 | sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID); | 330 | sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID); |
333 | } | 331 | } |
334 | } | 332 | } |
@@ -350,7 +348,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
350 | { | 348 | { |
351 | if (m_scene.AssetService.Get(textureID.ToString()) == null) | 349 | if (m_scene.AssetService.Get(textureID.ToString()) == null) |
352 | { | 350 | { |
353 | m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}", | 351 | m_log.InfoFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}", |
354 | textureID, idx, sp.Name); | 352 | textureID, idx, sp.Name); |
355 | return false; | 353 | return false; |
356 | } | 354 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 2cd71c4..b16ca53 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: |
@@ -231,8 +245,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
231 | s.ForEachScenePresence( | 245 | s.ForEachScenePresence( |
232 | delegate(ScenePresence presence) | 246 | delegate(ScenePresence presence) |
233 | { | 247 | { |
234 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType)) | 248 | ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); |
235 | receiverIDs.Add(presence.UUID); | 249 | if (Presencecheck != null) |
250 | { | ||
251 | // This will pass all chat from objects. Not | ||
252 | // perfect, but it will do. For now. Better | ||
253 | // than the prior behavior of muting all | ||
254 | // objects on a parcel with access restrictions | ||
255 | if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) | ||
256 | { | ||
257 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix + fromName, c.Type, message, sourceType)) | ||
258 | receiverIDs.Add(presence.UUID); | ||
259 | } | ||
260 | } | ||
261 | |||
236 | } | 262 | } |
237 | ); | 263 | ); |
238 | } | 264 | } |
@@ -276,28 +302,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
276 | } | 302 | } |
277 | 303 | ||
278 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); | 304 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); |
279 | |||
280 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); | 305 | HashSet<UUID> receiverIDs = new HashSet<UUID>(); |
281 | 306 | ||
282 | ((Scene)c.Scene).ForEachRootScenePresence( | 307 | if (c.Scene != null) |
283 | delegate(ScenePresence presence) | 308 | { |
284 | { | 309 | ((Scene)c.Scene).ForEachRootScenePresence |
285 | IClientAPI client = presence.ControllingClient; | 310 | ( |
286 | 311 | delegate(ScenePresence presence) | |
287 | // don't forward SayOwner chat from objects to | 312 | { |
288 | // non-owner agents | 313 | IClientAPI client = presence.ControllingClient; |
289 | if ((c.Type == ChatTypeEnum.Owner) && | 314 | |
290 | (null != c.SenderObject) && | 315 | // don't forward SayOwner chat from objects to |
291 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | 316 | // non-owner agents |
292 | return; | 317 | if ((c.Type == ChatTypeEnum.Owner) && |
293 | 318 | (null != c.SenderObject) && | |
294 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, | 319 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) |
295 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | 320 | return; |
296 | receiverIDs.Add(presence.UUID); | 321 | |
297 | }); | 322 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, |
298 | 323 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | |
299 | (c.Scene as Scene).EventManager.TriggerOnChatToClients( | 324 | receiverIDs.Add(presence.UUID); |
300 | fromID, receiverIDs, c.Message, cType, CenterOfRegion, fromName, sourceType, ChatAudibleLevel.Fully); | 325 | } |
326 | ); | ||
327 | (c.Scene as Scene).EventManager.TriggerOnChatToClients( | ||
328 | fromID, receiverIDs, c.Message, cType, CenterOfRegion, fromName, sourceType, ChatAudibleLevel.Fully); | ||
329 | } | ||
301 | } | 330 | } |
302 | 331 | ||
303 | /// <summary> | 332 | /// <summary> |
@@ -340,5 +369,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
340 | 369 | ||
341 | return true; | 370 | return true; |
342 | } | 371 | } |
372 | |||
373 | Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>(); | ||
374 | public void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target) | ||
375 | { | ||
376 | System.Threading.Timer Timer; | ||
377 | if (flags == 0) | ||
378 | { | ||
379 | FreezeCache.Add(target.ToString()); | ||
380 | System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen); | ||
381 | Timer = new System.Threading.Timer(timeCB, target, 30000, 0); | ||
382 | Timers.Add(target, Timer); | ||
383 | } | ||
384 | else | ||
385 | { | ||
386 | FreezeCache.Remove(target.ToString()); | ||
387 | Timers.TryGetValue(target, out Timer); | ||
388 | Timers.Remove(target); | ||
389 | Timer.Dispose(); | ||
390 | } | ||
391 | } | ||
392 | |||
393 | private void OnEndParcelFrozen(object avatar) | ||
394 | { | ||
395 | UUID target = (UUID)avatar; | ||
396 | FreezeCache.Remove(target.ToString()); | ||
397 | System.Threading.Timer Timer; | ||
398 | Timers.TryGetValue(target, out Timer); | ||
399 | Timers.Remove(target); | ||
400 | Timer.Dispose(); | ||
401 | } | ||
343 | } | 402 | } |
344 | } | 403 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index 3ce446b..00556c4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | |||
@@ -216,4 +216,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
216 | return result; | 216 | return result; |
217 | } | 217 | } |
218 | } | 218 | } |
219 | } \ No newline at end of file | 219 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index c952ebf..a5131ec 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -305,7 +305,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
305 | //m_log.DebugFormat("[XXX]: OnClientLogin!"); | 305 | //m_log.DebugFormat("[XXX]: OnClientLogin!"); |
306 | // Inform the friends that this user is online | 306 | // Inform the friends that this user is online |
307 | StatusChange(agentID, true); | 307 | StatusChange(agentID, true); |
308 | 308 | ||
309 | // Register that we need to send the list of online friends to this user | 309 | // Register that we need to send the list of online friends to this user |
310 | lock (m_NeedsListOfFriends) | 310 | lock (m_NeedsListOfFriends) |
311 | m_NeedsListOfFriends.Add(agentID); | 311 | m_NeedsListOfFriends.Add(agentID); |
@@ -356,10 +356,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
356 | PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); | 356 | PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); |
357 | if (presences != null && presences.Length > 0) | 357 | if (presences != null && presences.Length > 0) |
358 | presence = presences[0]; | 358 | presence = presences[0]; |
359 | im.offline = 0; | 359 | if (presence != null) |
360 | im.offline = 0; | ||
360 | 361 | ||
361 | im.fromAgentID = fromAgentID.Guid; | 362 | im.fromAgentID = fromAgentID.Guid; |
362 | im.fromAgentName = firstname + " " + lastname; | 363 | im.fromAgentName = firstname + " " + lastname; |
364 | im.offline = (byte)((presence == null) ? 1 : 0); | ||
363 | im.imSessionID = im.fromAgentID; | 365 | im.imSessionID = im.fromAgentID; |
364 | im.message = FriendshipMessage(fid); | 366 | im.message = FriendshipMessage(fid); |
365 | 367 | ||
@@ -578,6 +580,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
578 | 580 | ||
579 | StoreFriendships(agentID, friendID); | 581 | StoreFriendships(agentID, friendID); |
580 | 582 | ||
583 | ICallingCardModule ccm = client.Scene.RequestModuleInterface<ICallingCardModule>(); | ||
584 | if (ccm != null) | ||
585 | { | ||
586 | ccm.CreateCallingCard(agentID, friendID, UUID.Zero); | ||
587 | } | ||
588 | |||
581 | // Update the local cache | 589 | // Update the local cache |
582 | RefetchFriends(client); | 590 | RefetchFriends(client); |
583 | 591 | ||
@@ -754,6 +762,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
754 | (byte)OpenMetaverse.InstantMessageDialog.FriendshipAccepted, userID.ToString(), false, Vector3.Zero); | 762 | (byte)OpenMetaverse.InstantMessageDialog.FriendshipAccepted, userID.ToString(), false, Vector3.Zero); |
755 | friendClient.SendInstantMessage(im); | 763 | friendClient.SendInstantMessage(im); |
756 | 764 | ||
765 | ICallingCardModule ccm = friendClient.Scene.RequestModuleInterface<ICallingCardModule>(); | ||
766 | if (ccm != null) | ||
767 | { | ||
768 | ccm.CreateCallingCard(friendID, userID, UUID.Zero); | ||
769 | } | ||
770 | |||
771 | |||
757 | // Update the local cache | 772 | // Update the local cache |
758 | RefetchFriends(friendClient); | 773 | RefetchFriends(friendClient); |
759 | 774 | ||
@@ -776,7 +791,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
776 | // we're done | 791 | // we're done |
777 | return true; | 792 | return true; |
778 | } | 793 | } |
779 | 794 | ||
780 | return false; | 795 | return false; |
781 | } | 796 | } |
782 | 797 | ||
@@ -829,7 +844,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
829 | 844 | ||
830 | public bool LocalStatusNotification(UUID userID, UUID friendID, bool online) | 845 | public bool LocalStatusNotification(UUID userID, UUID friendID, bool online) |
831 | { | 846 | { |
832 | // m_log.DebugFormat("[FRIENDS]: Local Status Notify {0} that user {1} is {2}", friendID, userID, online); | 847 | //m_log.DebugFormat("[FRIENDS]: Local Status Notify {0} that user {1} is {2}", friendID, userID, online); |
833 | IClientAPI friendClient = LocateClientObject(friendID); | 848 | IClientAPI friendClient = LocateClientObject(friendID); |
834 | if (friendClient != null) | 849 | if (friendClient != null) |
835 | { | 850 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 562c3b1..f73f9c1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -31,16 +31,40 @@ using OpenMetaverse; | |||
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Framework.Scenes; | 32 | using OpenSim.Region.Framework.Scenes; |
33 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
34 | using System; | ||
35 | using System.Reflection; | ||
36 | using System.Collections; | ||
37 | using System.Collections.Specialized; | ||
38 | using System.Reflection; | ||
39 | using System.IO; | ||
40 | using System.Web; | ||
41 | using System.Xml; | ||
42 | using log4net; | ||
43 | using Mono.Addins; | ||
44 | using OpenMetaverse.Messages.Linden; | ||
45 | using OpenMetaverse.StructuredData; | ||
46 | using OpenSim.Framework.Capabilities; | ||
47 | using OpenSim.Framework.Servers; | ||
48 | using OpenSim.Framework.Servers.HttpServer; | ||
49 | using Caps = OpenSim.Framework.Capabilities.Caps; | ||
50 | using OSDArray = OpenMetaverse.StructuredData.OSDArray; | ||
51 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | ||
34 | 52 | ||
35 | namespace OpenSim.Region.CoreModules.Avatar.Gods | 53 | namespace OpenSim.Region.CoreModules.Avatar.Gods |
36 | { | 54 | { |
37 | public class GodsModule : IRegionModule, IGodsModule | 55 | public class GodsModule : IRegionModule, IGodsModule |
38 | { | 56 | { |
57 | private static readonly ILog m_log = | ||
58 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
59 | |||
39 | /// <summary>Special UUID for actions that apply to all agents</summary> | 60 | /// <summary>Special UUID for actions that apply to all agents</summary> |
40 | private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb"); | 61 | private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb"); |
41 | 62 | ||
42 | protected Scene m_scene; | 63 | protected Scene m_scene; |
43 | protected IDialogModule m_dialogModule; | 64 | protected IDialogModule m_dialogModule; |
65 | |||
66 | protected Dictionary<UUID, string> m_capsDict = | ||
67 | new Dictionary<UUID, string>(); | ||
44 | 68 | ||
45 | public void Initialise(Scene scene, IConfigSource source) | 69 | public void Initialise(Scene scene, IConfigSource source) |
46 | { | 70 | { |
@@ -48,6 +72,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
48 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); | 72 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); |
49 | m_scene.RegisterModuleInterface<IGodsModule>(this); | 73 | m_scene.RegisterModuleInterface<IGodsModule>(this); |
50 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | 74 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; |
75 | m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; | ||
76 | m_scene.EventManager.OnClientClosed += OnClientClosed; | ||
77 | scene.EventManager.OnIncomingInstantMessage += | ||
78 | OnIncomingInstantMessage; | ||
51 | } | 79 | } |
52 | 80 | ||
53 | public void PostInitialise() {} | 81 | public void PostInitialise() {} |
@@ -67,6 +95,54 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
67 | client.OnRequestGodlikePowers -= RequestGodlikePowers; | 95 | client.OnRequestGodlikePowers -= RequestGodlikePowers; |
68 | } | 96 | } |
69 | 97 | ||
98 | private void OnClientClosed(UUID agentID, Scene scene) | ||
99 | { | ||
100 | m_capsDict.Remove(agentID); | ||
101 | } | ||
102 | |||
103 | private void OnRegisterCaps(UUID agentID, Caps caps) | ||
104 | { | ||
105 | string uri = "/CAPS/" + UUID.Random(); | ||
106 | m_capsDict[agentID] = uri; | ||
107 | |||
108 | caps.RegisterHandler("UntrustedSimulatorMessage", | ||
109 | new RestStreamHandler("POST", uri, | ||
110 | HandleUntrustedSimulatorMessage)); | ||
111 | } | ||
112 | |||
113 | private string HandleUntrustedSimulatorMessage(string request, | ||
114 | string path, string param, OSHttpRequest httpRequest, | ||
115 | OSHttpResponse httpResponse) | ||
116 | { | ||
117 | OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request); | ||
118 | |||
119 | string message = osd["message"].AsString(); | ||
120 | |||
121 | if (message == "GodKickUser") | ||
122 | { | ||
123 | OSDMap body = (OSDMap)osd["body"]; | ||
124 | OSDArray userInfo = (OSDArray)body["UserInfo"]; | ||
125 | OSDMap userData = (OSDMap)userInfo[0]; | ||
126 | |||
127 | UUID agentID = userData["AgentID"].AsUUID(); | ||
128 | UUID godID = userData["GodID"].AsUUID(); | ||
129 | UUID godSessionID = userData["GodSessionID"].AsUUID(); | ||
130 | uint kickFlags = userData["KickFlags"].AsUInteger(); | ||
131 | string reason = userData["Reason"].AsString(); | ||
132 | |||
133 | ScenePresence god = m_scene.GetScenePresence(godID); | ||
134 | if (god == null || god.ControllingClient.SessionId != godSessionID) | ||
135 | return String.Empty; | ||
136 | |||
137 | KickUser(godID, godSessionID, agentID, kickFlags, Util.StringToBytes1024(reason)); | ||
138 | } | ||
139 | else | ||
140 | { | ||
141 | m_log.ErrorFormat("[GOD]: Unhandled UntrustedSimulatorMessage: {0}", message); | ||
142 | } | ||
143 | return String.Empty; | ||
144 | } | ||
145 | |||
70 | public void RequestGodlikePowers( | 146 | public void RequestGodlikePowers( |
71 | UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) | 147 | UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) |
72 | { | 148 | { |
@@ -115,71 +191,85 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
115 | /// <param name="reason">The message to send to the user after it's been turned into a field</param> | 191 | /// <param name="reason">The message to send to the user after it's been turned into a field</param> |
116 | public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) | 192 | public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) |
117 | { | 193 | { |
118 | UUID kickUserID = ALL_AGENTS; | 194 | if (!m_scene.Permissions.IsGod(godID)) |
119 | 195 | return; | |
196 | |||
120 | ScenePresence sp = m_scene.GetScenePresence(agentID); | 197 | ScenePresence sp = m_scene.GetScenePresence(agentID); |
121 | 198 | ||
122 | if (sp != null || agentID == kickUserID) | 199 | if (sp == null && agentID != ALL_AGENTS) |
123 | { | 200 | { |
124 | if (m_scene.Permissions.IsGod(godID)) | 201 | IMessageTransferModule transferModule = |
202 | m_scene.RequestModuleInterface<IMessageTransferModule>(); | ||
203 | if (transferModule != null) | ||
125 | { | 204 | { |
126 | if (kickflags == 0) | 205 | m_log.DebugFormat("[GODS]: Sending nonlocal kill for agent {0}", agentID); |
127 | { | 206 | transferModule.SendInstantMessage(new GridInstantMessage( |
128 | if (agentID == kickUserID) | 207 | m_scene, godID, "God", agentID, (byte)250, false, |
129 | { | 208 | Utils.BytesToString(reason), UUID.Zero, true, |
130 | string reasonStr = Utils.BytesToString(reason); | 209 | new Vector3(), new byte[] {(byte)kickflags}), |
131 | 210 | delegate(bool success) {} ); | |
132 | m_scene.ForEachClient( | 211 | } |
133 | delegate(IClientAPI controller) | 212 | return; |
134 | { | 213 | } |
135 | if (controller.AgentId != godID) | ||
136 | controller.Kick(reasonStr); | ||
137 | } | ||
138 | ); | ||
139 | |||
140 | // This is a bit crude. It seems the client will be null before it actually stops the thread | ||
141 | // The thread will kill itself eventually :/ | ||
142 | // Is there another way to make sure *all* clients get this 'inter region' message? | ||
143 | m_scene.ForEachRootScenePresence( | ||
144 | delegate(ScenePresence p) | ||
145 | { | ||
146 | if (p.UUID != godID) | ||
147 | { | ||
148 | // Possibly this should really be p.Close() though that method doesn't send a close | ||
149 | // to the client | ||
150 | p.ControllingClient.Close(); | ||
151 | } | ||
152 | } | ||
153 | ); | ||
154 | } | ||
155 | else | ||
156 | { | ||
157 | m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent); | ||
158 | 214 | ||
159 | sp.ControllingClient.Kick(Utils.BytesToString(reason)); | 215 | switch (kickflags) |
160 | sp.ControllingClient.Close(); | 216 | { |
161 | } | 217 | case 0: |
162 | } | 218 | if (sp != null) |
163 | 219 | { | |
164 | if (kickflags == 1) | 220 | KickPresence(sp, Utils.BytesToString(reason)); |
165 | { | ||
166 | sp.AllowMovement = false; | ||
167 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | ||
168 | m_dialogModule.SendAlertToUser(godID, "User Frozen"); | ||
169 | } | ||
170 | |||
171 | if (kickflags == 2) | ||
172 | { | ||
173 | sp.AllowMovement = true; | ||
174 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | ||
175 | m_dialogModule.SendAlertToUser(godID, "User Unfrozen"); | ||
176 | } | ||
177 | } | 221 | } |
178 | else | 222 | else if (agentID == ALL_AGENTS) |
179 | { | 223 | { |
180 | m_dialogModule.SendAlertToUser(godID, "Kick request denied"); | 224 | m_scene.ForEachRootScenePresence( |
225 | delegate(ScenePresence p) | ||
226 | { | ||
227 | if (p.UUID != godID && (!m_scene.Permissions.IsGod(p.UUID))) | ||
228 | KickPresence(p, Utils.BytesToString(reason)); | ||
229 | } | ||
230 | ); | ||
181 | } | 231 | } |
232 | break; | ||
233 | case 1: | ||
234 | if (sp != null) | ||
235 | { | ||
236 | sp.AllowMovement = false; | ||
237 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | ||
238 | m_dialogModule.SendAlertToUser(godID, "User Frozen"); | ||
239 | } | ||
240 | break; | ||
241 | case 2: | ||
242 | if (sp != null) | ||
243 | { | ||
244 | sp.AllowMovement = true; | ||
245 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | ||
246 | m_dialogModule.SendAlertToUser(godID, "User Unfrozen"); | ||
247 | } | ||
248 | break; | ||
249 | default: | ||
250 | break; | ||
251 | } | ||
252 | } | ||
253 | |||
254 | private void KickPresence(ScenePresence sp, string reason) | ||
255 | { | ||
256 | if (sp.IsChildAgent) | ||
257 | return; | ||
258 | sp.ControllingClient.Kick(reason); | ||
259 | sp.Scene.IncomingCloseAgent(sp.UUID); | ||
260 | } | ||
261 | |||
262 | private void OnIncomingInstantMessage(GridInstantMessage msg) | ||
263 | { | ||
264 | if (msg.dialog == (uint)250) // Nonlocal kick | ||
265 | { | ||
266 | UUID agentID = new UUID(msg.toAgentID); | ||
267 | string reason = msg.message; | ||
268 | UUID godID = new UUID(msg.fromAgentID); | ||
269 | uint kickMode = (uint)msg.binaryBucket[0]; | ||
270 | |||
271 | KickUser(godID, UUID.Zero, agentID, kickMode, Util.StringToBytes1024(reason)); | ||
182 | } | 272 | } |
183 | } | 273 | } |
184 | } | 274 | } |
185 | } \ No newline at end of file | 275 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index ca5d485..1af4d68 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |||
@@ -157,6 +157,32 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
157 | return; | 157 | return; |
158 | } | 158 | } |
159 | 159 | ||
160 | //DateTime dt = DateTime.UtcNow; | ||
161 | |||
162 | // Ticks from UtcNow, but make it look like local. Evil, huh? | ||
163 | //dt = DateTime.SpecifyKind(dt, DateTimeKind.Local); | ||
164 | |||
165 | //try | ||
166 | //{ | ||
167 | // // Convert that to the PST timezone | ||
168 | // TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles"); | ||
169 | // dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo); | ||
170 | //} | ||
171 | //catch | ||
172 | //{ | ||
173 | // //m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp."); | ||
174 | //} | ||
175 | |||
176 | //// And make it look local again to fool the unix time util | ||
177 | //dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc); | ||
178 | |||
179 | // If client is null, this message comes from storage and IS offline | ||
180 | if (client != null) | ||
181 | im.offline = 0; | ||
182 | |||
183 | if (im.offline == 0) | ||
184 | im.timestamp = (uint)Util.UnixTimeSinceEpoch(); | ||
185 | |||
160 | if (m_TransferModule != null) | 186 | if (m_TransferModule != null) |
161 | { | 187 | { |
162 | if (client != null) | 188 | if (client != null) |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 0dad3c4..712632b 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -48,6 +48,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | private bool m_Enabled = false; | 50 | private bool m_Enabled = false; |
51 | protected string m_MessageKey = String.Empty; | ||
51 | protected List<Scene> m_Scenes = new List<Scene>(); | 52 | protected List<Scene> m_Scenes = new List<Scene>(); |
52 | protected Dictionary<UUID, UUID> m_UserRegionMap = new Dictionary<UUID, UUID>(); | 53 | protected Dictionary<UUID, UUID> m_UserRegionMap = new Dictionary<UUID, UUID>(); |
53 | 54 | ||
@@ -67,14 +68,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
67 | public virtual void Initialise(IConfigSource config) | 68 | public virtual void Initialise(IConfigSource config) |
68 | { | 69 | { |
69 | IConfig cnf = config.Configs["Messaging"]; | 70 | IConfig cnf = config.Configs["Messaging"]; |
70 | if (cnf != null && cnf.GetString( | 71 | if (cnf != null) |
71 | "MessageTransferModule", "MessageTransferModule") != | ||
72 | "MessageTransferModule") | ||
73 | { | 72 | { |
74 | m_log.Debug("[MESSAGE TRANSFER]: Disabled by configuration"); | 73 | if (cnf.GetString("MessageTransferModule", |
75 | return; | 74 | "MessageTransferModule") != "MessageTransferModule") |
76 | } | 75 | { |
76 | return; | ||
77 | } | ||
77 | 78 | ||
79 | m_MessageKey = cnf.GetString("MessageKey", String.Empty); | ||
80 | } | ||
81 | m_log.Debug("[MESSAGE TRANSFER]: Module enabled"); | ||
78 | m_Enabled = true; | 82 | m_Enabled = true; |
79 | } | 83 | } |
80 | 84 | ||
@@ -142,13 +146,20 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
142 | ScenePresence sp = scene.GetScenePresence(toAgentID); | 146 | ScenePresence sp = scene.GetScenePresence(toAgentID); |
143 | if (sp != null && !sp.IsChildAgent) | 147 | if (sp != null && !sp.IsChildAgent) |
144 | { | 148 | { |
145 | // Local message | 149 | // m_log.DebugFormat( |
146 | // m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); | 150 | // "[INSTANT MESSAGE]: Looking for root agent {0} in {1}", |
147 | sp.ControllingClient.SendInstantMessage(im); | 151 | // toAgentID.ToString(), scene.RegionInfo.RegionName); |
152 | |||
153 | ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; | ||
154 | if (!user.IsChildAgent) | ||
155 | { | ||
156 | // m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); | ||
157 | user.ControllingClient.SendInstantMessage(im); | ||
148 | 158 | ||
149 | // Message sent | 159 | // Message sent |
150 | result(true); | 160 | result(true); |
151 | return; | 161 | return; |
162 | } | ||
152 | } | 163 | } |
153 | } | 164 | } |
154 | 165 | ||
@@ -161,8 +172,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
161 | if (sp != null) | 172 | if (sp != null) |
162 | { | 173 | { |
163 | // Local message | 174 | // Local message |
164 | // m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); | 175 | ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; |
165 | sp.ControllingClient.SendInstantMessage(im); | 176 | |
177 | // m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); | ||
178 | user.ControllingClient.SendInstantMessage(im); | ||
166 | 179 | ||
167 | // Message sent | 180 | // Message sent |
168 | result(true); | 181 | result(true); |
@@ -244,6 +257,19 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
244 | && requestData.ContainsKey("position_z") && requestData.ContainsKey("region_id") | 257 | && requestData.ContainsKey("position_z") && requestData.ContainsKey("region_id") |
245 | && requestData.ContainsKey("binary_bucket")) | 258 | && requestData.ContainsKey("binary_bucket")) |
246 | { | 259 | { |
260 | if (m_MessageKey != String.Empty) | ||
261 | { | ||
262 | XmlRpcResponse error_resp = new XmlRpcResponse(); | ||
263 | Hashtable error_respdata = new Hashtable(); | ||
264 | error_respdata["success"] = "FALSE"; | ||
265 | error_resp.Value = error_respdata; | ||
266 | |||
267 | if (!requestData.Contains("message_key")) | ||
268 | return error_resp; | ||
269 | if (m_MessageKey != (string)requestData["message_key"]) | ||
270 | return error_resp; | ||
271 | } | ||
272 | |||
247 | // Do the easy way of validating the UUIDs | 273 | // Do the easy way of validating the UUIDs |
248 | UUID.TryParse((string)requestData["from_agent_id"], out fromAgentID); | 274 | UUID.TryParse((string)requestData["from_agent_id"], out fromAgentID); |
249 | UUID.TryParse((string)requestData["to_agent_id"], out toAgentID); | 275 | UUID.TryParse((string)requestData["to_agent_id"], out toAgentID); |
@@ -420,24 +446,37 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
420 | return resp; | 446 | return resp; |
421 | } | 447 | } |
422 | 448 | ||
423 | /// <summary> | 449 | private delegate void GridInstantMessageDelegate(GridInstantMessage im, MessageResultNotification result); |
424 | /// delegate for sending a grid instant message asynchronously | ||
425 | /// </summary> | ||
426 | public delegate void GridInstantMessageDelegate(GridInstantMessage im, MessageResultNotification result, UUID prevRegionID); | ||
427 | 450 | ||
428 | protected virtual void GridInstantMessageCompleted(IAsyncResult iar) | 451 | private class GIM { |
429 | { | 452 | public GridInstantMessage im; |
430 | GridInstantMessageDelegate icon = | 453 | public MessageResultNotification result; |
431 | (GridInstantMessageDelegate)iar.AsyncState; | 454 | }; |
432 | icon.EndInvoke(iar); | ||
433 | } | ||
434 | 455 | ||
456 | private Queue<GIM> pendingInstantMessages = new Queue<GIM>(); | ||
457 | private int numInstantMessageThreads = 0; | ||
435 | 458 | ||
436 | protected virtual void SendGridInstantMessageViaXMLRPC(GridInstantMessage im, MessageResultNotification result) | 459 | private void SendGridInstantMessageViaXMLRPC(GridInstantMessage im, MessageResultNotification result) |
437 | { | 460 | { |
438 | GridInstantMessageDelegate d = SendGridInstantMessageViaXMLRPCAsync; | 461 | lock (pendingInstantMessages) { |
462 | if (numInstantMessageThreads >= 4) { | ||
463 | GIM gim = new GIM(); | ||
464 | gim.im = im; | ||
465 | gim.result = result; | ||
466 | pendingInstantMessages.Enqueue(gim); | ||
467 | } else { | ||
468 | ++ numInstantMessageThreads; | ||
469 | //m_log.DebugFormat("[SendGridInstantMessageViaXMLRPC]: ++numInstantMessageThreads={0}", numInstantMessageThreads); | ||
470 | GridInstantMessageDelegate d = SendGridInstantMessageViaXMLRPCAsyncMain; | ||
471 | d.BeginInvoke(im, result, GridInstantMessageCompleted, d); | ||
472 | } | ||
473 | } | ||
474 | } | ||
439 | 475 | ||
440 | d.BeginInvoke(im, result, UUID.Zero, GridInstantMessageCompleted, d); | 476 | private void GridInstantMessageCompleted(IAsyncResult iar) |
477 | { | ||
478 | GridInstantMessageDelegate d = (GridInstantMessageDelegate)iar.AsyncState; | ||
479 | d.EndInvoke(iar); | ||
441 | } | 480 | } |
442 | 481 | ||
443 | /// <summary> | 482 | /// <summary> |
@@ -452,8 +491,31 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
452 | /// Pass in 0 the first time this method is called. It will be called recursively with the last | 491 | /// Pass in 0 the first time this method is called. It will be called recursively with the last |
453 | /// regionhandle tried | 492 | /// regionhandle tried |
454 | /// </param> | 493 | /// </param> |
455 | protected virtual void SendGridInstantMessageViaXMLRPCAsync(GridInstantMessage im, MessageResultNotification result, UUID prevRegionID) | 494 | private void SendGridInstantMessageViaXMLRPCAsyncMain(GridInstantMessage im, MessageResultNotification result) |
495 | { | ||
496 | GIM gim; | ||
497 | do { | ||
498 | try { | ||
499 | SendGridInstantMessageViaXMLRPCAsync(im, result, UUID.Zero); | ||
500 | } catch (Exception e) { | ||
501 | m_log.Error("[SendGridInstantMessageViaXMLRPC]: exception " + e.Message); | ||
502 | } | ||
503 | lock (pendingInstantMessages) { | ||
504 | if (pendingInstantMessages.Count > 0) { | ||
505 | gim = pendingInstantMessages.Dequeue(); | ||
506 | im = gim.im; | ||
507 | result = gim.result; | ||
508 | } else { | ||
509 | gim = null; | ||
510 | -- numInstantMessageThreads; | ||
511 | //m_log.DebugFormat("[SendGridInstantMessageViaXMLRPC]: --numInstantMessageThreads={0}", numInstantMessageThreads); | ||
512 | } | ||
513 | } | ||
514 | } while (gim != null); | ||
515 | } | ||
516 | private void SendGridInstantMessageViaXMLRPCAsync(GridInstantMessage im, MessageResultNotification result, UUID prevRegionID) | ||
456 | { | 517 | { |
518 | |||
457 | UUID toAgentID = new UUID(im.toAgentID); | 519 | UUID toAgentID = new UUID(im.toAgentID); |
458 | 520 | ||
459 | PresenceInfo upd = null; | 521 | PresenceInfo upd = null; |
@@ -520,7 +582,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
520 | 582 | ||
521 | if (upd != null) | 583 | if (upd != null) |
522 | { | 584 | { |
523 | GridRegion reginfo = m_Scenes[0].GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, | 585 | GridRegion reginfo = m_Scenes[0].GridService.GetRegionByUUID(UUID.Zero, |
524 | upd.RegionID); | 586 | upd.RegionID); |
525 | if (reginfo != null) | 587 | if (reginfo != null) |
526 | { | 588 | { |
@@ -669,6 +731,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
669 | gim["position_z"] = msg.Position.Z.ToString(); | 731 | gim["position_z"] = msg.Position.Z.ToString(); |
670 | gim["region_id"] = msg.RegionID.ToString(); | 732 | gim["region_id"] = msg.RegionID.ToString(); |
671 | gim["binary_bucket"] = Convert.ToBase64String(msg.binaryBucket,Base64FormattingOptions.None); | 733 | gim["binary_bucket"] = Convert.ToBase64String(msg.binaryBucket,Base64FormattingOptions.None); |
734 | if (m_MessageKey != String.Empty) | ||
735 | gim["message_key"] = m_MessageKey; | ||
672 | return gim; | 736 | return gim; |
673 | } | 737 | } |
674 | 738 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index de25048..5ab604f 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | |||
@@ -171,7 +171,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
171 | 171 | ||
172 | private void RetrieveInstantMessages(IClientAPI client) | 172 | private void RetrieveInstantMessages(IClientAPI client) |
173 | { | 173 | { |
174 | if (m_RestURL != "") | 174 | if (m_RestURL == String.Empty) |
175 | { | ||
176 | return; | ||
177 | } | ||
178 | else | ||
175 | { | 179 | { |
176 | m_log.DebugFormat("[OFFLINE MESSAGING]: Retrieving stored messages for {0}", client.AgentId); | 180 | m_log.DebugFormat("[OFFLINE MESSAGING]: Retrieving stored messages for {0}", client.AgentId); |
177 | 181 | ||
@@ -179,22 +183,25 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
179 | = SynchronousRestObjectRequester.MakeRequest<UUID, List<GridInstantMessage>>( | 183 | = SynchronousRestObjectRequester.MakeRequest<UUID, List<GridInstantMessage>>( |
180 | "POST", m_RestURL + "/RetrieveMessages/", client.AgentId); | 184 | "POST", m_RestURL + "/RetrieveMessages/", client.AgentId); |
181 | 185 | ||
182 | if (msglist == null) | 186 | if (msglist != null) |
183 | m_log.WarnFormat("[OFFLINE MESSAGING]: WARNING null message list."); | ||
184 | |||
185 | foreach (GridInstantMessage im in msglist) | ||
186 | { | 187 | { |
187 | // client.SendInstantMessage(im); | 188 | foreach (GridInstantMessage im in msglist) |
188 | 189 | { | |
189 | // Send through scene event manager so all modules get a chance | 190 | // client.SendInstantMessage(im); |
190 | // to look at this message before it gets delivered. | 191 | |
191 | // | 192 | // Send through scene event manager so all modules get a chance |
192 | // Needed for proper state management for stored group | 193 | // to look at this message before it gets delivered. |
193 | // invitations | 194 | // |
194 | // | 195 | // Needed for proper state management for stored group |
195 | Scene s = FindScene(client.AgentId); | 196 | // invitations |
196 | if (s != null) | 197 | // |
197 | s.EventManager.TriggerIncomingInstantMessage(im); | 198 | |
199 | im.offline = 1; | ||
200 | |||
201 | Scene s = FindScene(client.AgentId); | ||
202 | if (s != null) | ||
203 | s.EventManager.TriggerIncomingInstantMessage(im); | ||
204 | } | ||
198 | } | 205 | } |
199 | } | 206 | } |
200 | } | 207 | } |
@@ -210,19 +217,13 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
210 | return; | 217 | return; |
211 | } | 218 | } |
212 | 219 | ||
213 | if (!m_ForwardOfflineGroupMessages) | ||
214 | { | ||
215 | if (im.dialog == (byte)InstantMessageDialog.GroupNotice || | ||
216 | im.dialog != (byte)InstantMessageDialog.GroupInvitation) | ||
217 | return; | ||
218 | } | ||
219 | |||
220 | Scene scene = FindScene(new UUID(im.fromAgentID)); | 220 | Scene scene = FindScene(new UUID(im.fromAgentID)); |
221 | if (scene == null) | 221 | if (scene == null) |
222 | scene = m_SceneList[0]; | 222 | scene = m_SceneList[0]; |
223 | 223 | ||
224 | bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>( | 224 | bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>( |
225 | "POST", m_RestURL+"/SaveMessage/", im); | 225 | "POST", m_RestURL+"/SaveMessage/?scope=" + |
226 | scene.RegionInfo.ScopeID.ToString(), im); | ||
226 | 227 | ||
227 | if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) | 228 | if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) |
228 | { | 229 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 6b24718..a19bbfd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -632,4 +632,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
632 | m_assetsLoaded = true; | 632 | m_assetsLoaded = true; |
633 | } | 633 | } |
634 | } | 634 | } |
635 | } \ No newline at end of file | 635 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 36ecb3b..63fde07 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -178,9 +178,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
178 | InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, | 178 | InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, |
179 | Dictionary<string, object> options, IUserAccountService userAccountService) | 179 | Dictionary<string, object> options, IUserAccountService userAccountService) |
180 | { | 180 | { |
181 | if (options.ContainsKey("verbose")) | ||
182 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Saving folder {0}", inventoryFolder.Name); | ||
183 | |||
184 | if (saveThisFolderItself) | 181 | if (saveThisFolderItself) |
185 | { | 182 | { |
186 | path += CreateArchiveFolderName(inventoryFolder); | 183 | path += CreateArchiveFolderName(inventoryFolder); |
@@ -449,4 +446,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
449 | return s; | 446 | return s; |
450 | } | 447 | } |
451 | } | 448 | } |
452 | } \ No newline at end of file | 449 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 19c774f..b33342f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -175,8 +175,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
175 | if (im.binaryBucket.Length < 17) // Invalid | 175 | if (im.binaryBucket.Length < 17) // Invalid |
176 | return; | 176 | return; |
177 | 177 | ||
178 | UUID receipientID = new UUID(im.toAgentID); | 178 | UUID recipientID = new UUID(im.toAgentID); |
179 | ScenePresence user = scene.GetScenePresence(receipientID); | 179 | ScenePresence user = scene.GetScenePresence(recipientID); |
180 | UUID copyID; | 180 | UUID copyID; |
181 | 181 | ||
182 | // First byte is the asset type | 182 | // First byte is the asset type |
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
191 | folderID, new UUID(im.toAgentID)); | 191 | folderID, new UUID(im.toAgentID)); |
192 | 192 | ||
193 | InventoryFolderBase folderCopy | 193 | InventoryFolderBase folderCopy |
194 | = scene.GiveInventoryFolder(receipientID, client.AgentId, folderID, UUID.Zero); | 194 | = scene.GiveInventoryFolder(recipientID, client.AgentId, folderID, UUID.Zero); |
195 | 195 | ||
196 | if (folderCopy == null) | 196 | if (folderCopy == null) |
197 | { | 197 | { |
@@ -244,6 +244,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
244 | im.imSessionID = itemID.Guid; | 244 | im.imSessionID = itemID.Guid; |
245 | } | 245 | } |
246 | 246 | ||
247 | im.offline = 1; // Remember these | ||
248 | |||
247 | // Send the IM to the recipient. The item is already | 249 | // Send the IM to the recipient. The item is already |
248 | // in their inventory, so it will not be lost if | 250 | // in their inventory, so it will not be lost if |
249 | // they are offline. | 251 | // they are offline. |
@@ -433,22 +435,67 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
433 | /// | 435 | /// |
434 | /// </summary> | 436 | /// </summary> |
435 | /// <param name="msg"></param> | 437 | /// <param name="msg"></param> |
436 | private void OnGridInstantMessage(GridInstantMessage msg) | 438 | private void OnGridInstantMessage(GridInstantMessage im) |
437 | { | 439 | { |
438 | // Check if this is ours to handle | 440 | // Check if this is ours to handle |
439 | // | 441 | // |
440 | Scene scene = FindClientScene(new UUID(msg.toAgentID)); | 442 | Scene scene = FindClientScene(new UUID(im.toAgentID)); |
441 | 443 | ||
442 | if (scene == null) | 444 | if (scene == null) |
443 | return; | 445 | return; |
444 | 446 | ||
445 | // Find agent to deliver to | 447 | // Find agent to deliver to |
446 | // | 448 | // |
447 | ScenePresence user = scene.GetScenePresence(new UUID(msg.toAgentID)); | 449 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
450 | if (user == null) | ||
451 | return; | ||
452 | |||
453 | // This requires a little bit of processing because we have to make the | ||
454 | // new item visible in the recipient's inventory here | ||
455 | // | ||
456 | if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) | ||
457 | { | ||
458 | if (im.binaryBucket.Length < 17) // Invalid | ||
459 | return; | ||
460 | |||
461 | UUID recipientID = new UUID(im.toAgentID); | ||
462 | |||
463 | // First byte is the asset type | ||
464 | AssetType assetType = (AssetType)im.binaryBucket[0]; | ||
465 | |||
466 | if (AssetType.Folder == assetType) | ||
467 | { | ||
468 | UUID folderID = new UUID(im.binaryBucket, 1); | ||
469 | |||
470 | InventoryFolderBase given = | ||
471 | new InventoryFolderBase(folderID, recipientID); | ||
472 | InventoryFolderBase folder = | ||
473 | scene.InventoryService.GetFolder(given); | ||
474 | |||
475 | if (folder != null) | ||
476 | user.ControllingClient.SendBulkUpdateInventory(folder); | ||
477 | } | ||
478 | else | ||
479 | { | ||
480 | UUID itemID = new UUID(im.binaryBucket, 1); | ||
448 | 481 | ||
449 | // Just forward to local handling | 482 | InventoryItemBase given = |
450 | OnInstantMessage(user.ControllingClient, msg); | 483 | new InventoryItemBase(itemID, recipientID); |
484 | InventoryItemBase item = | ||
485 | scene.InventoryService.GetItem(given); | ||
451 | 486 | ||
487 | if (item != null) | ||
488 | { | ||
489 | user.ControllingClient.SendBulkUpdateInventory(item); | ||
490 | } | ||
491 | } | ||
492 | user.ControllingClient.SendInstantMessage(im); | ||
493 | } | ||
494 | else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted || | ||
495 | im.dialog == (byte) InstantMessageDialog.InventoryDeclined) | ||
496 | { | ||
497 | user.ControllingClient.SendInstantMessage(im); | ||
498 | } | ||
452 | } | 499 | } |
453 | } | 500 | } |
454 | } | 501 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index d295384..dcfdf8f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs | |||
@@ -155,16 +155,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure | |||
155 | scene.RegionInfo.RegionHandle, | 155 | scene.RegionInfo.RegionHandle, |
156 | (uint)presence.AbsolutePosition.X, | 156 | (uint)presence.AbsolutePosition.X, |
157 | (uint)presence.AbsolutePosition.Y, | 157 | (uint)presence.AbsolutePosition.Y, |
158 | (uint)presence.AbsolutePosition.Z); | 158 | (uint)presence.AbsolutePosition.Z + 2); |
159 | 159 | ||
160 | m_log.DebugFormat("TP invite with message {0}", message); | 160 | m_log.DebugFormat("[LURE]: TP invite with message {0}", message); |
161 | |||
162 | GridInstantMessage m; | ||
163 | |||
164 | if (scene.Permissions.IsAdministrator(client.AgentId) && presence.GodLevel >= 200 && (!scene.Permissions.IsAdministrator(targetid))) | ||
165 | { | ||
166 | m = new GridInstantMessage(scene, client.AgentId, | ||
167 | client.FirstName+" "+client.LastName, targetid, | ||
168 | (byte)InstantMessageDialog.GodLikeRequestTeleport, false, | ||
169 | message, dest, false, presence.AbsolutePosition, | ||
170 | new Byte[0]); | ||
171 | } | ||
172 | else | ||
173 | { | ||
174 | m = new GridInstantMessage(scene, client.AgentId, | ||
175 | client.FirstName+" "+client.LastName, targetid, | ||
176 | (byte)InstantMessageDialog.RequestTeleport, false, | ||
177 | message, dest, false, presence.AbsolutePosition, | ||
178 | new Byte[0]); | ||
179 | } | ||
161 | 180 | ||
162 | GridInstantMessage m = new GridInstantMessage(scene, client.AgentId, | ||
163 | client.FirstName+" "+client.LastName, targetid, | ||
164 | (byte)InstantMessageDialog.RequestTeleport, false, | ||
165 | message, dest, false, presence.AbsolutePosition, | ||
166 | new Byte[0]); | ||
167 | |||
168 | if (m_TransferModule != null) | 181 | if (m_TransferModule != null) |
169 | { | 182 | { |
170 | m_TransferModule.SendInstantMessage(m, | 183 | m_TransferModule.SendInstantMessage(m, |
@@ -199,7 +212,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure | |||
199 | { | 212 | { |
200 | // Forward remote teleport requests | 213 | // Forward remote teleport requests |
201 | // | 214 | // |
202 | if (msg.dialog != 22) | 215 | if (msg.dialog != (byte)InstantMessageDialog.RequestTeleport && |
216 | msg.dialog != (byte)InstantMessageDialog.GodLikeRequestTeleport) | ||
203 | return; | 217 | return; |
204 | 218 | ||
205 | if (m_TransferModule != null) | 219 | if (m_TransferModule != null) |