aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2011-12-18 10:49:45 +0000
committerMelanie2011-12-18 10:49:45 +0000
commit759f1d2dbe0617786068195dfd695e0dfc2cc265 (patch)
tree8e6dcb6ba183abb16b4527376c5fd280693977bb /OpenSim
parentMake raycast more efficient by checking exclusion flags earlier (diff)
parentProvide user feedback on execution of "backup" region console command (diff)
downloadopensim-SC-759f1d2dbe0617786068195dfd695e0dfc2cc265.zip
opensim-SC-759f1d2dbe0617786068195dfd695e0dfc2cc265.tar.gz
opensim-SC-759f1d2dbe0617786068195dfd695e0dfc2cc265.tar.bz2
opensim-SC-759f1d2dbe0617786068195dfd695e0dfc2cc265.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/ISceneEntity.cs1
-rw-r--r--OpenSim/Framework/ISceneObject.cs6
-rw-r--r--OpenSim/Region/Application/OpenSim.cs27
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs1
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs209
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs16
-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.cs91
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs41
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs12
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs3
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs47
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs27
-rw-r--r--OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs2
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs1
23 files changed, 297 insertions, 292 deletions
diff --git a/OpenSim/Framework/ISceneEntity.cs b/OpenSim/Framework/ISceneEntity.cs
index c0ea302..a9f21d2 100644
--- a/OpenSim/Framework/ISceneEntity.cs
+++ b/OpenSim/Framework/ISceneEntity.cs
@@ -34,6 +34,7 @@ namespace OpenSim.Framework
34 string Name { get; set; } 34 string Name { get; set; }
35 UUID UUID { get; } 35 UUID UUID { get; }
36 uint LocalId { get; } 36 uint LocalId { get; }
37
37 Vector3 AbsolutePosition { get; } 38 Vector3 AbsolutePosition { get; }
38 } 39 }
39} 40}
diff --git a/OpenSim/Framework/ISceneObject.cs b/OpenSim/Framework/ISceneObject.cs
index 18631f1..afac9b8 100644
--- a/OpenSim/Framework/ISceneObject.cs
+++ b/OpenSim/Framework/ISceneObject.cs
@@ -33,6 +33,12 @@ namespace OpenSim.Framework
33 public interface ISceneObject 33 public interface ISceneObject
34 { 34 {
35 UUID UUID { get; } 35 UUID UUID { get; }
36
37 /// <summary>
38 /// The owner of this object.
39 /// </summary>
40 UUID OwnerID { get; set; }
41
36 ISceneObject CloneForNewScene(); 42 ISceneObject CloneForNewScene();
37 string ToXml2(); 43 string ToXml2();
38 string ExtraToXmlString(); 44 string ExtraToXmlString();
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index df4dbee..a1bdfb9 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -188,6 +188,18 @@ namespace OpenSim
188 } 188 }
189 } 189 }
190 190
191 // Hook up to the watchdog timer
192 Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler;
193
194 PrintFileToConsole("startuplogo.txt");
195
196 // For now, start at the 'root' level by default
197 if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
198 ChangeSelectedRegion("region",
199 new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName});
200 else
201 ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
202
191 //Run Startup Commands 203 //Run Startup Commands
192 if (String.IsNullOrEmpty(m_startupCommandsFile)) 204 if (String.IsNullOrEmpty(m_startupCommandsFile))
193 { 205 {
@@ -206,18 +218,6 @@ namespace OpenSim
206 m_scriptTimer.Interval = 1200*1000; 218 m_scriptTimer.Interval = 1200*1000;
207 m_scriptTimer.Elapsed += RunAutoTimerScript; 219 m_scriptTimer.Elapsed += RunAutoTimerScript;
208 } 220 }
209
210 // Hook up to the watchdog timer
211 Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler;
212
213 PrintFileToConsole("startuplogo.txt");
214
215 // For now, start at the 'root' level by default
216 if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
217 ChangeSelectedRegion("region",
218 new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName});
219 else
220 ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
221 } 221 }
222 222
223 /// <summary> 223 /// <summary>
@@ -796,6 +796,7 @@ namespace OpenSim
796 break; 796 break;
797 797
798 case "backup": 798 case "backup":
799 MainConsole.Instance.Output("Triggering save of pending object updates to persistent store");
799 m_sceneManager.BackupCurrentScene(); 800 m_sceneManager.BackupCurrentScene();
800 break; 801 break;
801 802
@@ -806,7 +807,7 @@ namespace OpenSim
806 if (m_sceneManager.TryGetScene(regRemoveName, out removeScene)) 807 if (m_sceneManager.TryGetScene(regRemoveName, out removeScene))
807 RemoveRegion(removeScene, false); 808 RemoveRegion(removeScene, false);
808 else 809 else
809 MainConsole.Instance.Output("no region with that name"); 810 MainConsole.Instance.Output("No region with that name");
810 break; 811 break;
811 812
812 case "delete-region": 813 case "delete-region":
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 30f4495..6648a60 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -10464,6 +10464,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10464 } 10464 }
10465 return true; 10465 return true;
10466 } 10466 }
10467
10467 private bool HandleGroupRoleMembersRequest(IClientAPI sender, Packet Pack) 10468 private bool HandleGroupRoleMembersRequest(IClientAPI sender, Packet Pack)
10468 { 10469 {
10469 GroupRoleMembersRequestPacket groupRoleMembersRequest = 10470 GroupRoleMembersRequestPacket groupRoleMembersRequest =
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 9875f56..810c3b4 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1236,7 +1236,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1236 AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); 1236 AgentCircuitData agent = sp.ControllingClient.RequestClientInfo();
1237 agent.BaseFolder = UUID.Zero; 1237 agent.BaseFolder = UUID.Zero;
1238 agent.InventoryFolder = UUID.Zero; 1238 agent.InventoryFolder = UUID.Zero;
1239 agent.startpos = new Vector3(128, 128, 70); 1239 agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour);
1240 agent.child = true; 1240 agent.child = true;
1241 agent.Appearance = sp.Appearance; 1241 agent.Appearance = sp.Appearance;
1242 if (currentAgentCircuit != null) 1242 if (currentAgentCircuit != null)
@@ -1329,6 +1329,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1329 } 1329 }
1330 } 1330 }
1331 1331
1332 Vector3 CalculateOffset(ScenePresence sp, GridRegion neighbour)
1333 {
1334 int rRegionX = (int)sp.Scene.RegionInfo.RegionLocX;
1335 int rRegionY = (int)sp.Scene.RegionInfo.RegionLocY;
1336 int tRegionX = neighbour.RegionLocX / (int)Constants.RegionSize;
1337 int tRegionY = neighbour.RegionLocY / (int)Constants.RegionSize;
1338 int shiftx = (rRegionX - tRegionX) * (int)Constants.RegionSize;
1339 int shifty = (rRegionY - tRegionY) * (int)Constants.RegionSize;
1340 return new Vector3(shiftx, shifty, 0f);
1341 }
1342
1332 private void InformClientOfNeighbourCompleted(IAsyncResult iar) 1343 private void InformClientOfNeighbourCompleted(IAsyncResult iar)
1333 { 1344 {
1334 InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState; 1345 InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 6daae62..37b36f6 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -123,7 +123,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
123 { 123 {
124 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); 124 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID);
125 GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID); 125 GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID);
126 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI); 126 if (real_destination != null)
127 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI);
128 else
129 m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI);
127 return real_destination; 130 return real_destination;
128 } 131 }
129 return region; 132 return region;
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index c1b8764..5e7d37a 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -384,9 +384,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions
384 if (m_debugPermissions) 384 if (m_debugPermissions)
385 m_log.Debug("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName); 385 m_log.Debug("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName);
386 } 386 }
387 387
388 // Checks if the given group is active and if the user is a group member 388 /// <summary>
389 // with the powers requested (powers = 0 for no powers check) 389 /// Checks if the given group is active and if the user is a group member
390 /// with the powers requested (powers = 0 for no powers check)
391 /// </summary>
392 /// <param name="groupID"></param>
393 /// <param name="userID"></param>
394 /// <param name="powers"></param>
395 /// <returns></returns>
390 protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers) 396 protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers)
391 { 397 {
392 if (null == m_groupsModule) 398 if (null == m_groupsModule)
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 547e693..209a0a6 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -1588,6 +1588,12 @@ namespace OpenSim.Region.Framework.Scenes
1588 1588
1589 public void TriggerRequestChangeWaterHeight(float height) 1589 public void TriggerRequestChangeWaterHeight(float height)
1590 { 1590 {
1591 if (height < 0)
1592 {
1593 // ignore negative water height
1594 return;
1595 }
1596
1591 RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; 1597 RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight;
1592 if (handlerRequestChangeWaterHeight != null) 1598 if (handlerRequestChangeWaterHeight != null)
1593 { 1599 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 59170df..fd179ba 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -116,18 +116,10 @@ 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 { 121 if (sog != null)
122 if (ent is SceneObjectGroup) 122 sog.SendFullUpdateToClient(remoteClient);
123 {
124 if (((SceneObjectGroup)ent).LocalId == primLocalID)
125 {
126 ((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient);
127 return;
128 }
129 }
130 }
131 } 123 }
132 124
133 /// <summary> 125 /// <summary>
@@ -137,47 +129,28 @@ namespace OpenSim.Region.Framework.Scenes
137 /// <param name="remoteClient"></param> 129 /// <param name="remoteClient"></param>
138 public void SelectPrim(uint primLocalID, IClientAPI remoteClient) 130 public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
139 { 131 {
140 EntityBase[] entityList = GetEntities(); 132 SceneObjectPart part = GetSceneObjectPart(primLocalID);
141 foreach (EntityBase ent in entityList) 133
134 if (null == part)
135 return;
136
137 if (part.IsRoot)
142 { 138 {
143 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))
144 { 146 {
145 if (((SceneObjectGroup) ent).LocalId == primLocalID) 147 EventManager.TriggerParcelPrimCountTainted();
146 {
147 ((SceneObjectGroup) ent).SendPropertiesToClient(remoteClient);
148 ((SceneObjectGroup) ent).IsSelected = true;
149 // A prim is only tainted if it's allowed to be edited by the person clicking it.
150 if (Permissions.CanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)
151 || Permissions.CanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
152 {
153 EventManager.TriggerParcelPrimCountTainted();
154 }
155 break;
156 }
157 else
158 {
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 } 148 }
180 } 149 }
150 else
151 {
152 part.SendPropertiesToClient(remoteClient);
153 }
181 } 154 }
182 155
183 /// <summary> 156 /// <summary>
@@ -250,121 +223,81 @@ namespace OpenSim.Region.Framework.Scenes
250 223
251 public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) 224 public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
252 { 225 {
253 EntityBase[] EntityList = GetEntities(); 226 SceneObjectPart part = GetSceneObjectPart(localID);
227
228 if (part == null)
229 return;
230
231 SceneObjectGroup obj = part.ParentGroup;
254 232
255 SurfaceTouchEventArgs surfaceArg = null; 233 SurfaceTouchEventArgs surfaceArg = null;
256 if (surfaceArgs != null && surfaceArgs.Count > 0) 234 if (surfaceArgs != null && surfaceArgs.Count > 0)
257 surfaceArg = surfaceArgs[0]; 235 surfaceArg = surfaceArgs[0];
258 236
259 foreach (EntityBase ent in EntityList) 237 // Currently only grab/touch for the single prim
238 // the client handles rez correctly
239 obj.ObjectGrabHandler(localID, offsetPos, remoteClient);
240
241 // If the touched prim handles touches, deliver it
242 // If not, deliver to root prim
243 if ((part.ScriptEvents & scriptEvents.touch_start) != 0)
244 EventManager.TriggerObjectGrab(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg);
245
246 // Deliver to the root prim if the touched prim doesn't handle touches
247 // or if we're meant to pass on touches anyway. Don't send to root prim
248 // if prim touched is the root prim as we just did it
249 if (((part.ScriptEvents & scriptEvents.touch_start) == 0) ||
250 (part.PassTouches && (part.LocalId != obj.RootPart.LocalId)))
260 { 251 {
261 if (ent is SceneObjectGroup) 252 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 } 253 }
293 } 254 }
294 255
295 public virtual void ProcessObjectGrabUpdate(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) 256 public virtual void ProcessObjectGrabUpdate(
257 UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
296 { 258 {
297 EntityBase[] EntityList = GetEntities(); 259 SceneObjectPart part = GetSceneObjectPart(objectID);
260 if (part == null)
261 return;
262
263 SceneObjectGroup obj = part.ParentGroup;
298 264
299 SurfaceTouchEventArgs surfaceArg = null; 265 SurfaceTouchEventArgs surfaceArg = null;
300 if (surfaceArgs != null && surfaceArgs.Count > 0) 266 if (surfaceArgs != null && surfaceArgs.Count > 0)
301 surfaceArg = surfaceArgs[0]; 267 surfaceArg = surfaceArgs[0];
302 268
303 foreach (EntityBase ent in EntityList) 269 // If the touched prim handles touches, deliver it
270 // If not, deliver to root prim
271 if ((part.ScriptEvents & scriptEvents.touch) != 0)
272 EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg);
273 // Deliver to the root prim if the touched prim doesn't handle touches
274 // or if we're meant to pass on touches anyway. Don't send to root prim
275 // if prim touched is the root prim as we just did it
276 if (((part.ScriptEvents & scriptEvents.touch) == 0) ||
277 (part.PassTouches && (part.LocalId != obj.RootPart.LocalId)))
304 { 278 {
305 if (ent is SceneObjectGroup) 279 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 } 280 }
333 } 281 }
334 282
335 public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) 283 public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
336 { 284 {
337 EntityBase[] EntityList = GetEntities(); 285 SceneObjectPart part = GetSceneObjectPart(localID);
286 if (part == null)
287 return;
288
289 SceneObjectGroup obj = part.ParentGroup;
338 290
339 SurfaceTouchEventArgs surfaceArg = null; 291 SurfaceTouchEventArgs surfaceArg = null;
340 if (surfaceArgs != null && surfaceArgs.Count > 0) 292 if (surfaceArgs != null && surfaceArgs.Count > 0)
341 surfaceArg = surfaceArgs[0]; 293 surfaceArg = surfaceArgs[0];
342 294
343 foreach (EntityBase ent in EntityList) 295 // If the touched prim handles touches, deliver it
344 { 296 // If not, deliver to root prim
345 if (ent is SceneObjectGroup) 297 if ((part.ScriptEvents & scriptEvents.touch_end) != 0)
346 { 298 EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg);
347 SceneObjectGroup obj = ent as SceneObjectGroup; 299 else
348 300 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 } 301 }
369 302
370 public void ProcessAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query) 303 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 bfabcc2..f8487e7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2636,7 +2636,7 @@ namespace OpenSim.Region.Framework.Scenes
2636 if (sp == null) 2636 if (sp == null)
2637 { 2637 {
2638 m_log.DebugFormat( 2638 m_log.DebugFormat(
2639 "[SCENE]: Adding new child scene presence {0} to scene {1}", client.Name, RegionInfo.RegionName); 2639 "[SCENE]: Adding new child scene presence {0} to scene {1} at pos {2}", client.Name, RegionInfo.RegionName, client.StartPos);
2640 2640
2641 m_clientManager.Add(client); 2641 m_clientManager.Add(client);
2642 SubscribeToClientEvents(client); 2642 SubscribeToClientEvents(client);
@@ -2900,7 +2900,6 @@ namespace OpenSim.Region.Framework.Scenes
2900 2900
2901 public virtual void SubscribeToClientParcelEvents(IClientAPI client) 2901 public virtual void SubscribeToClientParcelEvents(IClientAPI client)
2902 { 2902 {
2903 client.OnObjectGroupRequest += m_sceneGraph.HandleObjectGroupUpdate;
2904 client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; 2903 client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
2905 client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime; 2904 client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime;
2906 client.OnParcelBuy += ProcessParcelBuy; 2905 client.OnParcelBuy += ProcessParcelBuy;
@@ -3027,7 +3026,6 @@ namespace OpenSim.Region.Framework.Scenes
3027 3026
3028 public virtual void UnSubscribeToClientParcelEvents(IClientAPI client) 3027 public virtual void UnSubscribeToClientParcelEvents(IClientAPI client)
3029 { 3028 {
3030 client.OnObjectGroupRequest -= m_sceneGraph.HandleObjectGroupUpdate;
3031 client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel; 3029 client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel;
3032 client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime; 3030 client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime;
3033 client.OnParcelBuy -= ProcessParcelBuy; 3031 client.OnParcelBuy -= ProcessParcelBuy;
@@ -3386,9 +3384,9 @@ namespace OpenSim.Region.Framework.Scenes
3386 3384
3387 // Don't disable this log message - it's too helpful 3385 // Don't disable this log message - it's too helpful
3388 m_log.DebugFormat( 3386 m_log.DebugFormat(
3389 "[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6})", 3387 "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6}, position {7})",
3390 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, 3388 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
3391 agent.AgentID, agent.circuitcode, teleportFlags); 3389 agent.AgentID, agent.circuitcode, teleportFlags, agent.startpos);
3392 3390
3393 if (LoginsDisabled) 3391 if (LoginsDisabled)
3394 { 3392 {
@@ -3434,7 +3432,7 @@ namespace OpenSim.Region.Framework.Scenes
3434 catch (Exception e) 3432 catch (Exception e)
3435 { 3433 {
3436 m_log.ErrorFormat( 3434 m_log.ErrorFormat(
3437 "[CONNECTION BEGIN]: Exception verifying presence {0}{1}", e.Message, e.StackTrace); 3435 "[SCENE]: Exception verifying presence {0}{1}", e.Message, e.StackTrace);
3438 return false; 3436 return false;
3439 } 3437 }
3440 } 3438 }
@@ -3452,12 +3450,12 @@ namespace OpenSim.Region.Framework.Scenes
3452 catch (Exception e) 3450 catch (Exception e)
3453 { 3451 {
3454 m_log.ErrorFormat( 3452 m_log.ErrorFormat(
3455 "[CONNECTION BEGIN]: Exception authorizing user {0}{1}", e.Message, e.StackTrace); 3453 "[SCENE]: Exception authorizing user {0}{1}", e.Message, e.StackTrace);
3456 return false; 3454 return false;
3457 } 3455 }
3458 3456
3459 m_log.InfoFormat( 3457 m_log.InfoFormat(
3460 "[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})", 3458 "[SCENE]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})",
3461 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, 3459 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
3462 agent.AgentID, agent.circuitcode); 3460 agent.AgentID, agent.circuitcode);
3463 3461
@@ -4462,7 +4460,7 @@ namespace OpenSim.Region.Framework.Scenes
4462 /// Get a scene object group that contains the prim with the given local id 4460 /// Get a scene object group that contains the prim with the given local id
4463 /// </summary> 4461 /// </summary>
4464 /// <param name="localID"></param> 4462 /// <param name="localID"></param>
4465 /// <returns>null if no scene object group containing that prim is found</returns> 4463 /// <returns>null if no scene object group containing that prim is found</returns>
4466 public SceneObjectGroup GetGroupByPrim(uint localID) 4464 public SceneObjectGroup GetGroupByPrim(uint localID)
4467 { 4465 {
4468 return m_sceneGraph.GetGroupByPrim(localID); 4466 return m_sceneGraph.GetGroupByPrim(localID);
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index c16038c..cd825eb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -640,20 +640,6 @@ namespace OpenSim.Region.Framework.Scenes
640 } 640 }
641 } 641 }
642 642
643 protected internal void HandleObjectGroupUpdate(
644 IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage)
645 {
646 if (!remoteClient.IsGroupMember(GroupID))
647 return;
648
649 SceneObjectGroup group = GetGroupByPrim(objectLocalID);
650 if (group != null)
651 {
652 if (group.OwnerID == remoteClient.AgentId)
653 group.SetGroup(GroupID, remoteClient);
654 }
655 }
656
657 protected internal ScenePresence CreateAndAddChildScenePresence( 643 protected internal ScenePresence CreateAndAddChildScenePresence(
658 IClientAPI client, AvatarAppearance appearance, PresenceType type) 644 IClientAPI client, AvatarAppearance appearance, PresenceType type)
659 { 645 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 09cbbfe..948dca2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1724,19 +1724,23 @@ namespace OpenSim.Region.Framework.Scenes
1724 1724
1725 #endregion 1725 #endregion
1726 1726
1727 // Send the parts of this SOG to a single client 1727 /// <summary>
1728 // Used when the client initially connects and when client sends RequestPrim packet 1728 /// Send the parts of this SOG to a single client
1729 /// </summary>
1730 /// <remarks>
1731 /// Used when the client initially connects and when client sends RequestPrim packet
1732 /// </remarks>
1733 /// <param name="remoteClient"></param>
1729 public void SendFullUpdateToClient(IClientAPI remoteClient) 1734 public void SendFullUpdateToClient(IClientAPI remoteClient)
1730 { 1735 {
1731 RootPart.SendFullUpdate( 1736 RootPart.SendFullUpdate(remoteClient);
1732 remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
1733 1737
1734 SceneObjectPart[] parts = m_parts.GetArray(); 1738 SceneObjectPart[] parts = m_parts.GetArray();
1735 for (int i = 0; i < parts.Length; i++) 1739 for (int i = 0; i < parts.Length; i++)
1736 { 1740 {
1737 SceneObjectPart part = parts[i]; 1741 SceneObjectPart part = parts[i];
1738 if (part != RootPart) 1742 if (part != RootPart)
1739 part.SendFullUpdate(remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); 1743 part.SendFullUpdate(remoteClient);
1740 } 1744 }
1741 } 1745 }
1742 1746
@@ -2067,10 +2071,11 @@ namespace OpenSim.Region.Framework.Scenes
2067 2071
2068 /// <summary> 2072 /// <summary>
2069 /// Reset the UUIDs for all the prims that make up this group. 2073 /// Reset the UUIDs for all the prims that make up this group.
2070 /// 2074 /// </summary>
2075 /// <remarks>
2071 /// This is called by methods which want to add a new group to an existing scene, in order 2076 /// This is called by methods which want to add a new group to an existing scene, in order
2072 /// to ensure that there are no clashes with groups already present. 2077 /// to ensure that there are no clashes with groups already present.
2073 /// </summary> 2078 /// </remarks>
2074 public void ResetIDs() 2079 public void ResetIDs()
2075 { 2080 {
2076 lock (m_parts.SyncRoot) 2081 lock (m_parts.SyncRoot)
@@ -3636,6 +3641,8 @@ namespace OpenSim.Region.Framework.Scenes
3636 part.Inventory.ChangeInventoryGroup(GroupID); 3641 part.Inventory.ChangeInventoryGroup(GroupID);
3637 } 3642 }
3638 3643
3644 HasGroupChanged = true;
3645
3639 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled 3646 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
3640 // for the same object with very different properties. The caller must schedule the update. 3647 // for the same object with very different properties. The caller must schedule the update.
3641 //ScheduleGroupForFullUpdate(); 3648 //ScheduleGroupForFullUpdate();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 666ce2a..fd70bfd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2886,8 +2886,7 @@ namespace OpenSim.Region.Framework.Scenes
2886 /// Send a full update to the client for the given part 2886 /// Send a full update to the client for the given part
2887 /// </summary> 2887 /// </summary>
2888 /// <param name="remoteClient"></param> 2888 /// <param name="remoteClient"></param>
2889 /// <param name="clientFlags"></param> 2889 protected internal void SendFullUpdate(IClientAPI remoteClient)
2890 protected internal void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
2891 { 2890 {
2892 if (ParentGroup == null) 2891 if (ParentGroup == null)
2893 return; 2892 return;
@@ -2899,16 +2898,16 @@ namespace OpenSim.Region.Framework.Scenes
2899 { 2898 {
2900 if (ParentGroup.IsAttachment) 2899 if (ParentGroup.IsAttachment)
2901 { 2900 {
2902 SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags); 2901 SendFullUpdateToClient(remoteClient, AttachedPos);
2903 } 2902 }
2904 else 2903 else
2905 { 2904 {
2906 SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags); 2905 SendFullUpdateToClient(remoteClient, AbsolutePosition);
2907 } 2906 }
2908 } 2907 }
2909 else 2908 else
2910 { 2909 {
2911 SendFullUpdateToClient(remoteClient, clientFlags); 2910 SendFullUpdateToClient(remoteClient);
2912 } 2911 }
2913 } 2912 }
2914 2913
@@ -2922,7 +2921,7 @@ namespace OpenSim.Region.Framework.Scenes
2922 2921
2923 ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) 2922 ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
2924 { 2923 {
2925 SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); 2924 SendFullUpdate(avatar.ControllingClient);
2926 }); 2925 });
2927 } 2926 }
2928 2927
@@ -2930,12 +2929,9 @@ namespace OpenSim.Region.Framework.Scenes
2930 /// Sends a full update to the client 2929 /// Sends a full update to the client
2931 /// </summary> 2930 /// </summary>
2932 /// <param name="remoteClient"></param> 2931 /// <param name="remoteClient"></param>
2933 /// <param name="clientFlags"></param> 2932 public void SendFullUpdateToClient(IClientAPI remoteClient)
2934 public void SendFullUpdateToClient(IClientAPI remoteClient, uint clientflags)
2935 { 2933 {
2936 Vector3 lPos; 2934 SendFullUpdateToClient(remoteClient, OffsetPosition);
2937 lPos = OffsetPosition;
2938 SendFullUpdateToClient(remoteClient, lPos, clientflags);
2939 } 2935 }
2940 2936
2941 /// <summary> 2937 /// <summary>
@@ -2943,8 +2939,7 @@ namespace OpenSim.Region.Framework.Scenes
2943 /// </summary> 2939 /// </summary>
2944 /// <param name="remoteClient"></param> 2940 /// <param name="remoteClient"></param>
2945 /// <param name="lPos"></param> 2941 /// <param name="lPos"></param>
2946 /// <param name="clientFlags"></param> 2942 public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos)
2947 public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos, uint clientFlags)
2948 { 2943 {
2949 if (ParentGroup == null) 2944 if (ParentGroup == null)
2950 return; 2945 return;
@@ -2961,15 +2956,10 @@ namespace OpenSim.Region.Framework.Scenes
2961 (ParentGroup.AttachmentPoint >= 31) && (ParentGroup.AttachmentPoint <= 38)) 2956 (ParentGroup.AttachmentPoint >= 31) && (ParentGroup.AttachmentPoint <= 38))
2962 return; 2957 return;
2963 2958
2964 clientFlags &= ~(uint) PrimFlags.CreateSelected;
2965
2966 if (remoteClient.AgentId == OwnerID) 2959 if (remoteClient.AgentId == OwnerID)
2967 { 2960 {
2968 if ((Flags & PrimFlags.CreateSelected) != 0) 2961 if ((Flags & PrimFlags.CreateSelected) != 0)
2969 {
2970 clientFlags |= (uint) PrimFlags.CreateSelected;
2971 Flags &= ~PrimFlags.CreateSelected; 2962 Flags &= ~PrimFlags.CreateSelected;
2972 }
2973 } 2963 }
2974 //bool isattachment = IsAttachment; 2964 //bool isattachment = IsAttachment;
2975 //if (LocalId != ParentGroup.RootPart.LocalId) 2965 //if (LocalId != ParentGroup.RootPart.LocalId)
@@ -3403,6 +3393,11 @@ namespace OpenSim.Region.Framework.Scenes
3403 3393
3404 public void SetGroup(UUID groupID, IClientAPI client) 3394 public void SetGroup(UUID groupID, IClientAPI client)
3405 { 3395 {
3396 // Scene.AddNewPrims() calls with client == null so can't use this.
3397// m_log.DebugFormat(
3398// "[SCENE OBJECT PART]: Setting group for {0} to {1} for {2}",
3399// Name, groupID, OwnerID);
3400
3406 GroupID = groupID; 3401 GroupID = groupID;
3407 if (client != null) 3402 if (client != null)
3408 SendPropertiesToClient(client); 3403 SendPropertiesToClient(client);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 49acc02..0eecf77 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -289,16 +289,10 @@ namespace OpenSim.Region.Framework.Scenes
289 289
290 #region Properties 290 #region Properties
291 291
292 protected PhysicsActor m_physicsActor;
293
294 /// <summary> 292 /// <summary>
295 /// Physical scene representation of this Avatar. 293 /// Physical scene representation of this Avatar.
296 /// </summary> 294 /// </summary>
297 public PhysicsActor PhysicsActor 295 public PhysicsActor PhysicsActor { get; private set; }
298 {
299 set { m_physicsActor = value; }
300 get { return m_physicsActor; }
301 }
302 296
303 private byte m_movementflag; 297 private byte m_movementflag;
304 298
@@ -512,9 +506,9 @@ namespace OpenSim.Region.Framework.Scenes
512 { 506 {
513 m_pos = PhysicsActor.Position; 507 m_pos = PhysicsActor.Position;
514 508
515// m_log.DebugFormat( 509 //m_log.DebugFormat(
516// "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!", 510 // "[SCENE PRESENCE]: Set position {0} for {1} in {2} via getting AbsolutePosition!",
517// m_pos, Name, Scene.RegionInfo.RegionName); 511 // m_pos, Name, Scene.RegionInfo.RegionName);
518 } 512 }
519 else 513 else
520 { 514 {
@@ -544,7 +538,6 @@ namespace OpenSim.Region.Framework.Scenes
544 } 538 }
545 } 539 }
546 } 540 }
547
548 return m_pos; 541 return m_pos;
549 } 542 }
550 set 543 set
@@ -568,9 +561,9 @@ namespace OpenSim.Region.Framework.Scenes
568 ParentPosition = Vector3.Zero; 561 ParentPosition = Vector3.Zero;
569 } 562 }
570 563
571// m_log.DebugFormat( 564 //m_log.DebugFormat(
572// "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", 565 // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}",
573// Scene.RegionInfo.RegionName, Name, m_pos); 566 // Scene.RegionInfo.RegionName, Name, m_pos);
574 } 567 }
575 } 568 }
576 569
@@ -806,7 +799,6 @@ namespace OpenSim.Region.Framework.Scenes
806 public void RegisterToEvents() 799 public void RegisterToEvents()
807 { 800 {
808 ControllingClient.OnCompleteMovementToRegion += CompleteMovement; 801 ControllingClient.OnCompleteMovementToRegion += CompleteMovement;
809 //ControllingClient.OnCompleteMovementToRegion += SendInitialData;
810 ControllingClient.OnAgentUpdate += HandleAgentUpdate; 802 ControllingClient.OnAgentUpdate += HandleAgentUpdate;
811 ControllingClient.OnAgentRequestSit += HandleAgentRequestSit; 803 ControllingClient.OnAgentRequestSit += HandleAgentRequestSit;
812 ControllingClient.OnAgentSit += HandleAgentSit; 804 ControllingClient.OnAgentSit += HandleAgentSit;
@@ -854,11 +846,6 @@ namespace OpenSim.Region.Framework.Scenes
854 846
855 #endregion 847 #endregion
856 848
857 public uint GenerateClientFlags(UUID ObjectID)
858 {
859 return m_scene.Permissions.GenerateClientFlags(m_uuid, ObjectID);
860 }
861
862 #region Status Methods 849 #region Status Methods
863 850
864 /// <summary> 851 /// <summary>
@@ -1049,18 +1036,19 @@ namespace OpenSim.Region.Framework.Scenes
1049 { 1036 {
1050 if (PhysicsActor != null) 1037 if (PhysicsActor != null)
1051 { 1038 {
1052 try 1039// PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients;
1053 { 1040 PhysicsActor.OnOutOfBounds -= OutOfBoundsCall;
1054 PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; 1041 m_scene.PhysicsScene.RemoveAvatar(PhysicsActor);
1055 PhysicsActor.OnOutOfBounds -= OutOfBoundsCall; 1042 PhysicsActor.UnSubscribeEvents();
1056 m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); 1043 PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
1057 PhysicsActor.UnSubscribeEvents(); 1044 PhysicsActor = null;
1058 PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
1059 PhysicsActor = null;
1060 }
1061 catch
1062 { }
1063 } 1045 }
1046// else
1047// {
1048// m_log.ErrorFormat(
1049// "[SCENE PRESENCE]: Attempt to remove physics actor for {0} on {1} but this scene presence has no physics actor",
1050// Name, Scene.RegionInfo.RegionName);
1051// }
1064 } 1052 }
1065 1053
1066 /// <summary> 1054 /// <summary>
@@ -1173,13 +1161,11 @@ namespace OpenSim.Region.Framework.Scenes
1173 /// <summary> 1161 /// <summary>
1174 /// Sets avatar height in the physics plugin 1162 /// Sets avatar height in the physics plugin
1175 /// </summary> 1163 /// </summary>
1164 /// <param name="height">New height of avatar</param>
1176 public void SetHeight(float height) 1165 public void SetHeight(float height)
1177 { 1166 {
1178 if (PhysicsActor != null && !IsChildAgent) 1167 if (PhysicsActor != null && !IsChildAgent)
1179 { 1168 PhysicsActor.Size = new Vector3(0.45f, 0.6f, height);
1180 Vector3 SetSize = new Vector3(0.45f, 0.6f, height);
1181 PhysicsActor.Size = SetSize;
1182 }
1183 } 1169 }
1184 1170
1185 /// <summary> 1171 /// <summary>
@@ -1945,7 +1931,7 @@ namespace OpenSim.Region.Framework.Scenes
1945// m_log.DebugFormat("[SCENE PRESENCE]: {0} {1}", SitTargetisSet, SitTargetUnOccupied); 1931// m_log.DebugFormat("[SCENE PRESENCE]: {0} {1}", SitTargetisSet, SitTargetUnOccupied);
1946 1932
1947 if (PhysicsActor != null) 1933 if (PhysicsActor != null)
1948 m_sitAvatarHeight = m_physicsActor.Size.Z; 1934 m_sitAvatarHeight = PhysicsActor.Size.Z;
1949 1935
1950 bool canSit = false; 1936 bool canSit = false;
1951 pos = part.AbsolutePosition + offset; 1937 pos = part.AbsolutePosition + offset;
@@ -2592,7 +2578,10 @@ namespace OpenSim.Region.Framework.Scenes
2592 // only send update from root agents to other clients; children are only "listening posts" 2578 // only send update from root agents to other clients; children are only "listening posts"
2593 if (IsChildAgent) 2579 if (IsChildAgent)
2594 { 2580 {
2595 m_log.Warn("[SCENE PRESENCE]: Attempt to send avatar data from a child agent"); 2581 m_log.WarnFormat(
2582 "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}",
2583 Name, Scene.RegionInfo.RegionName);
2584
2596 return; 2585 return;
2597 } 2586 }
2598 2587
@@ -2650,7 +2639,10 @@ namespace OpenSim.Region.Framework.Scenes
2650 // only send update from root agents to other clients; children are only "listening posts" 2639 // only send update from root agents to other clients; children are only "listening posts"
2651 if (IsChildAgent) 2640 if (IsChildAgent)
2652 { 2641 {
2653 m_log.Warn("[SCENE PRESENCE]: Attempt to send avatar data from a child agent"); 2642 m_log.WarnFormat(
2643 "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}",
2644 Name, Scene.RegionInfo.RegionName);
2645
2654 return; 2646 return;
2655 } 2647 }
2656 2648
@@ -3032,6 +3024,7 @@ namespace OpenSim.Region.Framework.Scenes
3032 CopyFrom(cAgentData); 3024 CopyFrom(cAgentData);
3033 } 3025 }
3034 3026
3027 private static Vector3 marker = new Vector3(-1f, -1f, -1f);
3035 /// <summary> 3028 /// <summary>
3036 /// This updates important decision making data about a child agent 3029 /// This updates important decision making data about a child agent
3037 /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region 3030 /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region
@@ -3052,8 +3045,8 @@ namespace OpenSim.Region.Framework.Scenes
3052 // region's draw distance. 3045 // region's draw distance.
3053 // DrawDistance = cAgentData.Far; 3046 // DrawDistance = cAgentData.Far;
3054 DrawDistance = Scene.DefaultDrawDistance; 3047 DrawDistance = Scene.DefaultDrawDistance;
3055 3048
3056 if (cAgentData.Position != new Vector3(-1f, -1f, -1f)) // UGH!! 3049 if (cAgentData.Position != marker) // UGH!!
3057 m_pos = cAgentData.Position + offset; 3050 m_pos = cAgentData.Position + offset;
3058 3051
3059 if (Vector3.Distance(AbsolutePosition, posLastSignificantMove) >= Scene.ChildReprioritizationDistance) 3052 if (Vector3.Distance(AbsolutePosition, posLastSignificantMove) >= Scene.ChildReprioritizationDistance)
@@ -3064,8 +3057,6 @@ namespace OpenSim.Region.Framework.Scenes
3064 3057
3065 CameraPosition = cAgentData.Center + offset; 3058 CameraPosition = cAgentData.Center + offset;
3066 3059
3067 //SetHeight(cAgentData.AVHeight);
3068
3069 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) 3060 if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0)
3070 ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); 3061 ControllingClient.SetChildAgentThrottle(cAgentData.Throttles);
3071 3062
@@ -3274,6 +3265,13 @@ namespace OpenSim.Region.Framework.Scenes
3274// "[SCENE PRESENCE]: Adding physics actor for {0}, ifFlying = {1} in {2}", 3265// "[SCENE PRESENCE]: Adding physics actor for {0}, ifFlying = {1} in {2}",
3275// Name, isFlying, Scene.RegionInfo.RegionName); 3266// Name, isFlying, Scene.RegionInfo.RegionName);
3276 3267
3268 if (PhysicsActor != null)
3269 {
3270 m_log.ErrorFormat(
3271 "[SCENE PRESENCE]: Adding physics actor for {0} to {1} but this scene presence already has a physics actor",
3272 Name, Scene.RegionInfo.RegionName);
3273 }
3274
3277 if (Appearance.AvatarHeight == 0) 3275 if (Appearance.AvatarHeight == 0)
3278 Appearance.SetHeight(); 3276 Appearance.SetHeight();
3279 3277
@@ -3281,18 +3279,15 @@ namespace OpenSim.Region.Framework.Scenes
3281 3279
3282 Vector3 pVec = AbsolutePosition; 3280 Vector3 pVec = AbsolutePosition;
3283 3281
3284 // Old bug where the height was in centimeters instead of meters 3282 PhysicsActor = scene.AddAvatar(
3285 PhysicsActor = scene.AddAvatar(LocalId, Firstname + "." + Lastname, pVec, 3283 LocalId, Firstname + "." + Lastname, pVec,
3286 new Vector3(0f, 0f, Appearance.AvatarHeight), isFlying); 3284 new Vector3(0f, 0f, Appearance.AvatarHeight), isFlying);
3287 3285
3288 scene.AddPhysicsActorTaint(PhysicsActor);
3289 //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; 3286 //PhysicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
3290 PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; 3287 PhysicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
3291 PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong 3288 PhysicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong
3292 PhysicsActor.SubscribeEvents(500); 3289 PhysicsActor.SubscribeEvents(500);
3293 PhysicsActor.LocalID = LocalId; 3290 PhysicsActor.LocalID = LocalId;
3294
3295 SetHeight(Appearance.AvatarHeight);
3296 } 3291 }
3297 3292
3298 private void OutOfBoundsCall(Vector3 pos) 3293 private void OutOfBoundsCall(Vector3 pos)
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index b2c0f48..8002cb6 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -29,25 +29,18 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Timers; 31using System.Timers;
32
33using log4net; 32using log4net;
34using Mono.Addins; 33using Mono.Addins;
35using Nini.Config; 34using Nini.Config;
36
37using OpenMetaverse; 35using OpenMetaverse;
38using OpenMetaverse.StructuredData; 36using OpenMetaverse.StructuredData;
39
40using OpenSim.Framework; 37using OpenSim.Framework;
41using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
42using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
43using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
44
45using OpenSim.Services.Interfaces; 41using OpenSim.Services.Interfaces;
46
47using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags; 42using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags;
48 43
49
50
51namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups 44namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
52{ 45{
53 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 46 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
@@ -90,7 +83,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
90 // Configuration settings 83 // Configuration settings
91 private bool m_groupsEnabled = false; 84 private bool m_groupsEnabled = false;
92 private bool m_groupNoticesEnabled = true; 85 private bool m_groupNoticesEnabled = true;
93 private bool m_debugEnabled = true; 86 private bool m_debugEnabled = false;
94 87
95 #region IRegionModuleBase Members 88 #region IRegionModuleBase Members
96 89
@@ -225,6 +218,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
225 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 218 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
226 219
227 client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; 220 client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
221 client.OnObjectGroupRequest += HandleObjectGroupUpdate;
228 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; 222 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
229 client.OnDirFindQuery += OnDirFindQuery; 223 client.OnDirFindQuery += OnDirFindQuery;
230 client.OnRequestAvatarProperties += OnRequestAvatarProperties; 224 client.OnRequestAvatarProperties += OnRequestAvatarProperties;
@@ -232,7 +226,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
232 // Used for Notices and Group Invites/Accept/Reject 226 // Used for Notices and Group Invites/Accept/Reject
233 client.OnInstantMessage += OnInstantMessage; 227 client.OnInstantMessage += OnInstantMessage;
234 228
235 // Send client thier groups information. 229 // Send client their groups information.
236 SendAgentGroupDataUpdate(client, client.AgentId); 230 SendAgentGroupDataUpdate(client, client.AgentId);
237 } 231 }
238 232
@@ -335,6 +329,35 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
335 remoteClient.SendGroupNameReply(GroupID, GroupName); 329 remoteClient.SendGroupNameReply(GroupID, GroupName);
336 } 330 }
337 331
332 private void HandleObjectGroupUpdate(
333 IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage)
334 {
335 // XXX: Might be better to get rid of this special casing and have GetMembershipData return something
336 // reasonable for a UUID.Zero group.
337 if (GroupID != UUID.Zero)
338 {
339 GroupMembershipData gmd = GetMembershipData(GroupID, remoteClient.AgentId);
340
341 if (gmd == null)
342 {
343// m_log.WarnFormat(
344// "[GROUPS]: User {0} is not a member of group {1} so they can't update {2} to this group",
345// remoteClient.Name, GroupID, objectLocalID);
346
347 return;
348 }
349 }
350
351 SceneObjectGroup so = ((Scene)remoteClient.Scene).GetGroupByPrim(objectLocalID);
352 if (so != null)
353 {
354 if (so.OwnerID == remoteClient.AgentId)
355 {
356 so.SetGroup(GroupID, remoteClient);
357 }
358 }
359 }
360
338 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) 361 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
339 { 362 {
340 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 363 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
index a08bcd0..52fc27d 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
@@ -52,6 +52,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
52 { 52 {
53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
54 54
55 private bool m_debugEnabled = false;
56
55 public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | 57 public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome |
56 GroupPowers.Accountable | 58 GroupPowers.Accountable |
57 GroupPowers.JoinChat | 59 GroupPowers.JoinChat |
@@ -81,7 +83,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
81 private Dictionary<UUID, List<UUID>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<UUID>>(); 83 private Dictionary<UUID, List<UUID>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<UUID>>();
82 private Dictionary<UUID, List<UUID>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<UUID>>(); 84 private Dictionary<UUID, List<UUID>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<UUID>>();
83 85
84
85 #region IRegionModuleBase Members 86 #region IRegionModuleBase Members
86 87
87 public string Name 88 public string Name
@@ -115,7 +116,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
115 return; 116 return;
116 } 117 }
117 118
118 m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name); 119 m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name);
119 120
120 m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); 121 m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty);
121 if ((m_groupsServerURI == null) || 122 if ((m_groupsServerURI == null) ||
@@ -142,6 +143,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
142 m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Timeout set to {0}.", m_cacheTimeout); 143 m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Timeout set to {0}.", m_cacheTimeout);
143 } 144 }
144 145
146 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", false);
147
145 // If we got all the config options we need, lets start'er'up 148 // If we got all the config options we need, lets start'er'up
146 m_memoryCache = new ExpiringCache<string, XmlRpcResponse>(); 149 m_memoryCache = new ExpiringCache<string, XmlRpcResponse>();
147 m_connectorEnabled = true; 150 m_connectorEnabled = true;
@@ -150,7 +153,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
150 153
151 public void Close() 154 public void Close()
152 { 155 {
153 m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Closing {0}", this.Name); 156 m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Closing {0}", this.Name);
154 } 157 }
155 158
156 public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene) 159 public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
@@ -958,6 +961,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
958 961
959 if (resp == null) 962 if (resp == null)
960 { 963 {
964 if (m_debugEnabled)
965 m_log.DebugFormat("[XMLRPC-GROUPS-CONNECTOR]: Cache miss for key {0}", CacheKey);
966
961 string UserService; 967 string UserService;
962 UUID SessionID; 968 UUID SessionID;
963 GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); 969 GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID);
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
index 5e2eeeb..1e1d5e3 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs
@@ -44,8 +44,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
44 private bool flying; 44 private bool flying;
45 private bool iscolliding; 45 private bool iscolliding;
46 46
47 public BasicActor() 47 public BasicActor(Vector3 size)
48 { 48 {
49 Size = size;
49 } 50 }
50 51
51 public override int PhysicsActorType 52 public override int PhysicsActorType
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
index 1ceed1a..2e14216 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
56 } 56 }
57 public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying) 57 public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
58 { 58 {
59 BasicActor act = new BasicActor(); 59 BasicActor act = new BasicActor(size);
60 act.Position = position; 60 act.Position = position;
61 act.Flying = isFlying; 61 act.Flying = isFlying;
62 _actors.Add(act); 62 _actors.Add(act);
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 73c1c02..f2bb4bf 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -137,7 +137,7 @@ namespace OpenSim.Region.Physics.OdePlugin
137 internal IntPtr Body = IntPtr.Zero; 137 internal IntPtr Body = IntPtr.Zero;
138 private OdeScene _parent_scene; 138 private OdeScene _parent_scene;
139 internal IntPtr Shell = IntPtr.Zero; 139 internal IntPtr Shell = IntPtr.Zero;
140 internal IntPtr Amotor = IntPtr.Zero; 140 private IntPtr Amotor = IntPtr.Zero;
141 private d.Mass ShellMass; 141 private d.Mass ShellMass;
142 142
143 private int m_eventsubscription = 0; 143 private int m_eventsubscription = 0;
@@ -195,13 +195,10 @@ namespace OpenSim.Region.Physics.OdePlugin
195 // new d.Matrix3(0.5f, 0.7071068f, 0.5f, -0.7071068f, 0f, 0.7071068f, 0.5f, -0.7071068f, 195 // new d.Matrix3(0.5f, 0.7071068f, 0.5f, -0.7071068f, 0f, 0.7071068f, 0.5f, -0.7071068f,
196 // 0.5f); 196 // 0.5f);
197 197
198 for (int i = 0; i < 11; i++) 198 // We can set taint and actual to be the same here, since the entire character will be set up when the
199 { 199 // m_tainted_isPhysical is processed.
200 m_colliderarr[i] = false; 200 SetTaintedCapsuleLength(size);
201 } 201 CAPSULE_LENGTH = m_tainted_CAPSULE_LENGTH;
202 CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
203 //m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH.ToString());
204 m_tainted_CAPSULE_LENGTH = CAPSULE_LENGTH;
205 202
206 m_isPhysical = false; // current status: no ODE information exists 203 m_isPhysical = false; // current status: no ODE information exists
207 m_tainted_isPhysical = true; // new tainted status: need to create ODE information 204 m_tainted_isPhysical = true; // new tainted status: need to create ODE information
@@ -457,24 +454,28 @@ namespace OpenSim.Region.Physics.OdePlugin
457 get { return new Vector3(CAPSULE_RADIUS * 2, CAPSULE_RADIUS * 2, CAPSULE_LENGTH); } 454 get { return new Vector3(CAPSULE_RADIUS * 2, CAPSULE_RADIUS * 2, CAPSULE_LENGTH); }
458 set 455 set
459 { 456 {
460 if (value.IsFinite()) 457 SetTaintedCapsuleLength(value);
461 {
462 m_pidControllerActive = true;
463
464 Vector3 SetSize = value;
465 m_tainted_CAPSULE_LENGTH = (SetSize.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
466// m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH);
467 458
468 // If we reset velocity here, then an avatar stalls when it crosses a border for the first time 459 // If we reset velocity here, then an avatar stalls when it crosses a border for the first time
469 // (as the height of the new root agent is set). 460 // (as the height of the new root agent is set).
470// Velocity = Vector3.Zero; 461// Velocity = Vector3.Zero;
471 462
472 _parent_scene.AddPhysicsActorTaint(this); 463 _parent_scene.AddPhysicsActorTaint(this);
473 } 464 }
474 else 465 }
475 { 466
476 m_log.WarnFormat("[ODE CHARACTER]: Got a NaN Size from Scene on {0}", Name); 467 private void SetTaintedCapsuleLength(Vector3 size)
477 } 468 {
469 if (size.IsFinite())
470 {
471 m_pidControllerActive = true;
472
473 m_tainted_CAPSULE_LENGTH = (size.Z * 1.15f) - CAPSULE_RADIUS * 2.0f;
474// m_log.Info("[ODE CHARACTER]: " + CAPSULE_LENGTH);
475 }
476 else
477 {
478 m_log.WarnFormat("[ODE CHARACTER]: Got a NaN Size for {0} in {1}", Name, _parent_scene.Name);
478 } 479 }
479 } 480 }
480 481
@@ -549,8 +550,8 @@ namespace OpenSim.Region.Physics.OdePlugin
549 { 550 {
550 get 551 get
551 { 552 {
552 float AVvolume = (float) (Math.PI*Math.Pow(CAPSULE_RADIUS, 2)*CAPSULE_LENGTH); 553 float AVvolume = (float)(Math.PI * Math.Pow(CAPSULE_RADIUS, 2) * CAPSULE_LENGTH);
553 return m_density*AVvolume; 554 return m_density * AVvolume;
554 } 555 }
555 } 556 }
556 557
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index a6c2eca..f716687 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -1699,7 +1699,10 @@ namespace OpenSim.Region.Physics.OdePlugin
1699 1699
1700 public override void RemoveAvatar(PhysicsActor actor) 1700 public override void RemoveAvatar(PhysicsActor actor)
1701 { 1701 {
1702 //m_log.Debug("[PHYSICS]:ODELOCK"); 1702// m_log.DebugFormat(
1703// "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2}",
1704// actor.Name, actor.LocalID, Name);
1705
1703 ((OdeCharacter) actor).Destroy(); 1706 ((OdeCharacter) actor).Destroy();
1704 } 1707 }
1705 1708
@@ -1709,6 +1712,10 @@ namespace OpenSim.Region.Physics.OdePlugin
1709 { 1712 {
1710 _characters.Add(chr); 1713 _characters.Add(chr);
1711 1714
1715// m_log.DebugFormat(
1716// "[ODE SCENE]: Adding physics character {0} {1} to physics scene {2}. Count now {3}",
1717// chr.Name, chr.LocalID, Name, _characters.Count);
1718
1712 if (chr.bad) 1719 if (chr.bad)
1713 m_log.ErrorFormat("[ODE SCENE]: Added BAD actor {0} to characters list", chr.m_uuid); 1720 m_log.ErrorFormat("[ODE SCENE]: Added BAD actor {0} to characters list", chr.m_uuid);
1714 } 1721 }
@@ -1723,11 +1730,19 @@ namespace OpenSim.Region.Physics.OdePlugin
1723 internal void RemoveCharacter(OdeCharacter chr) 1730 internal void RemoveCharacter(OdeCharacter chr)
1724 { 1731 {
1725 if (_characters.Contains(chr)) 1732 if (_characters.Contains(chr))
1733 {
1726 _characters.Remove(chr); 1734 _characters.Remove(chr);
1735
1736// m_log.DebugFormat(
1737// "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2}. Count now {3}",
1738// chr.Name, chr.LocalID, Name, _characters.Count);
1739 }
1727 else 1740 else
1741 {
1728 m_log.ErrorFormat( 1742 m_log.ErrorFormat(
1729 "[ODE SCENE]: Tried to remove character {0} {1} but they are not in the list!", 1743 "[ODE SCENE]: Tried to remove character {0} {1} but they are not in the list!",
1730 chr.Name, chr.LocalID); 1744 chr.Name, chr.LocalID);
1745 }
1731 } 1746 }
1732 1747
1733 private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, 1748 private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation,
@@ -1765,7 +1780,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1765 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 1780 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
1766 Vector3 size, Quaternion rotation, bool isPhysical, uint localid) 1781 Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
1767 { 1782 {
1768// m_log.DebugFormat("[ODE SCENE]: Adding physics actor to {0} {1}", primName, localid); 1783// m_log.DebugFormat("[ODE SCENE]: Adding physics prim {0} {1} to physics scene {2}", primName, localid, Name);
1769 1784
1770 return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid); 1785 return AddPrim(primName, position, size, rotation, pbs, isPhysical, localid);
1771 } 1786 }
@@ -2755,6 +2770,10 @@ namespace OpenSim.Region.Physics.OdePlugin
2755 { 2770 {
2756 foreach (OdeCharacter actor in defects) 2771 foreach (OdeCharacter actor in defects)
2757 { 2772 {
2773 m_log.ErrorFormat(
2774 "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2} due to defect found when moving",
2775 actor.Name, actor.LocalID, Name);
2776
2758 RemoveCharacter(actor); 2777 RemoveCharacter(actor);
2759 actor.DestroyOdeStructures(); 2778 actor.DestroyOdeStructures();
2760 } 2779 }
@@ -2825,6 +2844,10 @@ namespace OpenSim.Region.Physics.OdePlugin
2825 { 2844 {
2826 foreach (OdeCharacter actor in defects) 2845 foreach (OdeCharacter actor in defects)
2827 { 2846 {
2847 m_log.ErrorFormat(
2848 "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2} due to defect found when updating position and velocity",
2849 actor.Name, actor.LocalID, Name);
2850
2828 RemoveCharacter(actor); 2851 RemoveCharacter(actor);
2829 actor.DestroyOdeStructures(); 2852 actor.DestroyOdeStructures();
2830 } 2853 }
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
index cf2f46a..3c36943 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
@@ -333,7 +333,7 @@ namespace OpenSim.Region.RegionCombinerModule
333 //xxy 333 //xxy
334 //xxx 334 //xxx
335 //xxx 335 //xxx
336 if ((((int)conn.X * (int)Constants.RegionSize) + conn.YEnd 336 if ((((int)conn.X * (int)Constants.RegionSize) + conn.XEnd
337 >= (regionConnections.X * (int)Constants.RegionSize)) 337 >= (regionConnections.X * (int)Constants.RegionSize))
338 && (((int)conn.Y * (int)Constants.RegionSize) + conn.YEnd 338 && (((int)conn.Y * (int)Constants.RegionSize) + conn.YEnd
339 >= (regionConnections.Y * (int)Constants.RegionSize))) 339 >= (regionConnections.Y * (int)Constants.RegionSize)))
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
index 50010f2..07c6962 100644
--- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
@@ -259,6 +259,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
259 259
260 } 260 }
261 261
262 [Obsolete]
262 public XmlRpcResponse GetOnlineFriends(XmlRpcRequest request, IPEndPoint remoteClient) 263 public XmlRpcResponse GetOnlineFriends(XmlRpcRequest request, IPEndPoint remoteClient)
263 { 264 {
264 Hashtable hash = new Hashtable(); 265 Hashtable hash = new Hashtable();
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index a59b9ee..afbd093 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -484,6 +484,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
484 return friendsOnline; 484 return friendsOnline;
485 } 485 }
486 486
487 [Obsolete]
487 public List<UUID> GetOnlineFriends(UUID userID, List<string> friends) 488 public List<UUID> GetOnlineFriends(UUID userID, List<string> friends)
488 { 489 {
489 Hashtable hash = new Hashtable(); 490 Hashtable hash = new Hashtable();