diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 72 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 4 |
2 files changed, 38 insertions, 38 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index fb7a558..ef6d1a1 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
221 | m_regionHandle = m_regInfo.RegionHandle; | 221 | m_regionHandle = m_regInfo.RegionHandle; |
222 | m_regionName = m_regInfo.RegionName; | 222 | m_regionName = m_regInfo.RegionName; |
223 | m_datastore = m_regInfo.DataStore; | 223 | m_datastore = m_regInfo.DataStore; |
224 | 224 | ||
225 | m_physicalPrim = physicalPrim; | 225 | m_physicalPrim = physicalPrim; |
226 | m_sendTasksToChild = SendTasksToChild; | 226 | m_sendTasksToChild = SendTasksToChild; |
227 | 227 | ||
@@ -233,7 +233,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
233 | m_permissionManager.Initialise(this); | 233 | m_permissionManager.Initialise(this); |
234 | 234 | ||
235 | m_innerScene = new InnerScene(this, m_regInfo, m_permissionManager); | 235 | m_innerScene = new InnerScene(this, m_regInfo, m_permissionManager); |
236 | 236 | ||
237 | // If the Inner scene has an Unrecoverable error, restart this sim. | 237 | // If the Inner scene has an Unrecoverable error, restart this sim. |
238 | // Currently the only thing that causes it to happen is two kinds of specific | 238 | // Currently the only thing that causes it to happen is two kinds of specific |
239 | // Physics based crashes. | 239 | // Physics based crashes. |
@@ -285,7 +285,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
285 | // Agents may have draw distance values that cross two regions though, so | 285 | // Agents may have draw distance values that cross two regions though, so |
286 | // we add it to the notify list regardless of distance. | 286 | // we add it to the notify list regardless of distance. |
287 | // We'll check the agent's draw distance before notifying them though. | 287 | // We'll check the agent's draw distance before notifying them though. |
288 | 288 | ||
289 | 289 | ||
290 | if (RegionInfo.RegionHandle != otherRegion.RegionHandle) | 290 | if (RegionInfo.RegionHandle != otherRegion.RegionHandle) |
291 | { | 291 | { |
@@ -346,9 +346,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
346 | MainLog.Instance.Verbose("INTERGRID", "Got notice about Region at X:" + otherRegion.RegionLocX.ToString() + " Y:" + otherRegion.RegionLocY.ToString() + " but it was too far away to send to the client"); | 346 | MainLog.Instance.Verbose("INTERGRID", "Got notice about Region at X:" + otherRegion.RegionLocX.ToString() + " Y:" + otherRegion.RegionLocY.ToString() + " but it was too far away to send to the client"); |
347 | } | 347 | } |
348 | 348 | ||
349 | 349 | ||
350 | 350 | ||
351 | 351 | ||
352 | } | 352 | } |
353 | return true; | 353 | return true; |
354 | } | 354 | } |
@@ -371,7 +371,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
371 | { | 371 | { |
372 | // Now we figure out what to set the timer to that does the notifications and calls, RestartNow() | 372 | // Now we figure out what to set the timer to that does the notifications and calls, RestartNow() |
373 | m_restartTimer.Interval = 15000; | 373 | m_restartTimer.Interval = 15000; |
374 | m_incrementsof15seconds = (int) seconds/15; | 374 | m_incrementsof15seconds = (int)seconds / 15; |
375 | m_RestartTimerCounter = 0; | 375 | m_RestartTimerCounter = 0; |
376 | m_restartTimer.AutoReset = true; | 376 | m_restartTimer.AutoReset = true; |
377 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); | 377 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); |
@@ -416,7 +416,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
416 | // If we tell an agent about a sim that's not listening yet, the agent will not be able to connect to it. | 416 | // If we tell an agent about a sim that's not listening yet, the agent will not be able to connect to it. |
417 | // subsequently the agent will never see the region come back online. | 417 | // subsequently the agent will never see the region come back online. |
418 | public void RestartNotifyWaitElapsed(object sender, ElapsedEventArgs e) | 418 | public void RestartNotifyWaitElapsed(object sender, ElapsedEventArgs e) |
419 | { | 419 | { |
420 | m_restartWaitTimer.Stop(); | 420 | m_restartWaitTimer.Stop(); |
421 | lock (m_regionRestartNotifyList) | 421 | lock (m_regionRestartNotifyList) |
422 | { | 422 | { |
@@ -463,7 +463,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
463 | avatar.ControllingClient.Kick("The simulator is going down."); | 463 | avatar.ControllingClient.Kick("The simulator is going down."); |
464 | 464 | ||
465 | avatar.ControllingClient.OutPacket(new libsecondlife.Packets.DisableSimulatorPacket(), ThrottleOutPacketType.Task); | 465 | avatar.ControllingClient.OutPacket(new libsecondlife.Packets.DisableSimulatorPacket(), ThrottleOutPacketType.Task); |
466 | }); | 466 | }); |
467 | 467 | ||
468 | // Wait here, or the kick messages won't actually get to the agents before the scene terminates. | 468 | // Wait here, or the kick messages won't actually get to the agents before the scene terminates. |
469 | Thread.Sleep(500); | 469 | Thread.Sleep(500); |
@@ -738,8 +738,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
738 | 738 | ||
739 | foreach (AssetBase asset in textures) | 739 | foreach (AssetBase asset in textures) |
740 | { | 740 | { |
741 | System.Drawing.Image image= OpenJPEGNet.OpenJPEG.DecodeToImage(asset.Data); | 741 | System.Drawing.Image image = OpenJPEGNet.OpenJPEG.DecodeToImage(asset.Data); |
742 | bitImages.Add(image); | 742 | bitImages.Add(image); |
743 | } | 743 | } |
744 | 744 | ||
745 | System.Drawing.Bitmap mapTexture = new System.Drawing.Bitmap(2560, 2560); | 745 | System.Drawing.Bitmap mapTexture = new System.Drawing.Bitmap(2560, 2560); |
@@ -749,9 +749,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
749 | 749 | ||
750 | for (int i = 0; i < mapBlocks.Count; i++) | 750 | for (int i = 0; i < mapBlocks.Count; i++) |
751 | { | 751 | { |
752 | ushort x = (ushort) ((mapBlocks[i].X - this.RegionInfo.RegionLocX) + 10); | 752 | ushort x = (ushort)((mapBlocks[i].X - this.RegionInfo.RegionLocX) + 10); |
753 | ushort y = (ushort) ((mapBlocks[i].Y - this.RegionInfo.RegionLocY) + 10); | 753 | ushort y = (ushort)((mapBlocks[i].Y - this.RegionInfo.RegionLocY) + 10); |
754 | g.DrawImage(bitImages[i], (x*128), (y*128), 128, 128); | 754 | g.DrawImage(bitImages[i], (x * 128), (y * 128), 128, 128); |
755 | } | 755 | } |
756 | mapTexture.Save(fileName, System.Drawing.Imaging.ImageFormat.Jpeg); | 756 | mapTexture.Save(fileName, System.Drawing.Imaging.ImageFormat.Jpeg); |
757 | } | 757 | } |
@@ -829,7 +829,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
829 | asset.Temporary = temporary; | 829 | asset.Temporary = temporary; |
830 | AssetCache.AddAsset(asset); | 830 | AssetCache.AddAsset(asset); |
831 | } | 831 | } |
832 | 832 | ||
833 | #endregion | 833 | #endregion |
834 | 834 | ||
835 | #region Primitives Methods | 835 | #region Primitives Methods |
@@ -896,25 +896,25 @@ namespace OpenSim.Region.Environment.Scenes | |||
896 | { | 896 | { |
897 | 897 | ||
898 | EntityIntersection rayTracing = null; | 898 | EntityIntersection rayTracing = null; |
899 | ScenePresence presence = ((ScenePresence)GetScenePresence(ownerID)); | 899 | ScenePresence presence = ((ScenePresence)GetScenePresence(ownerID)); |
900 | if (presence != null) | 900 | if (presence != null) |
901 | { | 901 | { |
902 | Vector3 CameraPosition = presence.CameraPosition; | 902 | Vector3 CameraPosition = presence.CameraPosition; |
903 | Vector3 rayEnd = new Vector3(pos.X, pos.Y, pos.Z); | 903 | Vector3 rayEnd = new Vector3(pos.X, pos.Y, pos.Z); |
904 | 904 | ||
905 | float raydistance = m_innerScene.Vector3Distance(CameraPosition, rayEnd); | 905 | float raydistance = m_innerScene.Vector3Distance(CameraPosition, rayEnd); |
906 | 906 | ||
907 | Vector3 rayDirection = new Vector3(rayEnd.x / raydistance, rayEnd.y / raydistance, rayEnd.z / raydistance); | 907 | Vector3 rayDirection = new Vector3(rayEnd.x / raydistance, rayEnd.y / raydistance, rayEnd.z / raydistance); |
908 | 908 | ||
909 | Ray rezRay = new Ray(CameraPosition, rayDirection); | 909 | Ray rezRay = new Ray(CameraPosition, rayDirection); |
910 | 910 | ||
911 | Vector3 RezDirectionFromCamera = rezRay.Direction; | 911 | Vector3 RezDirectionFromCamera = rezRay.Direction; |
912 | 912 | ||
913 | rayTracing = m_innerScene.GetClosestIntersectingPrim(rezRay); | 913 | rayTracing = m_innerScene.GetClosestIntersectingPrim(rezRay); |
914 | 914 | ||
915 | } | 915 | } |
916 | 916 | ||
917 | if ((rayTracing != null) && ( rayTracing.HitTF)) | 917 | if ((rayTracing != null) && (rayTracing.HitTF)) |
918 | { | 918 | { |
919 | // We raytraced and found a prim in the way of the ground.. so | 919 | // We raytraced and found a prim in the way of the ground.. so |
920 | // We will rez the object somewhere close to the prim. Better math needed. This is a Stub | 920 | // We will rez the object somewhere close to the prim. Better math needed. This is a Stub |
@@ -940,7 +940,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
940 | // rez ON the ground, not IN the ground | 940 | // rez ON the ground, not IN the ground |
941 | pos.Z += 0.25F; | 941 | pos.Z += 0.25F; |
942 | } | 942 | } |
943 | 943 | ||
944 | SceneObjectGroup sceneOb = | 944 | SceneObjectGroup sceneOb = |
945 | new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); | 945 | new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); |
946 | AddEntity(sceneOb); | 946 | AddEntity(sceneOb); |
@@ -1122,7 +1122,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1122 | 1122 | ||
1123 | client.OnGrabObject += ProcessObjectGrab; | 1123 | client.OnGrabObject += ProcessObjectGrab; |
1124 | client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; | 1124 | client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; |
1125 | 1125 | ||
1126 | EventManager.TriggerOnNewClient(client); | 1126 | EventManager.TriggerOnNewClient(client); |
1127 | } | 1127 | } |
1128 | 1128 | ||
@@ -1143,7 +1143,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1143 | return avatar; | 1143 | return avatar; |
1144 | } | 1144 | } |
1145 | 1145 | ||
1146 | protected void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) | 1146 | protected void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) |
1147 | { | 1147 | { |
1148 | if (m_AvatarFactory == null || | 1148 | if (m_AvatarFactory == null || |
1149 | !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) | 1149 | !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) |
@@ -1176,15 +1176,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | Broadcast(delegate(IClientAPI client) | 1178 | Broadcast(delegate(IClientAPI client) |
1179 | { | 1179 | { |
1180 | try | 1180 | try |
1181 | { | 1181 | { |
1182 | client.SendKillObject(avatar.RegionHandle, avatar.LocalId); | 1182 | client.SendKillObject(avatar.RegionHandle, avatar.LocalId); |
1183 | } | 1183 | } |
1184 | catch (System.NullReferenceException) | 1184 | catch (System.NullReferenceException) |
1185 | { | 1185 | { |
1186 | //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway. | 1186 | //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway. |
1187 | } | 1187 | } |
1188 | }); | 1188 | }); |
1189 | 1189 | ||
1190 | ForEachScenePresence( | 1190 | ForEachScenePresence( |
@@ -1207,7 +1207,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1207 | catch (System.NullReferenceException) | 1207 | catch (System.NullReferenceException) |
1208 | { | 1208 | { |
1209 | //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway. | 1209 | //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway. |
1210 | } | 1210 | } |
1211 | catch (Exception e) | 1211 | catch (Exception e) |
1212 | { | 1212 | { |
1213 | MainLog.Instance.Error("Scene.cs:RemoveClient exception: " + e.ToString()); | 1213 | MainLog.Instance.Error("Scene.cs:RemoveClient exception: " + e.ToString()); |
@@ -1261,7 +1261,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1261 | m_sceneGridService.OnRegionUp += OtherRegionUp; | 1261 | m_sceneGridService.OnRegionUp += OtherRegionUp; |
1262 | m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; | 1262 | m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; |
1263 | 1263 | ||
1264 | m_sceneGridService.KillObject = SendKillObject; | 1264 | m_sceneGridService.KillObject = SendKillObject; |
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | /// <summary> | 1267 | /// <summary> |
@@ -1723,7 +1723,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1723 | /// <param name="agentID"></param> | 1723 | /// <param name="agentID"></param> |
1724 | /// <param name="sessionID"></param> | 1724 | /// <param name="sessionID"></param> |
1725 | /// <param name="permChanges"></param> | 1725 | /// <param name="permChanges"></param> |
1726 | public void HandleObjectPermissionsUpdate (IClientAPI controller, LLUUID agentID, LLUUID sessionID, List<libsecondlife.Packets.ObjectPermissionsPacket.ObjectDataBlock> permChanges) | 1726 | public void HandleObjectPermissionsUpdate(IClientAPI controller, LLUUID agentID, LLUUID sessionID, List<libsecondlife.Packets.ObjectPermissionsPacket.ObjectDataBlock> permChanges) |
1727 | { | 1727 | { |
1728 | // Check for spoofing.. since this is permissions we're talking about here! | 1728 | // Check for spoofing.. since this is permissions we're talking about here! |
1729 | if ((controller.SessionId == sessionID) && (controller.AgentId == agentID)) | 1729 | if ((controller.SessionId == sessionID) && (controller.AgentId == agentID)) |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index a039015..ca6e2fa 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -238,14 +238,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
238 | public SceneObjectGroup(Scene scene, ulong regionHandle, SceneObjectPart part) | 238 | public SceneObjectGroup(Scene scene, ulong regionHandle, SceneObjectPart part) |
239 | { | 239 | { |
240 | m_scene = scene; | 240 | m_scene = scene; |
241 | m_regionHandle = regionHandle; | ||
242 | |||
243 | part.SetParent(this); | 241 | part.SetParent(this); |
244 | part.ParentID = 0; | 242 | part.ParentID = 0; |
245 | 243 | ||
246 | m_parts.Add(part.UUID, part); | 244 | m_parts.Add(part.UUID, part); |
247 | SetPartAsRoot(part); | 245 | SetPartAsRoot(part); |
248 | 246 | ||
247 | RegionHandle = regionHandle; | ||
248 | |||
249 | AttachToBackup(); | 249 | AttachToBackup(); |
250 | 250 | ||
251 | ApplyPhysics(); | 251 | ApplyPhysics(); |