aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs47
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs93
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs2
4 files changed, 72 insertions, 73 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 8b8ac20..cf188aa 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -481,14 +481,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
481// "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})", 481// "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})",
482// group.Name, group.LocalId, sp.Name, attachmentPt, silent); 482// group.Name, group.LocalId, sp.Name, attachmentPt, silent);
483 483
484 if (sp.GetAttachments().Contains(group))
485 {
486// m_log.WarnFormat(
487// "[ATTACHMENTS MODULE]: Ignoring request to attach {0} {1} to {2} on {3} since it's already attached",
488// group.Name, group.LocalId, sp.Name, AttachmentPt);
489
490 return false;
491 }
492 484
493 if (group.GetSittingAvatarsCount() != 0) 485 if (group.GetSittingAvatarsCount() != 0)
494 { 486 {
@@ -500,6 +492,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
500 return false; 492 return false;
501 } 493 }
502 494
495 List<SceneObjectGroup> attachments = sp.GetAttachments(attachmentPt);
496 if (attachments.Contains(group))
497 {
498// if (DebugLevel > 0)
499// m_log.WarnFormat(
500// "[ATTACHMENTS MODULE]: Ignoring request to attach {0} {1} to {2} on {3} since it's already attached",
501// group.Name, group.LocalId, sp.Name, attachmentPt);
502
503 return false;
504 }
505
503 Vector3 attachPos = group.AbsolutePosition; 506 Vector3 attachPos = group.AbsolutePosition;
504 507
505 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should 508 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
@@ -533,7 +536,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
533 { 536 {
534 attachmentPt = (uint)group.RootPart.Shape.LastAttachPoint; 537 attachmentPt = (uint)group.RootPart.Shape.LastAttachPoint;
535 attachPos = group.RootPart.AttachedPos; 538 attachPos = group.RootPart.AttachedPos;
536 group.HasGroupChanged = true;
537 } 539 }
538 540
539 // if we still didn't find a suitable attachment point....... 541 // if we still didn't find a suitable attachment point.......
@@ -544,18 +546,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
544 attachPos = Vector3.Zero; 546 attachPos = Vector3.Zero;
545 } 547 }
546 548
547 List<SceneObjectGroup> attachments = sp.GetAttachments(attachmentPt);
548
549 if (attachments.Contains(group))
550 {
551 if (DebugLevel > 0)
552 m_log.WarnFormat(
553 "[ATTACHMENTS MODULE]: Ignoring request to attach {0} {1} to {2} on {3} since it's already attached",
554 group.Name, group.LocalId, sp.Name, attachmentPt);
555
556 return false;
557 }
558
559 // If we already have 5, remove the oldest until only 4 are left. Skip over temp ones 549 // If we already have 5, remove the oldest until only 4 are left. Skip over temp ones
560 while (attachments.Count >= 5) 550 while (attachments.Count >= 5)
561 { 551 {
@@ -579,7 +569,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
579 lock (sp.AttachmentsSyncLock) 569 lock (sp.AttachmentsSyncLock)
580 { 570 {
581 group.AttachmentPoint = attachmentPt; 571 group.AttachmentPoint = attachmentPt;
582 group.AbsolutePosition = attachPos; 572 group.RootPart.AttachedPos = attachPos;
583 573
584 if (addToInventory && sp.PresenceType != PresenceType.Npc) 574 if (addToInventory && sp.PresenceType != PresenceType.Npc)
585 UpdateUserInventoryWithAttachment(sp, group, attachmentPt, append); 575 UpdateUserInventoryWithAttachment(sp, group, attachmentPt, append);
@@ -956,7 +946,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
956 m_scene.DeleteFromStorage(so.UUID); 946 m_scene.DeleteFromStorage(so.UUID);
957 m_scene.EventManager.TriggerParcelPrimCountTainted(); 947 m_scene.EventManager.TriggerParcelPrimCountTainted();
958 948
959 so.AttachedAvatar = sp.UUID;
960 949
961 foreach (SceneObjectPart part in so.Parts) 950 foreach (SceneObjectPart part in so.Parts)
962 { 951 {
@@ -969,11 +958,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
969 } 958 }
970 } 959 }
971 960
972 so.AbsolutePosition = attachOffset;
973 so.RootPart.AttachedPos = attachOffset;
974 so.IsAttachment = true;
975 so.RootPart.SetParentLocalId(sp.LocalId); 961 so.RootPart.SetParentLocalId(sp.LocalId);
962 so.AttachedAvatar = sp.UUID;
976 so.AttachmentPoint = attachmentpoint; 963 so.AttachmentPoint = attachmentpoint;
964 so.RootPart.AttachedPos = attachOffset;
965 so.AbsolutePosition = attachOffset;
966 so.IsAttachment = true;
977 967
978 sp.AddAttachment(so); 968 sp.AddAttachment(so);
979 969
@@ -1322,7 +1312,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1322 if (part == null) 1312 if (part == null)
1323 return; 1313 return;
1324 1314
1325 if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId)) 1315 SceneObjectGroup group = part.ParentGroup;
1316
1317 if (!m_scene.Permissions.CanTakeObject(group, sp))
1326 { 1318 {
1327 remoteClient.SendAgentAlertMessage( 1319 remoteClient.SendAgentAlertMessage(
1328 "You don't have sufficient permissions to attach this object", false); 1320 "You don't have sufficient permissions to attach this object", false);
@@ -1334,7 +1326,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
1334 AttachmentPt &= 0x7f; 1326 AttachmentPt &= 0x7f;
1335 1327
1336 // Calls attach with a Zero position 1328 // Calls attach with a Zero position
1337 SceneObjectGroup group = part.ParentGroup;
1338 if (AttachObject(sp, group , AttachmentPt, false, true, append)) 1329 if (AttachObject(sp, group , AttachmentPt, false, true, append))
1339 { 1330 {
1340 if (DebugLevel > 0) 1331 if (DebugLevel > 0)
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index fb408a4..535d946 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -299,7 +299,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
299 if (bakedTextureFace == null) 299 if (bakedTextureFace == null)
300 continue; 300 continue;
301 301
302 AssetBase asset = cache.Get(bakedTextureFace.TextureID.ToString()); 302 AssetBase asset;
303 cache.Get(bakedTextureFace.TextureID.ToString(), out asset);
303 304
304 if (asset != null && asset.Local) 305 if (asset != null && asset.Local)
305 { 306 {
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
index d1f6054..315ce1b 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
@@ -52,6 +52,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 private bool enabled = true; 54 private bool enabled = true;
55 private bool m_UseNewAvnCode = false;
55 private List<Scene> m_SceneList = new List<Scene>(); 56 private List<Scene> m_SceneList = new List<Scene>();
56 private string m_RestURL = String.Empty; 57 private string m_RestURL = String.Empty;
57 IMessageTransferModule m_TransferModule = null; 58 IMessageTransferModule m_TransferModule = null;
@@ -82,6 +83,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
82 } 83 }
83 84
84 m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages); 85 m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages);
86 m_UseNewAvnCode = cnf.GetBoolean("UseNewAvnCode", m_UseNewAvnCode);
85 } 87 }
86 88
87 public void AddRegion(Scene scene) 89 public void AddRegion(Scene scene)
@@ -244,68 +246,73 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
244 return; 246 return;
245 } 247 }
246 248
247 Scene scene = FindScene(new UUID(im.fromAgentID)); 249 if(m_UseNewAvnCode)
248 if (scene == null) 250 {
249 scene = m_SceneList[0]; 251 Scene scene = FindScene(new UUID(im.fromAgentID));
252 if (scene == null)
253 scene = m_SceneList[0];
250 254
251// Avination new code 255 UUID scopeID = scene.RegionInfo.ScopeID;
252// SendReply reply = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, SendReply>( 256 SendReply reply = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, SendReply>(
253// "POST", m_RestURL+"/SaveMessage/?scope=" + 257 "POST", m_RestURL+"/SaveMessage/?scope=" + scopeID.ToString(), im, 20000);
254// scene.RegionInfo.ScopeID.ToString(), im);
255 258
256// current opensim and osgrid compatible 259 if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
257 bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>( 260 {
258 "POST", m_RestURL+"/SaveMessage/", im, 10000); 261 IClientAPI client = FindClient(new UUID(im.fromAgentID));
259// current opensim and osgrid compatible end 262 if (client == null)
263 return;
260 264
261 if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) 265 if (string.IsNullOrEmpty(reply.Message))
262 { 266 reply.Message = "User is not logged in. " + (reply.Success ? "Message saved." : "Message not saved");
263 IClientAPI client = FindClient(new UUID(im.fromAgentID));
264 if (client == null)
265 return;
266/* Avination new code
267 if (reply.Message == String.Empty)
268 reply.Message = "User is not logged in. " + (reply.Success ? "Message saved." : "Message not saved");
269 267
270 bool sendReply = true; 268 bool sendReply = true;
271 269
272 switch (reply.Disposition) 270 switch (reply.Disposition)
273 {
274 case 0: // Normal
275 break;
276 case 1: // Only once per user
277 if (m_repliesSent.ContainsKey(client) && m_repliesSent[client].Contains(new UUID(im.toAgentID)))
278 { 271 {
279 sendReply = false; 272 case 0: // Normal
273 break;
274 case 1: // Only once per user
275 if (m_repliesSent.ContainsKey(client) && m_repliesSent[client].Contains(new UUID(im.toAgentID)))
276 sendReply = false;
277 else
278 {
279 if (!m_repliesSent.ContainsKey(client))
280 m_repliesSent[client] = new List<UUID>();
281 m_repliesSent[client].Add(new UUID(im.toAgentID));
282 }
283 break;
280 } 284 }
281 else 285
286 if (sendReply)
282 { 287 {
283 if (!m_repliesSent.ContainsKey(client)) 288 client.SendInstantMessage(new GridInstantMessage(
284 m_repliesSent[client] = new List<UUID>(); 289 null, new UUID(im.toAgentID),
285 m_repliesSent[client].Add(new UUID(im.toAgentID)); 290 "System", new UUID(im.fromAgentID),
291 (byte)InstantMessageDialog.MessageFromAgent,
292 reply.Message,
293 false, new Vector3()));
286 } 294 }
287 break;
288 } 295 }
296 }
297 else
298 {
299 bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>(
300 "POST", m_RestURL+"/SaveMessage/", im, 20000);
289 301
290 if (sendReply) 302 if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
291 { 303 {
304 IClientAPI client = FindClient(new UUID(im.fromAgentID));
305 if (client == null)
306 return;
307
292 client.SendInstantMessage(new GridInstantMessage( 308 client.SendInstantMessage(new GridInstantMessage(
293 null, new UUID(im.toAgentID),
294 "System", new UUID(im.fromAgentID),
295 (byte)InstantMessageDialog.MessageFromAgent,
296 reply.Message,
297 false, new Vector3()));
298 }
299*/
300// current opensim and osgrid compatible
301 client.SendInstantMessage(new GridInstantMessage(
302 null, new UUID(im.toAgentID), 309 null, new UUID(im.toAgentID),
303 "System", new UUID(im.fromAgentID), 310 "System", new UUID(im.fromAgentID),
304 (byte)InstantMessageDialog.MessageFromAgent, 311 (byte)InstantMessageDialog.MessageFromAgent,
305 "User is not logged in. "+ 312 "User is not logged in. "+
306 (success ? "Message saved." : "Message not saved"), 313 (success ? "Message saved." : "Message not saved"),
307 false, new Vector3())); 314 false, new Vector3()));
308// current opensim and osgrid compatible end 315 }
309 } 316 }
310 } 317 }
311 } 318 }
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index bc8aeca..89e3020 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
149 149
150 if (profileConfig == null) 150 if (profileConfig == null)
151 { 151 {
152 m_log.Debug("[PROFILES]: UserProfiles disabled, no configuration"); 152 //m_log.Debug("[PROFILES]: UserProfiles disabled, no configuration");
153 Enabled = false; 153 Enabled = false;
154 return; 154 return;
155 } 155 }