aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorAdam Johnson2007-12-28 08:51:39 +0000
committerAdam Johnson2007-12-28 08:51:39 +0000
commit79496381fc68cbd30ff5a95d1f05fcb18c6b1a93 (patch)
tree036414391293354da62fe9eac1895483111480a3 /OpenSim/Region/Environment/Scenes/Scene.cs
parent* Moved PrimitiveBaseShape subclasses into factory methods - the subclassing ... (diff)
downloadopensim-SC_OLD-79496381fc68cbd30ff5a95d1f05fcb18c6b1a93.zip
opensim-SC_OLD-79496381fc68cbd30ff5a95d1f05fcb18c6b1a93.tar.gz
opensim-SC_OLD-79496381fc68cbd30ff5a95d1f05fcb18c6b1a93.tar.bz2
opensim-SC_OLD-79496381fc68cbd30ff5a95d1f05fcb18c6b1a93.tar.xz
Patch from Johan: LibSL updated to the latest revision (1568) and all packets are now
recycled to improve performance and memory usage.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs71
1 files changed, 35 insertions, 36 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index d8c5255..4657264 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -474,7 +474,7 @@ namespace OpenSim.Region.Environment.Scenes
474 if (!avatar.IsChildAgent) 474 if (!avatar.IsChildAgent)
475 avatar.ControllingClient.Kick("The simulator is going down."); 475 avatar.ControllingClient.Kick("The simulator is going down.");
476 476
477 avatar.ControllingClient.OutPacket(new DisableSimulatorPacket(), 477 avatar.ControllingClient.OutPacket(PacketPool.Instance.GetPacket(libsecondlife.Packets.PacketType.DisableSimulator),
478 ThrottleOutPacketType.Task); 478 ThrottleOutPacketType.Task);
479 }); 479 });
480 480
@@ -1016,43 +1016,42 @@ namespace OpenSim.Region.Environment.Scenes
1016 // It's wrong many times though. 1016 // It's wrong many times though.
1017 1017
1018 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection); 1018 LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection);
1019
1020
1021
1019 1022
1020 if (PermissionsMngr.CanRezObject(ownerID, pos)) 1023 if (PermissionsMngr.CanRezObject(ownerID, pos))
1021 { 1024 {
1022 // rez ON the ground, not IN the ground
1023 pos.Z += 0.25F;
1024
1025 AddNewPrim(ownerID, pos, rot, shape);
1026 }
1027 }
1028 1025
1029 public virtual void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) 1026 // rez ON the ground, not IN the ground
1030 { 1027 pos.Z += 0.25F;
1031 SceneObjectGroup sceneOb = 1028
1032 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); 1029
1033 1030 SceneObjectGroup sceneOb =
1034 AddEntity(sceneOb); 1031 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
1035 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); 1032 AddEntity(sceneOb);
1036 // if grass or tree, make phantom 1033 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
1037 //rootPart.ApplySanePermissions(); 1034 // if grass or tree, make phantom
1038 if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111)) 1035 //rootPart.ApplySanePermissions();
1039 { 1036 if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111))
1040 rootPart.AddFlag(LLObject.ObjectFlags.Phantom); 1037 {
1041 //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom; 1038 rootPart.AddFlag(LLObject.ObjectFlags.Phantom);
1042 } 1039 //rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom;
1043 // if not phantom, add to physics 1040 }
1044 bool UsePhysics = (((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim); 1041 // if not phantom, add to physics
1045 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) 1042 bool UsePhysics = (((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim);
1046 { 1043 if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
1047 rootPart.PhysActor = 1044 {
1048 PhysicsScene.AddPrimShape( 1045 rootPart.PhysActor =
1049 rootPart.Name, 1046 PhysicsScene.AddPrimShape(
1050 rootPart.Shape, 1047 rootPart.Name,
1051 new PhysicsVector(pos.X, pos.Y, pos.Z), 1048 rootPart.Shape,
1052 new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), 1049 new PhysicsVector(pos.X, pos.Y, pos.Z),
1053 new Quaternion(), UsePhysics); 1050 new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
1054 // subscribe to physics events. 1051 new Quaternion(), UsePhysics);
1055 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); 1052 // subscribe to physics events.
1053 rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
1054 }
1056 } 1055 }
1057 } 1056 }
1058 1057
@@ -1499,7 +1498,7 @@ namespace OpenSim.Region.Environment.Scenes
1499 m_innerScene.removeUserCount(true); 1498 m_innerScene.removeUserCount(true);
1500 } 1499 }
1501 // Tell a single agent to disconnect from the region. 1500 // Tell a single agent to disconnect from the region.
1502 DisableSimulatorPacket disable = new DisableSimulatorPacket(); 1501 libsecondlife.Packets.DisableSimulatorPacket disable = (libsecondlife.Packets.DisableSimulatorPacket) PacketPool.Instance.GetPacket(libsecondlife.Packets.PacketType.DisableSimulator);
1503 presence.ControllingClient.OutPacket(disable, ThrottleOutPacketType.Task); 1502 presence.ControllingClient.OutPacket(disable, ThrottleOutPacketType.Task);
1504 } 1503 }
1505 } 1504 }
@@ -2246,4 +2245,4 @@ namespace OpenSim.Region.Environment.Scenes
2246 2245
2247 #endregion 2246 #endregion
2248 } 2247 }
2249} \ No newline at end of file 2248}