aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/EntityBase.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/EntityManager.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs23
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs49
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs79
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs14
7 files changed, 45 insertions, 136 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EntityBase.cs b/OpenSim/Region/Framework/Scenes/EntityBase.cs
index 664be01..741f53b 100644
--- a/OpenSim/Region/Framework/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Framework/Scenes/EntityBase.cs
@@ -103,7 +103,11 @@ namespace OpenSim.Region.Framework.Scenes
103 public virtual uint LocalId 103 public virtual uint LocalId
104 { 104 {
105 get { return m_localId; } 105 get { return m_localId; }
106 set { m_localId = value; } 106 set
107 {
108 m_localId = value;
109// m_log.DebugFormat("[ENTITY BASE]: Set part {0} to local id {1}", Name, m_localId);
110 }
107 } 111 }
108 112
109 /// <summary> 113 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/EntityManager.cs b/OpenSim/Region/Framework/Scenes/EntityManager.cs
index 1812bd2..b788a3c 100644
--- a/OpenSim/Region/Framework/Scenes/EntityManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EntityManager.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.Framework.Scenes
79 { 79 {
80 List<EntityBase> tmp = new List<EntityBase>(); 80 List<EntityBase> tmp = new List<EntityBase>();
81 81
82 m_entities.ForEach( 82 ForEach(
83 delegate(EntityBase entity) 83 delegate(EntityBase entity)
84 { 84 {
85 if (entity is T) 85 if (entity is T)
@@ -93,7 +93,7 @@ namespace OpenSim.Region.Framework.Scenes
93 public EntityBase[] GetEntities() 93 public EntityBase[] GetEntities()
94 { 94 {
95 List<EntityBase> tmp = new List<EntityBase>(m_entities.Count); 95 List<EntityBase> tmp = new List<EntityBase>(m_entities.Count);
96 m_entities.ForEach(delegate(EntityBase entity) { tmp.Add(entity); }); 96 ForEach(delegate(EntityBase entity) { tmp.Add(entity); });
97 return tmp.ToArray(); 97 return tmp.ToArray();
98 } 98 }
99 99
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 65c6a29..0049384 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -77,8 +77,10 @@ namespace OpenSim.Region.Framework.Scenes
77 /// </summary> 77 /// </summary>
78 public event OnNewClientDelegate OnNewClient; 78 public event OnNewClientDelegate OnNewClient;
79 79
80 public delegate void OnClientLoginDelegate(IClientAPI client); 80 /// <summary>
81 public event OnClientLoginDelegate OnClientLogin; 81 /// Fired if the client entering this sim is doing so as a new login
82 /// </summary>
83 public event Action<IClientAPI> OnClientLogin;
82 84
83 public delegate void OnNewPresenceDelegate(ScenePresence presence); 85 public delegate void OnNewPresenceDelegate(ScenePresence presence);
84 86
@@ -214,10 +216,15 @@ namespace OpenSim.Region.Framework.Scenes
214 public delegate void OnMakeChildAgentDelegate(ScenePresence presence); 216 public delegate void OnMakeChildAgentDelegate(ScenePresence presence);
215 public event OnMakeChildAgentDelegate OnMakeChildAgent; 217 public event OnMakeChildAgentDelegate OnMakeChildAgent;
216 218
217 public delegate void OnMakeRootAgentDelegate(ScenePresence presence);
218 public delegate void OnSaveNewWindlightProfileDelegate(); 219 public delegate void OnSaveNewWindlightProfileDelegate();
219 public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user); 220 public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user);
220 public event OnMakeRootAgentDelegate OnMakeRootAgent; 221
222 /// <summary>
223 /// This event is on the critical path for transferring an avatar from one region to another. Try and do
224 /// as little work on this event as possible, or do work asynchronously.
225 /// </summary>
226 public event Action<ScenePresence> OnMakeRootAgent;
227
221 public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted; 228 public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted;
222 public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile; 229 public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile;
223 230
@@ -655,10 +662,10 @@ namespace OpenSim.Region.Framework.Scenes
655 662
656 public void TriggerOnClientLogin(IClientAPI client) 663 public void TriggerOnClientLogin(IClientAPI client)
657 { 664 {
658 OnClientLoginDelegate handlerClientLogin = OnClientLogin; 665 Action<IClientAPI> handlerClientLogin = OnClientLogin;
659 if (handlerClientLogin != null) 666 if (handlerClientLogin != null)
660 { 667 {
661 foreach (OnClientLoginDelegate d in handlerClientLogin.GetInvocationList()) 668 foreach (Action<IClientAPI> d in handlerClientLogin.GetInvocationList())
662 { 669 {
663 try 670 try
664 { 671 {
@@ -1344,10 +1351,10 @@ namespace OpenSim.Region.Framework.Scenes
1344 1351
1345 public void TriggerOnMakeRootAgent(ScenePresence presence) 1352 public void TriggerOnMakeRootAgent(ScenePresence presence)
1346 { 1353 {
1347 OnMakeRootAgentDelegate handlerMakeRootAgent = OnMakeRootAgent; 1354 Action<ScenePresence> handlerMakeRootAgent = OnMakeRootAgent;
1348 if (handlerMakeRootAgent != null) 1355 if (handlerMakeRootAgent != null)
1349 { 1356 {
1350 foreach (OnMakeRootAgentDelegate d in handlerMakeRootAgent.GetInvocationList()) 1357 foreach (Action<ScenePresence> d in handlerMakeRootAgent.GetInvocationList())
1351 { 1358 {
1352 try 1359 try
1353 { 1360 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 149d2d3..0eeb22a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1147,8 +1147,8 @@ namespace OpenSim.Region.Framework.Scenes
1147 1147
1148 m_sceneGraph.Close(); 1148 m_sceneGraph.Close();
1149 1149
1150 // De-register with region communications (events cleanup) 1150 if (!GridService.DeregisterRegion(m_regInfo.RegionID))
1151 UnRegisterRegionWithComms(); 1151 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
1152 1152
1153 // call the base class Close method. 1153 // call the base class Close method.
1154 base.Close(); 1154 base.Close();
@@ -1173,7 +1173,9 @@ namespace OpenSim.Region.Framework.Scenes
1173 } 1173 }
1174 m_lastUpdate = Util.EnvironmentTickCount(); 1174 m_lastUpdate = Util.EnvironmentTickCount();
1175 1175
1176 HeartbeatThread = Watchdog.StartThread(Heartbeat, "Heartbeat for region " + RegionInfo.RegionName, ThreadPriority.Normal, false); 1176 HeartbeatThread
1177 = Watchdog.StartThread(
1178 Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false);
1177 } 1179 }
1178 1180
1179 /// <summary> 1181 /// <summary>
@@ -1659,8 +1661,6 @@ namespace OpenSim.Region.Framework.Scenes
1659 /// <exception cref="System.Exception">Thrown if registration of the region itself fails.</exception> 1661 /// <exception cref="System.Exception">Thrown if registration of the region itself fails.</exception>
1660 public void RegisterRegionWithGrid() 1662 public void RegisterRegionWithGrid()
1661 { 1663 {
1662 RegisterCommsEvents();
1663
1664 m_sceneGridService.SetScene(this); 1664 m_sceneGridService.SetScene(this);
1665 1665
1666 GridRegion region = new GridRegion(RegionInfo); 1666 GridRegion region = new GridRegion(RegionInfo);
@@ -2661,11 +2661,12 @@ namespace OpenSim.Region.Framework.Scenes
2661 // Send all scene object to the new client 2661 // Send all scene object to the new client
2662 Util.FireAndForget(delegate 2662 Util.FireAndForget(delegate
2663 { 2663 {
2664 Entities.ForEach(delegate(EntityBase e) 2664 EntityBase[] entities = Entities.GetEntities();
2665 foreach(EntityBase e in entities)
2665 { 2666 {
2666 if (e != null && e is SceneObjectGroup) 2667 if (e != null && e is SceneObjectGroup)
2667 ((SceneObjectGroup)e).SendFullUpdateToClient(client); 2668 ((SceneObjectGroup)e).SendFullUpdateToClient(client);
2668 }); 2669 }
2669 }); 2670 });
2670 } 2671 }
2671 2672
@@ -3328,40 +3329,6 @@ namespace OpenSim.Region.Framework.Scenes
3328 #region RegionComms 3329 #region RegionComms
3329 3330
3330 /// <summary> 3331 /// <summary>
3331 /// Register the methods that should be invoked when this scene receives various incoming events
3332 /// </summary>
3333 public void RegisterCommsEvents()
3334 {
3335 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing;
3336 m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent;
3337 //m_eventManager.OnRegionUp += OtherRegionUp;
3338 //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
3339 //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
3340 m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid;
3341 m_sceneGridService.OnGetLandData += GetLandData;
3342 }
3343
3344 /// <summary>
3345 /// Deregister this scene from receiving incoming region events
3346 /// </summary>
3347 public void UnRegisterRegionWithComms()
3348 {
3349 m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid;
3350 //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
3351 //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
3352 //m_eventManager.OnRegionUp -= OtherRegionUp;
3353 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing;
3354 m_sceneGridService.OnCloseAgentConnection -= IncomingCloseAgent;
3355 m_sceneGridService.OnGetLandData -= GetLandData;
3356
3357 // this does nothing; should be removed
3358 m_sceneGridService.Close();
3359
3360 if (!GridService.DeregisterRegion(m_regInfo.RegionID))
3361 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
3362 }
3363
3364 /// <summary>
3365 /// Do the work necessary to initiate a new user connection for a particular scene. 3332 /// Do the work necessary to initiate a new user connection for a particular scene.
3366 /// At the moment, this consists of setting up the caps infrastructure 3333 /// At the moment, this consists of setting up the caps infrastructure
3367 /// The return bool should allow for connections to be refused, but as not all calling paths 3334 /// The return bool should allow for connections to be refused, but as not all calling paths
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index fe9fe31..12058c8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -56,88 +56,12 @@ namespace OpenSim.Region.Framework.Scenes
56 protected RegionInfo m_regionInfo; 56 protected RegionInfo m_regionInfo;
57 protected Scene m_scene; 57 protected Scene m_scene;
58 58
59 protected RegionCommsListener regionCommsHost;
60
61 protected List<UUID> m_agentsInTransit;
62
63 /// <summary>
64 /// An agent is crossing into this region
65 /// </summary>
66 public event AgentCrossing OnAvatarCrossingIntoRegion;
67
68 /// <summary>
69 /// A user will arrive shortly, set up appropriate credentials so it can connect
70 /// </summary>
71// public event ExpectUserDelegate OnExpectUser;
72
73 /// <summary>
74 /// A Prim will arrive shortly
75 /// </summary>
76 public event CloseAgentConnection OnCloseAgentConnection;
77
78 /// <summary>
79 /// A new prim has arrived
80 /// </summary>
81// public event PrimCrossing OnPrimCrossingIntoRegion;
82
83 ///// <summary>
84 ///// A New Region is up and available
85 ///// </summary>
86 //public event RegionUp OnRegionUp;
87
88 /// <summary>
89 /// We have a child agent for this avatar and we're getting a status update about it
90 /// </summary>
91// public event ChildAgentUpdate OnChildAgentUpdate;
92 //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar;
93
94 /// <summary>
95 /// Time to log one of our users off. Grid Service sends this mostly
96 /// </summary>
97 public event LogOffUser OnLogOffUser;
98
99 /// <summary>
100 /// A region wants land data from us!
101 /// </summary>
102 public event GetLandData OnGetLandData;
103
104// private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion;
105// private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser;
106// private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
107// private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
108 //private RegionUp handlerRegionUp = null; // OnRegionUp;
109// private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate;
110 //private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar;
111// private LogOffUser handlerLogOffUser = null;
112// private GetLandData handlerGetLandData = null; // OnGetLandData
113
114 public SceneCommunicationService()
115 {
116 }
117
118 public void SetScene(Scene s) 59 public void SetScene(Scene s)
119 { 60 {
120 m_scene = s; 61 m_scene = s;
121 m_regionInfo = s.RegionInfo; 62 m_regionInfo = s.RegionInfo;
122 } 63 }
123 64
124 /// <summary>
125 /// Register a region with the grid
126 /// </summary>
127 /// <param name="regionInfos"></param>
128 /// <exception cref="System.Exception">Thrown if region registration fails.</exception>
129 public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos)
130 {
131 }
132
133 /// <summary>
134 /// This region is shutting down, de-register all events!
135 /// De-Register region from Grid!
136 /// </summary>
137 public void Close()
138 {
139 }
140
141 public delegate void InformNeighbourThatRegionUpDelegate(INeighbourService nService, RegionInfo region, ulong regionhandle); 65 public delegate void InformNeighbourThatRegionUpDelegate(INeighbourService nService, RegionInfo region, ulong regionhandle);
142 66
143 private void InformNeighborsThatRegionisUpCompleted(IAsyncResult iar) 67 private void InformNeighborsThatRegionisUpCompleted(IAsyncResult iar)
@@ -173,7 +97,6 @@ namespace OpenSim.Region.Framework.Scenes
173 } 97 }
174 } 98 }
175 99
176
177 public void InformNeighborsThatRegionisUp(INeighbourService neighbourService, RegionInfo region) 100 public void InformNeighborsThatRegionisUp(INeighbourService neighbourService, RegionInfo region)
178 { 101 {
179 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); 102 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
@@ -190,7 +113,6 @@ namespace OpenSim.Region.Framework.Scenes
190 } 113 }
191 114
192 public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, UUID scopeID, GridRegion dest); 115 public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, UUID scopeID, GridRegion dest);
193
194 116
195 /// <summary> 117 /// <summary>
196 /// This informs all neighboring regions about the settings of it's child agent. 118 /// This informs all neighboring regions about the settings of it's child agent.
@@ -295,6 +217,5 @@ namespace OpenSim.Region.Framework.Scenes
295 { 217 {
296 return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber); 218 return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber);
297 } 219 }
298
299 } 220 }
300} 221}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 45ca0b7..e214f57 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -533,7 +533,11 @@ namespace OpenSim.Region.Framework.Scenes
533 public uint LocalId 533 public uint LocalId
534 { 534 {
535 get { return m_localId; } 535 get { return m_localId; }
536 set { m_localId = value; } 536 set
537 {
538 m_localId = value;
539// m_log.DebugFormat("[SCENE OBJECT PART]: Set part {0} to local id {1}", Name, m_localId);
540 }
537 } 541 }
538 542
539 public virtual string Name 543 public virtual string Name
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 839259f..d89c1c0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -757,7 +757,7 @@ namespace OpenSim.Region.Framework.Scenes
757 m_name = String.Format("{0} {1}", Firstname, Lastname); 757 m_name = String.Format("{0} {1}", Firstname, Lastname);
758 m_scene = world; 758 m_scene = world;
759 m_uuid = client.AgentId; 759 m_uuid = client.AgentId;
760 m_localId = m_scene.AllocateLocalId(); 760 LocalId = m_scene.AllocateLocalId();
761 761
762 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); 762 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
763 if (account != null) 763 if (account != null)
@@ -860,9 +860,15 @@ namespace OpenSim.Region.Framework.Scenes
860 #region Status Methods 860 #region Status Methods
861 861
862 /// <summary> 862 /// <summary>
863 /// This turns a child agent, into a root agent 863 /// Turns a child agent into a root agent.
864 /// This is called when an agent teleports into a region, or if an 864 /// </summary>
865 /// agent crosses into this region from a neighbor over the border 865 /// Child agents are logged into neighbouring sims largely to observe changes. Root agents exist when the
866 /// avatar is actual in the sim. They can perform all actions.
867 /// This change is made whenever an avatar enters a region, whether by crossing over from a neighbouring sim,
868 /// teleporting in or on initial login.
869 ///
870 /// This method is on the critical path for transferring an avatar from one region to another. Delay here
871 /// delays that crossing.
866 /// </summary> 872 /// </summary>
867 public void MakeRootAgent(Vector3 pos, bool isFlying) 873 public void MakeRootAgent(Vector3 pos, bool isFlying)
868 { 874 {