aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-04-26 17:36:30 +0000
committerTeravus Ovares2008-04-26 17:36:30 +0000
commit323038ceb956fef577ebd83c502cc377bcfe83f9 (patch)
tree926410e63d94006e0d66d9ab24213b9f51519342 /OpenSim/Region/Environment/Scenes/ScenePresence.cs
parent* Committing Mantis #1061 - llRegionSay and llSetPrimitiveParams implementati... (diff)
downloadopensim-SC_OLD-323038ceb956fef577ebd83c502cc377bcfe83f9.zip
opensim-SC_OLD-323038ceb956fef577ebd83c502cc377bcfe83f9.tar.gz
opensim-SC_OLD-323038ceb956fef577ebd83c502cc377bcfe83f9.tar.bz2
opensim-SC_OLD-323038ceb956fef577ebd83c502cc377bcfe83f9.tar.xz
* Ooops, attachments now teleport/cross region borders along with your avatar. Those dastardly objects stick to you.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs43
1 files changed, 41 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 94dbbb3..6a56204 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -117,6 +117,8 @@ namespace OpenSim.Region.Environment.Scenes
117 117
118 protected AvatarAppearance m_appearance; 118 protected AvatarAppearance m_appearance;
119 119
120 protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>();
121
120 //neighbouring regions we have enabled a child agent in 122 //neighbouring regions we have enabled a child agent in
121 private readonly List<ulong> m_knownChildRegions = new List<ulong>(); 123 private readonly List<ulong> m_knownChildRegions = new List<ulong>();
122 124
@@ -1672,8 +1674,8 @@ namespace OpenSim.Region.Environment.Scenes
1672 // When the neighbour is informed of the border crossing, it will set up CAPS handlers for the avatar 1674 // When the neighbour is informed of the border crossing, it will set up CAPS handlers for the avatar
1673 // This means we need to remove the current caps handler here and possibly compensate later, 1675 // This means we need to remove the current caps handler here and possibly compensate later,
1674 // in case both scenes are being hosted on the same region server. Messy 1676 // in case both scenes are being hosted on the same region server. Messy
1675 m_scene.RemoveCapsHandler(UUID); 1677 m_scene.RemoveCapsHandler(UUID);
1676 1678 newpos = newpos + (vel);
1677 bool res = 1679 bool res =
1678 m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, 1680 m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos,
1679 m_physicsActor.Flying); 1681 m_physicsActor.Flying);
@@ -1692,6 +1694,7 @@ namespace OpenSim.Region.Environment.Scenes
1692 m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, 1694 m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint,
1693 capsPath); 1695 capsPath);
1694 MakeChildAgent(); 1696 MakeChildAgent();
1697 CrossAttachmentsIntoNewRegion(neighbourHandle);
1695 m_scene.SendKillObject(m_localId); 1698 m_scene.SendKillObject(m_localId);
1696 m_scene.NotifyMyCoarseLocationChange(); 1699 m_scene.NotifyMyCoarseLocationChange();
1697 } 1700 }
@@ -1943,7 +1946,43 @@ namespace OpenSim.Region.Environment.Scenes
1943 DefaultTexture = textu.ToBytes(); 1946 DefaultTexture = textu.ToBytes();
1944 } 1947 }
1945 } 1948 }
1949 public void AddAttachment(SceneObjectGroup gobj)
1950 {
1951 lock (m_attachments)
1952 {
1953 m_attachments.Add(gobj);
1954 }
1955 }
1956 public void RemoveAttachment(SceneObjectGroup gobj)
1957 {
1958 lock (m_attachments)
1959 {
1960 if (m_attachments.Contains(gobj))
1961 {
1962 m_attachments.Remove(gobj);
1963 }
1964 }
1965 }
1966 public void CrossAttachmentsIntoNewRegion(ulong regionHandle)
1967 {
1968 lock (m_attachments)
1969 {
1970 foreach (SceneObjectGroup gobj in m_attachments)
1971 {
1972 // If the prim group is null then something must have happened to it!
1973 if (gobj != null)
1974 {
1975 // Set the parent localID to 0 so it transfers over properly.
1976 gobj.RootPart.SetParentLocalId(0);
1977 gobj.RootPart.m_IsAttachment = false;
1978 gobj.AbsolutePosition = gobj.RootPart.m_attachedPos;
1979 m_scene.CrossPrimGroupIntoNewRegion(regionHandle, gobj);
1980 }
1981 }
1982 m_attachments.Clear();
1983 }
1946 1984
1985 }
1947 public void initializeScenePresence(IClientAPI client, RegionInfo region, Scene scene) 1986 public void initializeScenePresence(IClientAPI client, RegionInfo region, Scene scene)
1948 { 1987 {
1949 m_controllingClient = client; 1988 m_controllingClient = client;