aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs246
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs27
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs21
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs98
9 files changed, 215 insertions, 248 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
index 26bc922..8670229 100644
--- a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
@@ -31,9 +31,10 @@ using OpenSim.Framework;
31 31
32namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
33{ 33{
34 public delegate void ReportOutputAction(string format, params object[] args);
35
34 public interface IAvatarFactoryModule 36 public interface IAvatarFactoryModule
35 { 37 {
36
37 void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams); 38 void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams);
38 39
39 /// <summary> 40 /// <summary>
@@ -63,5 +64,13 @@ namespace OpenSim.Region.Framework.Interfaces
63 bool ValidateBakedTextureCache(IScenePresence sp); 64 bool ValidateBakedTextureCache(IScenePresence sp);
64 void QueueAppearanceSend(UUID agentid); 65 void QueueAppearanceSend(UUID agentid);
65 void QueueAppearanceSave(UUID agentid); 66 void QueueAppearanceSave(UUID agentid);
67
68 /// <summary>
69 /// Get a report about the current state of a scene presence's baked appearance textures.
70 /// </summary>
71 /// <param name="sp"></param>
72 /// <param name="reportOutputAction"></param>
73 /// <returns></returns>
74 void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction reportOutputAction);
66 } 75 }
67} \ No newline at end of file 76} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 4a4d98f..4f71915 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -1564,6 +1564,12 @@ namespace OpenSim.Region.Framework.Scenes
1564 1564
1565 public void TriggerRequestChangeWaterHeight(float height) 1565 public void TriggerRequestChangeWaterHeight(float height)
1566 { 1566 {
1567 if (height < 0)
1568 {
1569 // ignore negative water height
1570 return;
1571 }
1572
1567 RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; 1573 RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight;
1568 if (handlerRequestChangeWaterHeight != null) 1574 if (handlerRequestChangeWaterHeight != null)
1569 { 1575 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 6ba74c7..3355ebe 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -116,66 +116,78 @@ namespace OpenSim.Region.Framework.Scenes
116 /// <param name="remoteClient"></param> 116 /// <param name="remoteClient"></param>
117 public void RequestPrim(uint primLocalID, IClientAPI remoteClient) 117 public void RequestPrim(uint primLocalID, IClientAPI remoteClient)
118 { 118 {
119 EntityBase[] entityList = GetEntities(); 119 SceneObjectGroup sog = GetGroupByPrim(primLocalID);
120 foreach (EntityBase ent in entityList) 120
121 if (sog != null)
122 sog.SendFullUpdateToClient(remoteClient);
123 }
124
125 /// <summary>
126 /// Invoked when the client selects a prim.
127 /// </summary>
128 /// <param name="primLocalID"></param>
129 /// <param name="remoteClient"></param>
130 public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
131 {
132 SceneObjectPart part = GetSceneObjectPart(primLocalID);
133
134 if (null == part)
135 return;
136
137 if (part.IsRoot)
121 { 138 {
122 if (ent is SceneObjectGroup) 139 SceneObjectGroup sog = part.ParentGroup;
140 sog.SendPropertiesToClient(remoteClient);
141 sog.IsSelected = true;
142
143 // A prim is only tainted if it's allowed to be edited by the person clicking it.
144 if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId)
145 || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
123 { 146 {
124 if (((SceneObjectGroup)ent).LocalId == primLocalID) 147 EventManager.TriggerParcelPrimCountTainted();
125 {
126 ((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient);
127 return;
128 }
129 } 148 }
130 } 149 }
150 else
151 {
152 part.SendPropertiesToClient(remoteClient);
153 }
131 } 154 }
132 155
133 /// <summary> 156 /// <summary>
134 /// Invoked when the client selects a prim. 157 /// Handle the update of an object's user group.
135 /// </summary> 158 /// </summary>
136 /// <param name="primLocalID"></param>
137 /// <param name="remoteClient"></param> 159 /// <param name="remoteClient"></param>
138 public void SelectPrim(uint primLocalID, IClientAPI remoteClient) 160 /// <param name="groupID"></param>
161 /// <param name="objectLocalID"></param>
162 /// <param name="Garbage"></param>
163 private void HandleObjectGroupUpdate(
164 IClientAPI remoteClient, UUID groupID, uint objectLocalID, UUID Garbage)
139 { 165 {
140 EntityBase[] entityList = GetEntities(); 166 if (m_groupsModule == null)
141 foreach (EntityBase ent in entityList) 167 return;
168
169 // XXX: Might be better to get rid of this special casing and have GetMembershipData return something
170 // reasonable for a UUID.Zero group.
171 if (groupID != UUID.Zero)
142 { 172 {
143 if (ent is SceneObjectGroup) 173 GroupMembershipData gmd = m_groupsModule.GetMembershipData(groupID, remoteClient.AgentId);
174
175 if (gmd == null)
144 { 176 {
145 if (((SceneObjectGroup) ent).LocalId == primLocalID) 177// m_log.WarnFormat(
146 { 178// "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group",
147 ((SceneObjectGroup) ent).SendPropertiesToClient(remoteClient); 179// remoteClient.Name, GroupID, objectLocalID);
148 ((SceneObjectGroup) ent).IsSelected = true; 180
149 // A prim is only tainted if it's allowed to be edited by the person clicking it. 181 return;
150 if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) 182 }
151 || Permissions.CanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)) 183 }
152 { 184
153 EventManager.TriggerParcelPrimCountTainted(); 185 SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID);
154 } 186 if (so != null)
155 break; 187 {
156 } 188 if (so.OwnerID == remoteClient.AgentId)
157 else 189 {
158 { 190 so.SetGroup(groupID, remoteClient);
159 // We also need to check the children of this prim as they
160 // can be selected as well and send property information
161 bool foundPrim = false;
162
163 SceneObjectGroup sog = ent as SceneObjectGroup;
164
165 SceneObjectPart[] partList = sog.Parts;
166 foreach (SceneObjectPart part in partList)
167 {
168 if (part.LocalId == primLocalID)
169 {
170 part.SendPropertiesToClient(remoteClient);
171 foundPrim = true;
172 break;
173 }
174 }
175
176 if (foundPrim)
177 break;
178 }
179 } 191 }
180 } 192 }
181 } 193 }
@@ -250,121 +262,81 @@ namespace OpenSim.Region.Framework.Scenes
250 262
251 public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) 263 public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
252 { 264 {
253 EntityBase[] EntityList = GetEntities(); 265 SceneObjectPart part = GetSceneObjectPart(localID);
266
267 if (part == null)
268 return;
269
270 SceneObjectGroup obj = part.ParentGroup;
254 271
255 SurfaceTouchEventArgs surfaceArg = null; 272 SurfaceTouchEventArgs surfaceArg = null;
256 if (surfaceArgs != null && surfaceArgs.Count > 0) 273 if (surfaceArgs != null && surfaceArgs.Count > 0)
257 surfaceArg = surfaceArgs[0]; 274 surfaceArg = surfaceArgs[0];
258 275
259 foreach (EntityBase ent in EntityList) 276 // Currently only grab/touch for the single prim
277 // the client handles rez correctly
278 obj.ObjectGrabHandler(localID, offsetPos, remoteClient);
279
280 // If the touched prim handles touches, deliver it
281 // If not, deliver to root prim
282 if ((part.ScriptEvents & scriptEvents.touch_start) != 0)
283 EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg);
284
285 // Deliver to the root prim if the touched prim doesn't handle touches
286 // or if we're meant to pass on touches anyway. Don't send to root prim
287 // if prim touched is the root prim as we just did it
288 if (((part.ScriptEvents & scriptEvents.touch_start) == 0) ||
289 (part.PassTouches && (part.LocalId != obj.RootPart.LocalId)))
260 { 290 {
261 if (ent is SceneObjectGroup) 291 EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg);
262 {
263 SceneObjectGroup obj = ent as SceneObjectGroup;
264 if (obj != null)
265 {
266 // Is this prim part of the group
267 if (obj.HasChildPrim(localID))
268 {
269 // Currently only grab/touch for the single prim
270 // the client handles rez correctly
271 obj.ObjectGrabHandler(localID, offsetPos, remoteClient);
272
273 SceneObjectPart part = obj.GetChildPart(localID);
274
275 // If the touched prim handles touches, deliver it
276 // If not, deliver to root prim
277 if ((part.ScriptEvents & scriptEvents.touch_start) != 0)
278 EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg);
279 // Deliver to the root prim if the touched prim doesn't handle touches
280 // or if we're meant to pass on touches anyway. Don't send to root prim
281 // if prim touched is the root prim as we just did it
282 if (((part.ScriptEvents & scriptEvents.touch_start) == 0) ||
283 (part.PassTouches && (part.LocalId != obj.RootPart.LocalId)))
284 {
285 EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg);
286 }
287
288 return;
289 }
290 }
291 }
292 } 292 }
293 } 293 }
294 294
295 public virtual void ProcessObjectGrabUpdate(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) 295 public virtual void ProcessObjectGrabUpdate(
296 UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
296 { 297 {
297 EntityBase[] EntityList = GetEntities(); 298 SceneObjectPart part = GetSceneObjectPart(objectID);
299 if (part == null)
300 return;
301
302 SceneObjectGroup obj = part.ParentGroup;
298 303
299 SurfaceTouchEventArgs surfaceArg = null; 304 SurfaceTouchEventArgs surfaceArg = null;
300 if (surfaceArgs != null && surfaceArgs.Count > 0) 305 if (surfaceArgs != null && surfaceArgs.Count > 0)
301 surfaceArg = surfaceArgs[0]; 306 surfaceArg = surfaceArgs[0];
302 307
303 foreach (EntityBase ent in EntityList) 308 // If the touched prim handles touches, deliver it
309 // If not, deliver to root prim
310 if ((part.ScriptEvents & scriptEvents.touch) != 0)
311 EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg);
312 // Deliver to the root prim if the touched prim doesn't handle touches
313 // or if we're meant to pass on touches anyway. Don't send to root prim
314 // if prim touched is the root prim as we just did it
315 if (((part.ScriptEvents & scriptEvents.touch) == 0) ||
316 (part.PassTouches && (part.LocalId != obj.RootPart.LocalId)))
304 { 317 {
305 if (ent is SceneObjectGroup) 318 EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg);
306 {
307 SceneObjectGroup obj = ent as SceneObjectGroup;
308 if (obj != null)
309 {
310 // Is this prim part of the group
311 if (obj.HasChildPrim(objectID))
312 {
313 SceneObjectPart part = obj.GetChildPart(objectID);
314
315 // If the touched prim handles touches, deliver it
316 // If not, deliver to root prim
317 if ((part.ScriptEvents & scriptEvents.touch) != 0)
318 EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg);
319 // Deliver to the root prim if the touched prim doesn't handle touches
320 // or if we're meant to pass on touches anyway. Don't send to root prim
321 // if prim touched is the root prim as we just did it
322 if (((part.ScriptEvents & scriptEvents.touch) == 0) ||
323 (part.PassTouches && (part.LocalId != obj.RootPart.LocalId)))
324 {
325 EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg);
326 }
327
328 return;
329 }
330 }
331 }
332 } 319 }
333 } 320 }
334 321
335 public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) 322 public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
336 { 323 {
337 EntityBase[] EntityList = GetEntities(); 324 SceneObjectPart part = GetSceneObjectPart(localID);
325 if (part == null)
326 return;
327
328 SceneObjectGroup obj = part.ParentGroup;
338 329
339 SurfaceTouchEventArgs surfaceArg = null; 330 SurfaceTouchEventArgs surfaceArg = null;
340 if (surfaceArgs != null && surfaceArgs.Count > 0) 331 if (surfaceArgs != null && surfaceArgs.Count > 0)
341 surfaceArg = surfaceArgs[0]; 332 surfaceArg = surfaceArgs[0];
342 333
343 foreach (EntityBase ent in EntityList) 334 // If the touched prim handles touches, deliver it
344 { 335 // If not, deliver to root prim
345 if (ent is SceneObjectGroup) 336 if ((part.ScriptEvents & scriptEvents.touch_end) != 0)
346 { 337 EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg);
347 SceneObjectGroup obj = ent as SceneObjectGroup; 338 else
348 339 EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg);
349 // Is this prim part of the group
350 if (obj.HasChildPrim(localID))
351 {
352 SceneObjectPart part=obj.GetChildPart(localID);
353 if (part != null)
354 {
355 // If the touched prim handles touches, deliver it
356 // If not, deliver to root prim
357 if ((part.ScriptEvents & scriptEvents.touch_end) != 0)
358 EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg);
359 else
360 EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg);
361
362 return;
363 }
364 return;
365 }
366 }
367 }
368 } 340 }
369 341
370 public void ProcessAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query) 342 public void ProcessAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 4ab6fe4..6666328 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -139,6 +139,7 @@ namespace OpenSim.Region.Framework.Scenes
139 protected IDialogModule m_dialogModule; 139 protected IDialogModule m_dialogModule;
140 protected IEntityTransferModule m_teleportModule; 140 protected IEntityTransferModule m_teleportModule;
141 protected ICapabilitiesModule m_capsModule; 141 protected ICapabilitiesModule m_capsModule;
142 protected IGroupsModule m_groupsModule;
142 143
143 /// <summary> 144 /// <summary>
144 /// Current scene frame number 145 /// Current scene frame number
@@ -1164,6 +1165,7 @@ namespace OpenSim.Region.Framework.Scenes
1164 m_dialogModule = RequestModuleInterface<IDialogModule>(); 1165 m_dialogModule = RequestModuleInterface<IDialogModule>();
1165 m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); 1166 m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
1166 m_teleportModule = RequestModuleInterface<IEntityTransferModule>(); 1167 m_teleportModule = RequestModuleInterface<IEntityTransferModule>();
1168 m_groupsModule = RequestModuleInterface<IGroupsModule>();
1167 } 1169 }
1168 1170
1169 #endregion 1171 #endregion
@@ -2512,7 +2514,7 @@ namespace OpenSim.Region.Framework.Scenes
2512 if (sp == null) 2514 if (sp == null)
2513 { 2515 {
2514 m_log.DebugFormat( 2516 m_log.DebugFormat(
2515 "[SCENE]: Adding new child scene presence {0} to scene {1}", client.Name, RegionInfo.RegionName); 2517 "[SCENE]: Adding new child scene presence {0} to scene {1} at pos {2}", client.Name, RegionInfo.RegionName, client.StartPos);
2516 2518
2517 m_clientManager.Add(client); 2519 m_clientManager.Add(client);
2518 SubscribeToClientEvents(client); 2520 SubscribeToClientEvents(client);
@@ -2733,6 +2735,7 @@ namespace OpenSim.Region.Framework.Scenes
2733 client.OnObjectDescription += m_sceneGraph.PrimDescription; 2735 client.OnObjectDescription += m_sceneGraph.PrimDescription;
2734 client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; 2736 client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable;
2735 client.OnObjectOwner += ObjectOwner; 2737 client.OnObjectOwner += ObjectOwner;
2738 client.OnObjectGroupRequest += HandleObjectGroupUpdate;
2736 } 2739 }
2737 2740
2738 public virtual void SubscribeToClientPrimRezEvents(IClientAPI client) 2741 public virtual void SubscribeToClientPrimRezEvents(IClientAPI client)
@@ -2776,7 +2779,6 @@ namespace OpenSim.Region.Framework.Scenes
2776 2779
2777 public virtual void SubscribeToClientParcelEvents(IClientAPI client) 2780 public virtual void SubscribeToClientParcelEvents(IClientAPI client)
2778 { 2781 {
2779 client.OnObjectGroupRequest += m_sceneGraph.HandleObjectGroupUpdate;
2780 client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; 2782 client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
2781 client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime; 2783 client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime;
2782 client.OnParcelBuy += ProcessParcelBuy; 2784 client.OnParcelBuy += ProcessParcelBuy;
@@ -2903,7 +2905,6 @@ namespace OpenSim.Region.Framework.Scenes
2903 2905
2904 public virtual void UnSubscribeToClientParcelEvents(IClientAPI client) 2906 public virtual void UnSubscribeToClientParcelEvents(IClientAPI client)
2905 { 2907 {
2906 client.OnObjectGroupRequest -= m_sceneGraph.HandleObjectGroupUpdate;
2907 client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel; 2908 client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel;
2908 client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime; 2909 client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime;
2909 client.OnParcelBuy -= ProcessParcelBuy; 2910 client.OnParcelBuy -= ProcessParcelBuy;
@@ -3249,9 +3250,9 @@ namespace OpenSim.Region.Framework.Scenes
3249 3250
3250 // Don't disable this log message - it's too helpful 3251 // Don't disable this log message - it's too helpful
3251 m_log.DebugFormat( 3252 m_log.DebugFormat(
3252 "[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6})", 3253 "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6}, position {7})",
3253 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, 3254 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
3254 agent.AgentID, agent.circuitcode, teleportFlags); 3255 agent.AgentID, agent.circuitcode, teleportFlags, agent.startpos);
3255 3256
3256 if (LoginsDisabled) 3257 if (LoginsDisabled)
3257 { 3258 {
@@ -3294,7 +3295,7 @@ namespace OpenSim.Region.Framework.Scenes
3294 catch (Exception e) 3295 catch (Exception e)
3295 { 3296 {
3296 m_log.ErrorFormat( 3297 m_log.ErrorFormat(
3297 "[CONNECTION BEGIN]: Exception verifying presence {0}{1}", e.Message, e.StackTrace); 3298 "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace);
3298 return false; 3299 return false;
3299 } 3300 }
3300 } 3301 }
@@ -3307,12 +3308,12 @@ namespace OpenSim.Region.Framework.Scenes
3307 catch (Exception e) 3308 catch (Exception e)
3308 { 3309 {
3309 m_log.ErrorFormat( 3310 m_log.ErrorFormat(
3310 "[CONNECTION BEGIN]: Exception authorizing user {0}{1}", e.Message, e.StackTrace); 3311 "[SCENE]: Exception authorizing user {0}{1}", e.Message, e.StackTrace);
3311 return false; 3312 return false;
3312 } 3313 }
3313 3314
3314 m_log.InfoFormat( 3315 m_log.InfoFormat(
3315 "[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", 3316 "[SCENE]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})",
3316 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, 3317 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
3317 agent.AgentID, agent.circuitcode); 3318 agent.AgentID, agent.circuitcode);
3318 3319
@@ -3522,15 +3523,11 @@ namespace OpenSim.Region.Framework.Scenes
3522 m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); 3523 m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!");
3523 } 3524 }
3524 3525
3525 IGroupsModule groupsModule =
3526 RequestModuleInterface<IGroupsModule>();
3527
3528 List<UUID> agentGroups = new List<UUID>(); 3526 List<UUID> agentGroups = new List<UUID>();
3529 3527
3530 if (groupsModule != null) 3528 if (m_groupsModule != null)
3531 { 3529 {
3532 GroupMembershipData[] GroupMembership = 3530 GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID);
3533 groupsModule.GetMembershipData(agent.AgentID);
3534 3531
3535 if (GroupMembership != null) 3532 if (GroupMembership != null)
3536 { 3533 {
@@ -4287,7 +4284,7 @@ namespace OpenSim.Region.Framework.Scenes
4287 /// Get a scene object group that contains the prim with the given local id 4284 /// Get a scene object group that contains the prim with the given local id
4288 /// </summary> 4285 /// </summary>
4289 /// <param name="localID"></param> 4286 /// <param name="localID"></param>
4290 /// <returns>null if no scene object group containing that prim is found</returns> 4287 /// <returns>null if no scene object group containing that prim is found</returns>
4291 public SceneObjectGroup GetGroupByPrim(uint localID) 4288 public SceneObjectGroup GetGroupByPrim(uint localID)
4292 { 4289 {
4293 return m_sceneGraph.GetGroupByPrim(localID); 4290 return m_sceneGraph.GetGroupByPrim(localID);
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index d76ed3e..58a7b20 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -204,13 +204,10 @@ namespace OpenSim.Region.Framework.Scenes
204 /// <param name="regionslst"></param> 204 /// <param name="regionslst"></param>
205 public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst) 205 public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst)
206 { 206 {
207 Util.FireAndForget(delegate 207 foreach (ulong handle in regionslst)
208 { 208 {
209 foreach (ulong handle in regionslst) 209 SendCloseChildAgent(agentID, handle);
210 { 210 }
211 SendCloseChildAgent(agentID, handle);
212 }
213 });
214 } 211 }
215 212
216 public List<GridRegion> RequestNamedRegions(string name, int maxNumber) 213 public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index af95c28..a3e4b46 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -575,20 +575,6 @@ namespace OpenSim.Region.Framework.Scenes
575 } 575 }
576 } 576 }
577 577
578 protected internal void HandleObjectGroupUpdate(
579 IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage)
580 {
581 if (!remoteClient.IsGroupMember(GroupID))
582 return;
583
584 SceneObjectGroup group = GetGroupByPrim(objectLocalID);
585 if (group != null)
586 {
587 if (group.OwnerID == remoteClient.AgentId)
588 group.SetGroup(GroupID, remoteClient);
589 }
590 }
591
592 protected internal ScenePresence CreateAndAddChildScenePresence( 578 protected internal ScenePresence CreateAndAddChildScenePresence(
593 IClientAPI client, AvatarAppearance appearance, PresenceType type) 579 IClientAPI client, AvatarAppearance appearance, PresenceType type)
594 { 580 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f9e0b83..abea788 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1373,19 +1373,23 @@ namespace OpenSim.Region.Framework.Scenes
1373 1373
1374 #endregion 1374 #endregion
1375 1375
1376 // Send the parts of this SOG to a single client 1376 /// <summary>
1377 // Used when the client initially connects and when client sends RequestPrim packet 1377 /// Send the parts of this SOG to a single client
1378 /// </summary>
1379 /// <remarks>
1380 /// Used when the client initially connects and when client sends RequestPrim packet
1381 /// </remarks>
1382 /// <param name="remoteClient"></param>
1378 public void SendFullUpdateToClient(IClientAPI remoteClient) 1383 public void SendFullUpdateToClient(IClientAPI remoteClient)
1379 { 1384 {
1380 RootPart.SendFullUpdate( 1385 RootPart.SendFullUpdate(remoteClient);
1381 remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
1382 1386
1383 SceneObjectPart[] parts = m_parts.GetArray(); 1387 SceneObjectPart[] parts = m_parts.GetArray();
1384 for (int i = 0; i < parts.Length; i++) 1388 for (int i = 0; i < parts.Length; i++)
1385 { 1389 {
1386 SceneObjectPart part = parts[i]; 1390 SceneObjectPart part = parts[i];
1387 if (part != RootPart) 1391 if (part != RootPart)
1388 part.SendFullUpdate(remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); 1392 part.SendFullUpdate(remoteClient);
1389 } 1393 }
1390 } 1394 }
1391 1395
@@ -1679,10 +1683,11 @@ namespace OpenSim.Region.Framework.Scenes
1679 1683
1680 /// <summary> 1684 /// <summary>
1681 /// Reset the UUIDs for all the prims that make up this group. 1685 /// Reset the UUIDs for all the prims that make up this group.
1682 /// 1686 /// </summary>
1687 /// <remarks>
1683 /// This is called by methods which want to add a new group to an existing scene, in order 1688 /// This is called by methods which want to add a new group to an existing scene, in order
1684 /// to ensure that there are no clashes with groups already present. 1689 /// to ensure that there are no clashes with groups already present.
1685 /// </summary> 1690 /// </remarks>
1686 public void ResetIDs() 1691 public void ResetIDs()
1687 { 1692 {
1688 lock (m_parts.SyncRoot) 1693 lock (m_parts.SyncRoot)
@@ -3206,6 +3211,8 @@ namespace OpenSim.Region.Framework.Scenes
3206 part.Inventory.ChangeInventoryGroup(GroupID); 3211 part.Inventory.ChangeInventoryGroup(GroupID);
3207 } 3212 }
3208 3213
3214 HasGroupChanged = true;
3215
3209 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled 3216 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
3210 // for the same object with very different properties. The caller must schedule the update. 3217 // for the same object with very different properties. The caller must schedule the update.
3211 //ScheduleGroupForFullUpdate(); 3218 //ScheduleGroupForFullUpdate();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index f5a00d7..b29ecc6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2836,8 +2836,7 @@ namespace OpenSim.Region.Framework.Scenes
2836 /// Send a full update to the client for the given part 2836 /// Send a full update to the client for the given part
2837 /// </summary> 2837 /// </summary>
2838 /// <param name="remoteClient"></param> 2838 /// <param name="remoteClient"></param>
2839 /// <param name="clientFlags"></param> 2839 protected internal void SendFullUpdate(IClientAPI remoteClient)
2840 protected internal void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
2841 { 2840 {
2842 if (ParentGroup == null) 2841 if (ParentGroup == null)
2843 return; 2842 return;
@@ -2849,16 +2848,16 @@ namespace OpenSim.Region.Framework.Scenes
2849 { 2848 {
2850 if (ParentGroup.IsAttachment) 2849 if (ParentGroup.IsAttachment)
2851 { 2850 {
2852 SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags); 2851 SendFullUpdateToClient(remoteClient, AttachedPos);
2853 } 2852 }
2854 else 2853 else
2855 { 2854 {
2856 SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags); 2855 SendFullUpdateToClient(remoteClient, AbsolutePosition);
2857 } 2856 }
2858 } 2857 }
2859 else 2858 else
2860 { 2859 {
2861 SendFullUpdateToClient(remoteClient, clientFlags); 2860 SendFullUpdateToClient(remoteClient);
2862 } 2861 }
2863 } 2862 }
2864 2863
@@ -2872,7 +2871,7 @@ namespace OpenSim.Region.Framework.Scenes
2872 2871
2873 ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) 2872 ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
2874 { 2873 {
2875 SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); 2874 SendFullUpdate(avatar.ControllingClient);
2876 }); 2875 });
2877 } 2876 }
2878 2877
@@ -2880,12 +2879,9 @@ namespace OpenSim.Region.Framework.Scenes
2880 /// Sends a full update to the client 2879 /// Sends a full update to the client
2881 /// </summary> 2880 /// </summary>
2882 /// <param name="remoteClient"></param> 2881 /// <param name="remoteClient"></param>
2883 /// <param name="clientFlags"></param> 2882 public void SendFullUpdateToClient(IClientAPI remoteClient)
2884 public void SendFullUpdateToClient(IClientAPI remoteClient, uint clientflags)
2885 { 2883 {
2886 Vector3 lPos; 2884 SendFullUpdateToClient(remoteClient, OffsetPosition);
2887 lPos = OffsetPosition;
2888 SendFullUpdateToClient(remoteClient, lPos, clientflags);
2889 } 2885 }
2890 2886
2891 /// <summary> 2887 /// <summary>
@@ -2893,8 +2889,7 @@ namespace OpenSim.Region.Framework.Scenes
2893 /// </summary> 2889 /// </summary>
2894 /// <param name="remoteClient"></param> 2890 /// <param name="remoteClient"></param>
2895 /// <param name="lPos"></param> 2891 /// <param name="lPos"></param>
2896 /// <param name="clientFlags"></param> 2892 public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos)
2897 public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos, uint clientFlags)
2898 { 2893 {
2899 if (ParentGroup == null) 2894 if (ParentGroup == null)
2900 return; 2895 return;
@@ -2911,15 +2906,10 @@ namespace OpenSim.Region.Framework.Scenes
2911 (ParentGroup.AttachmentPoint >= 31) && (ParentGroup.AttachmentPoint <= 38)) 2906 (ParentGroup.AttachmentPoint >= 31) && (ParentGroup.AttachmentPoint <= 38))
2912 return; 2907 return;
2913 2908
2914 clientFlags &= ~(uint) PrimFlags.CreateSelected;
2915
2916 if (remoteClient.AgentId == OwnerID) 2909 if (remoteClient.AgentId == OwnerID)
2917 { 2910 {
2918 if ((Flags & PrimFlags.CreateSelected) != 0) 2911 if ((Flags & PrimFlags.CreateSelected) != 0)
2919 {
2920 clientFlags |= (uint) PrimFlags.CreateSelected;
2921 Flags &= ~PrimFlags.CreateSelected; 2912 Flags &= ~PrimFlags.CreateSelected;
2922 }
2923 } 2913 }
2924 //bool isattachment = IsAttachment; 2914 //bool isattachment = IsAttachment;
2925 //if (LocalId != ParentGroup.RootPart.LocalId) 2915 //if (LocalId != ParentGroup.RootPart.LocalId)
@@ -3354,6 +3344,11 @@ namespace OpenSim.Region.Framework.Scenes
3354 3344
3355 public void SetGroup(UUID groupID, IClientAPI client) 3345 public void SetGroup(UUID groupID, IClientAPI client)
3356 { 3346 {
3347 // Scene.AddNewPrims() calls with client == null so can't use this.
3348// m_log.DebugFormat(
3349// "[SCENE OBJECT PART]: Setting group for {0} to {1} for {2}",
3350// Name, groupID, OwnerID);
3351
3357 GroupID = groupID; 3352 GroupID = groupID;
3358 if (client != null) 3353 if (client != null)
3359 SendPropertiesToClient(client); 3354 SendPropertiesToClient(client);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index beff239..b8ae553 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -285,16 +285,10 @@ namespace OpenSim.Region.Framework.Scenes
285 285
286 #region Properties 286 #region Properties
287 287
288 protected PhysicsActor m_physicsActor;
289
290 /// <summary> 288 /// <summary>
291 /// Physical scene representation of this Avatar. 289 /// Physical scene representation of this Avatar.
292 /// </summary> 290 /// </summary>
293 public PhysicsActor PhysicsActor 291 public PhysicsActor PhysicsActor { get; private set; }
294 {
295 set { m_physicsActor = value; }
296 get { return m_physicsActor; }
297 }
298 292
299 private byte m_movementflag; 293 private byte m_movementflag;
300 294
@@ -508,9 +502,9 @@ namespace OpenSim.Region.Framework.Scenes
508 { 502 {
509 m_pos = PhysicsActor.Position; 503 m_pos = PhysicsActor.Position;
510 504
511// m_log.DebugFormat( 505 //m_log.DebugFormat(
512// "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!", 506 // "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!",
513// m_pos, Name, Scene.RegionInfo.RegionName); 507 // m_pos, Name, Scene.RegionInfo.RegionName);
514 } 508 }
515 else 509 else
516 { 510 {
@@ -540,7 +534,6 @@ namespace OpenSim.Region.Framework.Scenes
540 } 534 }
541 } 535 }
542 } 536 }
543
544 return m_pos; 537 return m_pos;
545 } 538 }
546 set 539 set
@@ -560,9 +553,9 @@ namespace OpenSim.Region.Framework.Scenes
560 m_pos = value; 553 m_pos = value;
561 ParentPosition = Vector3.Zero; 554 ParentPosition = Vector3.Zero;
562 555
563// m_log.DebugFormat( 556 //m_log.DebugFormat(
564// "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", 557 // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}",
565// Scene.RegionInfo.RegionName, Name, m_pos); 558 // Scene.RegionInfo.RegionName, Name, m_pos);
566 } 559 }
567 } 560 }
568 561
@@ -791,7 +784,6 @@ namespace OpenSim.Region.Framework.Scenes
791 public void RegisterToEvents() 784 public void RegisterToEvents()
792 { 785 {
793 ControllingClient.OnCompleteMovementToRegion += CompleteMovement; 786 ControllingClient.OnCompleteMovementToRegion += CompleteMovement;
794 //ControllingClient.OnCompleteMovementToRegion += SendInitialData;
795 ControllingClient.OnAgentUpdate += HandleAgentUpdate; 787 ControllingClient.OnAgentUpdate += HandleAgentUpdate;
796 ControllingClient.OnAgentRequestSit += HandleAgentRequestSit; 788 ControllingClient.OnAgentRequestSit += HandleAgentRequestSit;
797 ControllingClient.OnAgentSit += HandleAgentSit; 789 ControllingClient.OnAgentSit += HandleAgentSit;
@@ -839,11 +831,6 @@ namespace OpenSim.Region.Framework.Scenes
839 831
840 #endregion 832 #endregion
841 833
842 public uint GenerateClientFlags(UUID ObjectID)
843 {
844 return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID);
845 }
846
847 #region Status Methods 834 #region Status Methods
848 835
849 /// <summary> 836 /// <summary>
@@ -1032,18 +1019,19 @@ namespace OpenSim.Region.Framework.Scenes
1032 { 1019 {
1033 if (PhysicsActor != null) 1020 if (PhysicsActor != null)
1034 { 1021 {
1035 try 1022// PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients;
1036 { 1023 PhysicsActor.OnOutOfBounds -= OutOfBoundsCall;
1037 PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; 1024 m_scene.PhysicsScene.RemoveAvatar(PhysicsActor);
1038 PhysicsActor.OnOutOfBounds -= OutOfBoundsCall; 1025 PhysicsActor.UnSubscribeEvents();
1039 m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); 1026 PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
1040 PhysicsActor.UnSubscribeEvents(); 1027 PhysicsActor = null;
1041 PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
1042 PhysicsActor = null;
1043 }
1044 catch
1045 { }
1046 } 1028 }
1029// else
1030// {
1031// m_log.ErrorFormat(
1032// "[SCENE PRESENCE]: Attempt to remove physics actor for {0} on {1} but this scene presence has no physics actor",
1033// Name, Scene.RegionInfo.RegionName);
1034// }
1047 } 1035 }
1048 1036
1049 /// <summary> 1037 /// <summary>
@@ -1154,13 +1142,11 @@ namespace OpenSim.Region.Framework.Scenes
1154 /// <summary> 1142 /// <summary>
1155 /// Sets avatar height in the physics plugin 1143 /// Sets avatar height in the physics plugin
1156 /// </summary> 1144 /// </summary>
1145 /// <param name="height">New height of avatar</param>
1157 public void SetHeight(float height) 1146 public void SetHeight(float height)
1158 { 1147 {
1159 if (PhysicsActor != null && !IsChildAgent) 1148 if (PhysicsActor != null && !IsChildAgent)
1160 { 1149 PhysicsActor.Size = new Vector3(0.45f, 0.6f, height);
1161 Vector3 SetSize = new Vector3(0.45f, 0.6f, height);
1162 PhysicsActor.Size = SetSize;
1163 }
1164 } 1150 }
1165 1151
1166 /// <summary> 1152 /// <summary>
@@ -1925,7 +1911,7 @@ namespace OpenSim.Region.Framework.Scenes
1925// m_log.DebugFormat("[SCENE PRESENCE]: {0} {1}", SitTargetisSet, SitTargetUnOccupied); 1911// m_log.DebugFormat("[SCENE PRESENCE]: {0} {1}", SitTargetisSet, SitTargetUnOccupied);
1926 1912
1927 if (PhysicsActor != null) 1913 if (PhysicsActor != null)
1928 m_sitAvatarHeight = m_physicsActor.Size.Z; 1914 m_sitAvatarHeight = PhysicsActor.Size.Z;
1929 1915
1930 bool canSit = false; 1916 bool canSit = false;
1931 pos = part.AbsolutePosition + offset; 1917 pos = part.AbsolutePosition + offset;
@@ -2570,7 +2556,10 @@ namespace OpenSim.Region.Framework.Scenes
2570 // only send update from root agents to other clients; children are only "listening posts" 2556 // only send update from root agents to other clients; children are only "listening posts"
2571 if (IsChildAgent) 2557 if (IsChildAgent)
2572 { 2558 {
2573 m_log.Warn("[SCENE PRESENCE]: Attempt to send avatar data from a child agent"); 2559 m_log.WarnFormat(
2560 "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}",
2561 Name, Scene.RegionInfo.RegionName);
2562
2574 return; 2563 return;
2575 } 2564 }
2576 2565
@@ -2628,7 +2617,10 @@ namespace OpenSim.Region.Framework.Scenes
2628 // only send update from root agents to other clients; children are only "listening posts" 2617 // only send update from root agents to other clients; children are only "listening posts"
2629 if (IsChildAgent) 2618 if (IsChildAgent)
2630 { 2619 {
2631 m_log.Warn("[SCENE PRESENCE]: Attempt to send avatar data from a child agent"); 2620 m_log.WarnFormat(
2621 "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}",
2622 Name, Scene.RegionInfo.RegionName);
2623
2632 return; 2624 return;
2633 } 2625 }
2634 2626
@@ -2675,7 +2667,7 @@ namespace OpenSim.Region.Framework.Scenes
2675 public void SendAppearanceToAgent(ScenePresence avatar) 2667 public void SendAppearanceToAgent(ScenePresence avatar)
2676 { 2668 {
2677// m_log.DebugFormat( 2669// m_log.DebugFormat(
2678// "[SCENE PRESENCE] Send appearance from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); 2670// "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID);
2679 2671
2680 avatar.ControllingClient.SendAppearance( 2672 avatar.ControllingClient.SendAppearance(
2681 UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); 2673 UUID, Appearance.VisualParams, Appearance.Texture.GetBytes());
@@ -2957,7 +2949,10 @@ namespace OpenSim.Region.Framework.Scenes
2957 if (byebyeRegions.Count > 0) 2949 if (byebyeRegions.Count > 0)
2958 { 2950 {
2959 m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents"); 2951 m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents");
2960 m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, byebyeRegions); 2952 Util.FireAndForget(delegate
2953 {
2954 m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, byebyeRegions);
2955 });
2961 } 2956 }
2962 2957
2963 foreach (ulong handle in byebyeRegions) 2958 foreach (ulong handle in byebyeRegions)
@@ -3007,6 +3002,7 @@ namespace OpenSim.Region.Framework.Scenes
3007 CopyFrom(cAgentData); 3002 CopyFrom(cAgentData);
3008 } 3003 }
3009 3004
3005 private static Vector3 marker = new Vector3(-1f, -1f, -1f);
3010 /// <summary> 3006 /// <summary>
3011 /// This updates important decision making data about a child agent 3007 /// This updates important decision making data about a child agent
3012 /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region 3008 /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region
@@ -3027,8 +3023,8 @@ namespace OpenSim.Region.Framework.Scenes
3027 // region's draw distance. 3023 // region's draw distance.
3028 // DrawDistance = cAgentData.Far; 3024 // DrawDistance = cAgentData.Far;
3029 DrawDistance = Scene.DefaultDrawDistance; 3025 DrawDistance = Scene.DefaultDrawDistance;
3030 3026
3031 if (cAgentData.Position != new Vector3(-1f, -1f, -1f)) // UGH!! 3027 if (cAgentData.Position != marker) // UGH!!
3032 m_pos = cAgentData.Position + offset; 3028 m_pos = cAgentData.Position + offset;
3033 3029
3034 if (Vector3.Distance(AbsolutePosition, posLastSignificantMove) >= Scene.ChildReprioritizationDistance) 3030 if (Vector3.Distance(AbsolutePosition, posLastSignificantMove) >= Scene.ChildReprioritizationDistance)
@@ -3039,8 +3035,6 @@ namespace OpenSim.Region.Framework.Scenes
3039 3035
3040 CameraPosition = cAgentData.Center + offset; 3036 CameraPosition = cAgentData.Center + offset;
3041 3037
3042 //SetHeight(cAgentData.AVHeight);
3043
3044 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) 3038 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0)
3045 ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); 3039 ControllingClient.SetChildAgentThrottle(cAgentData.Throttles);
3046 3040
@@ -3251,6 +3245,13 @@ namespace OpenSim.Region.Framework.Scenes
3251// "[SCENE PRESENCE]: Adding physics actor for {0}, ifFlying = {1} in {2}", 3245// "[SCENE PRESENCE]: Adding physics actor for {0}, ifFlying = {1} in {2}",
3252// Name, isFlying, Scene.RegionInfo.RegionName); 3246// Name, isFlying, Scene.RegionInfo.RegionName);
3253 3247
3248 if (PhysicsActor != null)
3249 {
3250 m_log.ErrorFormat(
3251 "[SCENE PRESENCE]: Adding physics actor for {0} to {1} but this scene presence already has a physics actor",
3252 Name, Scene.RegionInfo.RegionName);
3253 }
3254
3254 if (Appearance.AvatarHeight == 0) 3255 if (Appearance.AvatarHeight == 0)
3255 Appearance.SetHeight(); 3256 Appearance.SetHeight();
3256 3257
@@ -3258,18 +3259,15 @@ namespace OpenSim.Region.Framework.Scenes
3258 3259
3259 Vector3 pVec = AbsolutePosition; 3260 Vector3 pVec = AbsolutePosition;
3260 3261
3261 // Old bug where the height was in centimeters instead of meters 3262 PhysicsActor = scene.AddAvatar(
3262 PhysicsActor = scene.AddAvatar(LocalId, Firstname + "." + Lastname, pVec, 3263 LocalId, Firstname + "." + Lastname, pVec,
3263 new Vector3(0f, 0f, Appearance.AvatarHeight), isFlying); 3264 new Vector3(0f, 0f, Appearance.AvatarHeight), isFlying);
3264 3265
3265 scene.AddPhysicsActorTaint(PhysicsActor);
3266 //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; 3266 //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
3267 PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; 3267 PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
3268 PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong 3268 PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong
3269 PhysicsActor.SubscribeEvents(500); 3269 PhysicsActor.SubscribeEvents(500);
3270 PhysicsActor.LocalID = LocalId; 3270 PhysicsActor.LocalID = LocalId;
3271
3272 SetHeight(Appearance.AvatarHeight);
3273 } 3271 }
3274 3272
3275 private void OutOfBoundsCall(Vector3 pos) 3273 private void OutOfBoundsCall(Vector3 pos)