aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-19 07:11:58 +0000
committerMelanie Thielker2008-08-19 07:11:58 +0000
commit29530f30296271f2d5641091e45d5f396a7d4dec (patch)
treec0c01f8eabe0b8c3b0db20b3eb3c3c68018d450c /OpenSim/Region/Environment/Scenes/ScenePresence.cs
parent* This reverts a change where m_regions[RegionHandle] was replaced instead of... (diff)
downloadopensim-SC-29530f30296271f2d5641091e45d5f396a7d4dec.zip
opensim-SC-29530f30296271f2d5641091e45d5f396a7d4dec.tar.gz
opensim-SC-29530f30296271f2d5641091e45d5f396a7d4dec.tar.bz2
opensim-SC-29530f30296271f2d5641091e45d5f396a7d4dec.tar.xz
Attachment persistence!!! Patch #9170 (Mantis #1171)
Attachments now persist across logouts. Mostly untested.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs37
1 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 5669af6..af7ae47 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -36,6 +36,7 @@ using libsecondlife.Packets;
36using log4net; 36using log4net;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Communications.Cache; 38using OpenSim.Framework.Communications.Cache;
39using OpenSim.Region.Environment.Interfaces;
39using OpenSim.Region.Environment.Types; 40using OpenSim.Region.Environment.Types;
40using OpenSim.Region.Physics.Manager; 41using OpenSim.Region.Physics.Manager;
41 42
@@ -416,7 +417,8 @@ namespace OpenSim.Region.Environment.Scenes
416 RegisterToEvents(); 417 RegisterToEvents();
417 SetDirectionVectors(); 418 SetDirectionVectors();
418 419
419 420 CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(m_uuid);
421 userInfo.OnItemReceived += ItemReceived;
420 } 422 }
421 423
422 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, 424 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams,
@@ -604,6 +606,12 @@ namespace OpenSim.Region.Environment.Scenes
604 /// </summary> 606 /// </summary>
605 public void MakeRootAgent(LLVector3 pos, bool isFlying) 607 public void MakeRootAgent(LLVector3 pos, bool isFlying)
606 { 608 {
609 IAvatarFactory ava = m_scene.RequestModuleInterface<IAvatarFactory>();
610 if(ava != null)
611 {
612 ava.TryGetAvatarAppearance(m_uuid, out m_appearance);
613 }
614
607// m_log.DebugFormat( 615// m_log.DebugFormat(
608// "[SCENE PRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2} at pos {3}", 616// "[SCENE PRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2} at pos {3}",
609// Name, UUID, m_scene.RegionInfo.RegionName, pos); 617// Name, UUID, m_scene.RegionInfo.RegionName, pos);
@@ -2862,5 +2870,32 @@ namespace OpenSim.Region.Environment.Scenes
2862 //DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG 2870 //DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG
2863 return flags; 2871 return flags;
2864 } 2872 }
2873
2874 private void ItemReceived(LLUUID itemID)
2875 {
2876 int attachpoint = m_appearance.GetAttachpoint(itemID);
2877 if (attachpoint == 0)
2878 return;
2879
2880 SceneObjectPart att = m_scene.GetSceneObjectPart(m_appearance.GetAttachedAsset(attachpoint));
2881
2882
2883 // If this is null, then we have just rezzed in. Non null means
2884 // we're crossing
2885 //
2886 if (att != null)
2887 {
2888 System.Console.WriteLine("Attach from world {0}", itemID.ToString());
2889 // Attach from world
2890 if(att.ParentGroup != null)
2891 m_scene.RezSingleAttachment(att.ParentGroup, ControllingClient, itemID, (uint)attachpoint, 0, 0);
2892 }
2893 else
2894 {
2895 System.Console.WriteLine("Rez attachment {0}", itemID.ToString());
2896 // Rez from inventory
2897 m_scene.RezSingleAttachment(ControllingClient, itemID, (uint)attachpoint, 0, 0);
2898 }
2899 }
2865 } 2900 }
2866} 2901}