diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
3 files changed, 109 insertions, 85 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index dbbb0ae..4407e40 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -197,6 +197,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
197 | string fromName = c.From; | 197 | string fromName = c.From; |
198 | string fromNamePrefix = ""; | 198 | string fromNamePrefix = ""; |
199 | UUID fromID = UUID.Zero; | 199 | UUID fromID = UUID.Zero; |
200 | UUID ownerID = UUID.Zero; | ||
200 | string message = c.Message; | 201 | string message = c.Message; |
201 | IScene scene = c.Scene; | 202 | IScene scene = c.Scene; |
202 | UUID destination = c.Destination; | 203 | UUID destination = c.Destination; |
@@ -224,11 +225,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
224 | fromNamePrefix = m_adminPrefix; | 225 | fromNamePrefix = m_adminPrefix; |
225 | } | 226 | } |
226 | destination = UUID.Zero; // Avatars cant "SayTo" | 227 | destination = UUID.Zero; // Avatars cant "SayTo" |
228 | ownerID = c.Sender.AgentId; | ||
229 | |||
227 | break; | 230 | break; |
228 | 231 | ||
229 | case ChatSourceType.Object: | 232 | case ChatSourceType.Object: |
230 | fromID = c.SenderUUID; | 233 | fromID = c.SenderUUID; |
231 | 234 | ||
235 | if (c.SenderObject != null && c.SenderObject is SceneObjectPart) | ||
236 | ownerID = ((SceneObjectPart)c.SenderObject).OwnerID; | ||
237 | |||
232 | break; | 238 | break; |
233 | } | 239 | } |
234 | 240 | ||
@@ -262,8 +268,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
262 | // objects on a parcel with access restrictions | 268 | // objects on a parcel with access restrictions |
263 | if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) | 269 | if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) |
264 | { | 270 | { |
265 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix + fromName, c.Type, message, sourceType)) | 271 | if (destination != UUID.Zero) |
266 | receiverIDs.Add(presence.UUID); | 272 | { |
273 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, ownerID, fromNamePrefix + fromName, c.Type, message, sourceType, true)) | ||
274 | receiverIDs.Add(presence.UUID); | ||
275 | } | ||
276 | else | ||
277 | { | ||
278 | if (TrySendChatMessage(presence, fromPos, regionPos, fromID, ownerID, fromNamePrefix + fromName, c.Type, message, sourceType, false)) | ||
279 | receiverIDs.Add(presence.UUID); | ||
280 | } | ||
267 | } | 281 | } |
268 | } | 282 | } |
269 | } | 283 | } |
@@ -324,7 +338,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
324 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) | 338 | (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) |
325 | return; | 339 | return; |
326 | 340 | ||
327 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, | 341 | client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID, |
328 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); | 342 | (byte)sourceType, (byte)ChatAudibleLevel.Fully); |
329 | receiverIDs.Add(client.AgentId); | 343 | receiverIDs.Add(client.AgentId); |
330 | } | 344 | } |
@@ -341,15 +355,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
341 | /// <param name="fromPos"></param> | 355 | /// <param name="fromPos"></param> |
342 | /// <param name="regionPos">/param> | 356 | /// <param name="regionPos">/param> |
343 | /// <param name="fromAgentID"></param> | 357 | /// <param name="fromAgentID"></param> |
358 | /// <param name='ownerID'> | ||
359 | /// Owner of the message. For at least some messages from objects, this has to be correctly filled with the owner's UUID. | ||
360 | /// This is the case for script error messages in viewer 3 since LLViewer change EXT-7762 | ||
361 | /// </param> | ||
344 | /// <param name="fromName"></param> | 362 | /// <param name="fromName"></param> |
345 | /// <param name="type"></param> | 363 | /// <param name="type"></param> |
346 | /// <param name="message"></param> | 364 | /// <param name="message"></param> |
347 | /// <param name="src"></param> | 365 | /// <param name="src"></param> |
348 | /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a | 366 | /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a |
349 | /// precondition</returns> | 367 | /// precondition</returns> |
350 | protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos, | 368 | protected virtual bool TrySendChatMessage( |
351 | UUID fromAgentID, string fromName, ChatTypeEnum type, | 369 | ScenePresence presence, Vector3 fromPos, Vector3 regionPos, |
352 | string message, ChatSourceType src) | 370 | UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type, |
371 | string message, ChatSourceType src, bool ignoreDistance) | ||
353 | { | 372 | { |
354 | // don't send chat to child agents | 373 | // don't send chat to child agents |
355 | if (presence.IsChildAgent) return false; | 374 | if (presence.IsChildAgent) return false; |
@@ -369,8 +388,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
369 | } | 388 | } |
370 | 389 | ||
371 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView | 390 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView |
372 | presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, | 391 | presence.ControllingClient.SendChatMessage( |
373 | fromAgentID, (byte)src, (byte)ChatAudibleLevel.Fully); | 392 | message, (byte) type, fromPos, fromName, |
393 | fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully); | ||
374 | 394 | ||
375 | return true; | 395 | return true; |
376 | } | 396 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 7d1fe68..a32afd5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -35,6 +35,7 @@ using Nini.Config; | |||
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Communications; | 37 | using OpenSim.Framework.Communications; |
38 | using OpenSim.Framework.Console; | ||
38 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
39 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
40 | using OpenSim.Services.Interfaces; | 41 | using OpenSim.Services.Interfaces; |
@@ -209,6 +210,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
209 | Guid id, string firstName, string lastName, string invPath, string pass, string savePath, | 210 | Guid id, string firstName, string lastName, string invPath, string pass, string savePath, |
210 | Dictionary<string, object> options) | 211 | Dictionary<string, object> options) |
211 | { | 212 | { |
213 | if (!ConsoleUtil.CheckFileDoesNotExist(MainConsole.Instance, savePath)) | ||
214 | return false; | ||
215 | |||
212 | if (m_scenes.Count > 0) | 216 | if (m_scenes.Count > 0) |
213 | { | 217 | { |
214 | UserAccount userInfo = GetUserInfo(firstName, lastName, pass); | 218 | UserAccount userInfo = GetUserInfo(firstName, lastName, pass); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 21dff4b..ecaab44 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -38,15 +38,15 @@ using OpenSim.Services.Interfaces; | |||
38 | 38 | ||
39 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | 39 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer |
40 | { | 40 | { |
41 | public class InventoryTransferModule : IInventoryTransferModule, ISharedRegionModule | 41 | public class InventoryTransferModule : ISharedRegionModule |
42 | { | 42 | { |
43 | private static readonly ILog m_log | 43 | private static readonly ILog m_log |
44 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | private List<Scene> m_Scenelist = new List<Scene>(); | 47 | private List<Scene> m_Scenelist = new List<Scene>(); |
48 | private Dictionary<UUID, Scene> m_AgentRegions = | 48 | // private Dictionary<UUID, Scene> m_AgentRegions = |
49 | new Dictionary<UUID, Scene>(); | 49 | // new Dictionary<UUID, Scene>(); |
50 | 50 | ||
51 | private IMessageTransferModule m_TransferModule = null; | 51 | private IMessageTransferModule m_TransferModule = null; |
52 | private bool m_Enabled = true; | 52 | private bool m_Enabled = true; |
@@ -76,12 +76,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
76 | 76 | ||
77 | m_Scenelist.Add(scene); | 77 | m_Scenelist.Add(scene); |
78 | 78 | ||
79 | scene.RegisterModuleInterface<IInventoryTransferModule>(this); | 79 | // scene.RegisterModuleInterface<IInventoryTransferModule>(this); |
80 | 80 | ||
81 | scene.EventManager.OnNewClient += OnNewClient; | 81 | scene.EventManager.OnNewClient += OnNewClient; |
82 | scene.EventManager.OnClientClosed += ClientLoggedOut; | 82 | // scene.EventManager.OnClientClosed += ClientLoggedOut; |
83 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; | 83 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; |
84 | scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; | 84 | // scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; |
85 | } | 85 | } |
86 | 86 | ||
87 | public void RegionLoaded(Scene scene) | 87 | public void RegionLoaded(Scene scene) |
@@ -96,9 +96,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
96 | 96 | ||
97 | m_Scenelist.Clear(); | 97 | m_Scenelist.Clear(); |
98 | scene.EventManager.OnNewClient -= OnNewClient; | 98 | scene.EventManager.OnNewClient -= OnNewClient; |
99 | scene.EventManager.OnClientClosed -= ClientLoggedOut; | 99 | // scene.EventManager.OnClientClosed -= ClientLoggedOut; |
100 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; | 100 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; |
101 | scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; | 101 | // scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; |
102 | } | 102 | } |
103 | } | 103 | } |
104 | } | 104 | } |
@@ -106,9 +106,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
106 | public void RemoveRegion(Scene scene) | 106 | public void RemoveRegion(Scene scene) |
107 | { | 107 | { |
108 | scene.EventManager.OnNewClient -= OnNewClient; | 108 | scene.EventManager.OnNewClient -= OnNewClient; |
109 | scene.EventManager.OnClientClosed -= ClientLoggedOut; | 109 | // scene.EventManager.OnClientClosed -= ClientLoggedOut; |
110 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; | 110 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; |
111 | scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; | 111 | // scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; |
112 | m_Scenelist.Remove(scene); | 112 | m_Scenelist.Remove(scene); |
113 | } | 113 | } |
114 | 114 | ||
@@ -138,10 +138,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
138 | client.OnInstantMessage += OnInstantMessage; | 138 | client.OnInstantMessage += OnInstantMessage; |
139 | } | 139 | } |
140 | 140 | ||
141 | protected void OnSetRootAgentScene(UUID id, Scene scene) | 141 | // protected void OnSetRootAgentScene(UUID id, Scene scene) |
142 | { | 142 | // { |
143 | m_AgentRegions[id] = scene; | 143 | // m_AgentRegions[id] = scene; |
144 | } | 144 | // } |
145 | 145 | ||
146 | private Scene FindClientScene(UUID agentId) | 146 | private Scene FindClientScene(UUID agentId) |
147 | { | 147 | { |
@@ -465,69 +465,69 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
465 | } | 465 | } |
466 | } | 466 | } |
467 | 467 | ||
468 | public bool NeedSceneCacheClear(UUID agentID, Scene scene) | 468 | // public bool NeedSceneCacheClear(UUID agentID, Scene scene) |
469 | { | 469 | // { |
470 | if (!m_AgentRegions.ContainsKey(agentID)) | 470 | // if (!m_AgentRegions.ContainsKey(agentID)) |
471 | { | 471 | // { |
472 | // Since we can get here two ways, we need to scan | 472 | // // Since we can get here two ways, we need to scan |
473 | // the scenes here. This is somewhat more expensive | 473 | // // the scenes here. This is somewhat more expensive |
474 | // but helps avoid a nasty bug | 474 | // // but helps avoid a nasty bug |
475 | // | 475 | // // |
476 | 476 | // | |
477 | foreach (Scene s in m_Scenelist) | 477 | // foreach (Scene s in m_Scenelist) |
478 | { | 478 | // { |
479 | ScenePresence presence; | 479 | // ScenePresence presence; |
480 | 480 | // | |
481 | if (s.TryGetScenePresence(agentID, out presence)) | 481 | // if (s.TryGetScenePresence(agentID, out presence)) |
482 | { | 482 | // { |
483 | // If the agent is in this scene, then we | 483 | // // If the agent is in this scene, then we |
484 | // are being called twice in a single | 484 | // // are being called twice in a single |
485 | // teleport. This is wasteful of cycles | 485 | // // teleport. This is wasteful of cycles |
486 | // but harmless due to this 2nd level check | 486 | // // but harmless due to this 2nd level check |
487 | // | 487 | // // |
488 | // If the agent is found in another scene | 488 | // // If the agent is found in another scene |
489 | // then the list wasn't current | 489 | // // then the list wasn't current |
490 | // | 490 | // // |
491 | // If the agent is totally unknown, then what | 491 | // // If the agent is totally unknown, then what |
492 | // are we even doing here?? | 492 | // // are we even doing here?? |
493 | // | 493 | // // |
494 | if (s == scene) | 494 | // if (s == scene) |
495 | { | 495 | // { |
496 | //m_log.Debug("[INVTRANSFERMOD]: s == scene. Returning true in " + scene.RegionInfo.RegionName); | 496 | // //m_log.Debug("[INVTRANSFERMOD]: s == scene. Returning true in " + scene.RegionInfo.RegionName); |
497 | return true; | 497 | // return true; |
498 | } | 498 | // } |
499 | else | 499 | // else |
500 | { | 500 | // { |
501 | //m_log.Debug("[INVTRANSFERMOD]: s != scene. Returning false in " + scene.RegionInfo.RegionName); | 501 | // //m_log.Debug("[INVTRANSFERMOD]: s != scene. Returning false in " + scene.RegionInfo.RegionName); |
502 | return false; | 502 | // return false; |
503 | } | 503 | // } |
504 | } | 504 | // } |
505 | } | 505 | // } |
506 | //m_log.Debug("[INVTRANSFERMOD]: agent not in scene. Returning true in " + scene.RegionInfo.RegionName); | 506 | // //m_log.Debug("[INVTRANSFERMOD]: agent not in scene. Returning true in " + scene.RegionInfo.RegionName); |
507 | return true; | 507 | // return true; |
508 | } | 508 | // } |
509 | 509 | // | |
510 | // The agent is left in current Scene, so we must be | 510 | // // The agent is left in current Scene, so we must be |
511 | // going to another instance | 511 | // // going to another instance |
512 | // | 512 | // // |
513 | if (m_AgentRegions[agentID] == scene) | 513 | // if (m_AgentRegions[agentID] == scene) |
514 | { | 514 | // { |
515 | //m_log.Debug("[INVTRANSFERMOD]: m_AgentRegions[agentID] == scene. Returning true in " + scene.RegionInfo.RegionName); | 515 | // //m_log.Debug("[INVTRANSFERMOD]: m_AgentRegions[agentID] == scene. Returning true in " + scene.RegionInfo.RegionName); |
516 | m_AgentRegions.Remove(agentID); | 516 | // m_AgentRegions.Remove(agentID); |
517 | return true; | 517 | // return true; |
518 | } | 518 | // } |
519 | 519 | // | |
520 | // Another region has claimed the agent | 520 | // // Another region has claimed the agent |
521 | // | 521 | // // |
522 | //m_log.Debug("[INVTRANSFERMOD]: last resort. Returning false in " + scene.RegionInfo.RegionName); | 522 | // //m_log.Debug("[INVTRANSFERMOD]: last resort. Returning false in " + scene.RegionInfo.RegionName); |
523 | return false; | 523 | // return false; |
524 | } | 524 | // } |
525 | 525 | // | |
526 | public void ClientLoggedOut(UUID agentID, Scene scene) | 526 | // public void ClientLoggedOut(UUID agentID, Scene scene) |
527 | { | 527 | // { |
528 | if (m_AgentRegions.ContainsKey(agentID)) | 528 | // if (m_AgentRegions.ContainsKey(agentID)) |
529 | m_AgentRegions.Remove(agentID); | 529 | // m_AgentRegions.Remove(agentID); |
530 | } | 530 | // } |
531 | 531 | ||
532 | /// <summary> | 532 | /// <summary> |
533 | /// | 533 | /// |