diff options
author | lbsa71 | 2008-02-10 14:27:21 +0000 |
---|---|---|
committer | lbsa71 | 2008-02-10 14:27:21 +0000 |
commit | e0424254bd843737d171caadabfa5d6d1ff76fd9 (patch) | |
tree | 1f3fb9dc9aee8bee596120f8494c70594dff31ce /OpenSim/Region/Environment/Scenes | |
parent | * Adding more broken objectflags to the list here. Touch was also broken. I... (diff) | |
download | opensim-SC_OLD-e0424254bd843737d171caadabfa5d6d1ff76fd9.zip opensim-SC_OLD-e0424254bd843737d171caadabfa5d6d1ff76fd9.tar.gz opensim-SC_OLD-e0424254bd843737d171caadabfa5d6d1ff76fd9.tar.bz2 opensim-SC_OLD-e0424254bd843737d171caadabfa5d6d1ff76fd9.tar.xz |
* Refactored permissions handling to extract info out of permisisons block in ClientView
* Changed some uint constants to Enum values
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 283 |
1 files changed, 135 insertions, 148 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 5026688..dfbeed1 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -46,9 +46,9 @@ using OpenSim.Region.Environment.Modules; | |||
46 | using OpenSim.Region.Environment.Scenes.Scripting; | 46 | using OpenSim.Region.Environment.Scenes.Scripting; |
47 | using OpenSim.Region.Physics.Manager; | 47 | using OpenSim.Region.Physics.Manager; |
48 | using OpenSim.Region.Terrain; | 48 | using OpenSim.Region.Terrain; |
49 | using Caps=OpenSim.Region.Capabilities.Caps; | 49 | using Caps = OpenSim.Region.Capabilities.Caps; |
50 | using Image=System.Drawing.Image; | 50 | using Image = System.Drawing.Image; |
51 | using Timer=System.Timers.Timer; | 51 | using Timer = System.Timers.Timer; |
52 | 52 | ||
53 | namespace OpenSim.Region.Environment.Scenes | 53 | namespace OpenSim.Region.Environment.Scenes |
54 | { | 54 | { |
@@ -193,10 +193,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
193 | } | 193 | } |
194 | 194 | ||
195 | // Local reference to the objects in the scene (which are held in innerScene) | 195 | // Local reference to the objects in the scene (which are held in innerScene) |
196 | // public Dictionary<LLUUID, SceneObjectGroup> Objects | 196 | // public Dictionary<LLUUID, SceneObjectGroup> Objects |
197 | // { | 197 | // { |
198 | // get { return m_innerScene.SceneObjects; } | 198 | // get { return m_innerScene.SceneObjects; } |
199 | // } | 199 | // } |
200 | 200 | ||
201 | // Reference to all of the agents in the scene (root and child) | 201 | // Reference to all of the agents in the scene (root and child) |
202 | protected Dictionary<LLUUID, ScenePresence> m_scenePresences | 202 | protected Dictionary<LLUUID, ScenePresence> m_scenePresences |
@@ -205,11 +205,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
205 | set { m_innerScene.ScenePresences = value; } | 205 | set { m_innerScene.ScenePresences = value; } |
206 | } | 206 | } |
207 | 207 | ||
208 | // protected Dictionary<LLUUID, SceneObjectGroup> m_sceneObjects | 208 | // protected Dictionary<LLUUID, SceneObjectGroup> m_sceneObjects |
209 | // { | 209 | // { |
210 | // get { return m_innerScene.SceneObjects; } | 210 | // get { return m_innerScene.SceneObjects; } |
211 | // set { m_innerScene.SceneObjects = value; } | 211 | // set { m_innerScene.SceneObjects = value; } |
212 | // } | 212 | // } |
213 | 213 | ||
214 | public Dictionary<LLUUID, EntityBase> Entities | 214 | public Dictionary<LLUUID, EntityBase> Entities |
215 | { | 215 | { |
@@ -278,7 +278,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
278 | //m_sceneObjects = new Dictionary<LLUUID, SceneObjectGroup>(); | 278 | //m_sceneObjects = new Dictionary<LLUUID, SceneObjectGroup>(); |
279 | 279 | ||
280 | m_log.Info("[SCENE]: Creating LandMap"); | 280 | m_log.Info("[SCENE]: Creating LandMap"); |
281 | Terrain = new TerrainEngine((int) RegionInfo.RegionLocX, (int) RegionInfo.RegionLocY); | 281 | Terrain = new TerrainEngine((int)RegionInfo.RegionLocX, (int)RegionInfo.RegionLocY); |
282 | 282 | ||
283 | httpListener = httpServer; | 283 | httpListener = httpServer; |
284 | m_dumpAssetsToFile = dumpAssetsToFile; | 284 | m_dumpAssetsToFile = dumpAssetsToFile; |
@@ -308,13 +308,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
308 | { | 308 | { |
309 | OSString = System.Environment.OSVersion.ToString(); | 309 | OSString = System.Environment.OSVersion.ToString(); |
310 | } | 310 | } |
311 | else | 311 | else |
312 | { | 312 | { |
313 | OSString = Util.ReadEtcIssue(); | 313 | OSString = Util.ReadEtcIssue(); |
314 | } | 314 | } |
315 | if (OSString.Length > 45) | 315 | if (OSString.Length > 45) |
316 | { | 316 | { |
317 | OSString = OSString.Substring(0,45); | 317 | OSString = OSString.Substring(0, 45); |
318 | } | 318 | } |
319 | 319 | ||
320 | m_simulatorVersion = "OpenSimulator v0.5-SVN on " + OSString + " ChilTasks:" + m_sendTasksToChild.ToString() + " PhysPrim:" + m_physicalPrim.ToString(); | 320 | m_simulatorVersion = "OpenSimulator v0.5-SVN on " + OSString + " ChilTasks:" + m_sendTasksToChild.ToString() + " PhysPrim:" + m_physicalPrim.ToString(); |
@@ -383,7 +383,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
383 | int resultX = Math.Abs((int)otherRegion.RegionLocX - (int)RegionInfo.RegionLocX); | 383 | int resultX = Math.Abs((int)otherRegion.RegionLocX - (int)RegionInfo.RegionLocX); |
384 | int resultY = Math.Abs((int)otherRegion.RegionLocY - (int)RegionInfo.RegionLocY); | 384 | int resultY = Math.Abs((int)otherRegion.RegionLocY - (int)RegionInfo.RegionLocY); |
385 | if ((resultX <= 1) && | 385 | if ((resultX <= 1) && |
386 | ( resultY <= 1)) | 386 | (resultY <= 1)) |
387 | { | 387 | { |
388 | try | 388 | try |
389 | { | 389 | { |
@@ -434,11 +434,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
434 | { | 434 | { |
435 | // Now we figure out what to set the timer to that does the notifications and calls, RestartNow() | 435 | // Now we figure out what to set the timer to that does the notifications and calls, RestartNow() |
436 | m_restartTimer.Interval = 15000; | 436 | m_restartTimer.Interval = 15000; |
437 | m_incrementsof15seconds = (int) seconds/15; | 437 | m_incrementsof15seconds = (int)seconds / 15; |
438 | m_RestartTimerCounter = 0; | 438 | m_RestartTimerCounter = 0; |
439 | m_restartTimer.AutoReset = true; | 439 | m_restartTimer.AutoReset = true; |
440 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); | 440 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); |
441 | m_log.Error("[REGION]: Restarting Region in " + (seconds/60) + " minutes"); | 441 | m_log.Error("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); |
442 | m_restartTimer.Start(); | 442 | m_restartTimer.Start(); |
443 | SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes"); | 443 | SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes"); |
444 | //SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes"); | 444 | //SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes"); |
@@ -455,11 +455,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
455 | if (m_RestartTimerCounter <= m_incrementsof15seconds) | 455 | if (m_RestartTimerCounter <= m_incrementsof15seconds) |
456 | { | 456 | { |
457 | if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) | 457 | if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) |
458 | SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " + | 458 | SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " + |
459 | ((8 - m_RestartTimerCounter) * 15) + " seconds"); | 459 | ((8 - m_RestartTimerCounter) * 15) + " seconds"); |
460 | 460 | ||
461 | // SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) + | 461 | // SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) + |
462 | //" seconds"); | 462 | //" seconds"); |
463 | } | 463 | } |
464 | else | 464 | else |
465 | { | 465 | { |
@@ -548,7 +548,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
548 | } | 548 | } |
549 | } | 549 | } |
550 | } | 550 | } |
551 | 551 | ||
552 | 552 | ||
553 | } | 553 | } |
554 | m_scripts_enabled = !ScriptEngine; | 554 | m_scripts_enabled = !ScriptEngine; |
@@ -612,7 +612,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
612 | { | 612 | { |
613 | m_log.Debug("[SCENE]: Starting timer"); | 613 | m_log.Debug("[SCENE]: Starting timer"); |
614 | m_heartbeatTimer.Enabled = true; | 614 | m_heartbeatTimer.Enabled = true; |
615 | m_heartbeatTimer.Interval = (int) (m_timespan*1000); | 615 | m_heartbeatTimer.Interval = (int)(m_timespan * 1000); |
616 | m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat); | 616 | m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat); |
617 | } | 617 | } |
618 | 618 | ||
@@ -650,7 +650,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
650 | updateLock.WaitOne(); | 650 | updateLock.WaitOne(); |
651 | float physicsFPS = 0; | 651 | float physicsFPS = 0; |
652 | int agentsInScene = m_innerScene.GetRootAgentCount() + m_innerScene.GetChildAgentCount(); | 652 | int agentsInScene = m_innerScene.GetRootAgentCount() + m_innerScene.GetChildAgentCount(); |
653 | 653 | ||
654 | 654 | ||
655 | if (agentsInScene > 21) | 655 | if (agentsInScene > 21) |
656 | { | 656 | { |
@@ -681,41 +681,41 @@ namespace OpenSim.Region.Environment.Scenes | |||
681 | // Loop it | 681 | // Loop it |
682 | if (m_frame == Int32.MaxValue) | 682 | if (m_frame == Int32.MaxValue) |
683 | m_frame = 0; | 683 | m_frame = 0; |
684 | |||
685 | 684 | ||
686 | physicsMS2 = System.Environment.TickCount; | 685 | |
687 | if ((m_frame%m_update_physics == 0) && m_physics_enabled) | 686 | physicsMS2 = System.Environment.TickCount; |
687 | if ((m_frame % m_update_physics == 0) && m_physics_enabled) | ||
688 | m_innerScene.UpdatePreparePhysics(); | 688 | m_innerScene.UpdatePreparePhysics(); |
689 | physicsMS2 = System.Environment.TickCount - physicsMS2; | 689 | physicsMS2 = System.Environment.TickCount - physicsMS2; |
690 | 690 | ||
691 | if (m_frame%m_update_entitymovement == 0) | 691 | if (m_frame % m_update_entitymovement == 0) |
692 | m_innerScene.UpdateEntityMovement(); | 692 | m_innerScene.UpdateEntityMovement(); |
693 | 693 | ||
694 | physicsMS = System.Environment.TickCount; | 694 | physicsMS = System.Environment.TickCount; |
695 | if ((m_frame%m_update_physics == 0) && m_physics_enabled) | 695 | if ((m_frame % m_update_physics == 0) && m_physics_enabled) |
696 | physicsFPS = m_innerScene.UpdatePhysics( | 696 | physicsFPS = m_innerScene.UpdatePhysics( |
697 | Math.Max(SinceLastFrame.TotalSeconds, m_timespan) | 697 | Math.Max(SinceLastFrame.TotalSeconds, m_timespan) |
698 | ); | 698 | ); |
699 | 699 | ||
700 | physicsMS = System.Environment.TickCount - physicsMS; | 700 | physicsMS = System.Environment.TickCount - physicsMS; |
701 | physicsMS += physicsMS2; | 701 | physicsMS += physicsMS2; |
702 | 702 | ||
703 | otherMS = System.Environment.TickCount; | 703 | otherMS = System.Environment.TickCount; |
704 | if (m_frame%m_update_entities == 0) | 704 | if (m_frame % m_update_entities == 0) |
705 | m_innerScene.UpdateEntities(); | 705 | m_innerScene.UpdateEntities(); |
706 | 706 | ||
707 | if (m_frame%m_update_events == 0) | 707 | if (m_frame % m_update_events == 0) |
708 | UpdateEvents(); | 708 | UpdateEvents(); |
709 | 709 | ||
710 | if (m_frame%m_update_backup == 0) | 710 | if (m_frame % m_update_backup == 0) |
711 | UpdateStorageBackup(); | 711 | UpdateStorageBackup(); |
712 | 712 | ||
713 | if (m_frame%m_update_terrain == 0) | 713 | if (m_frame % m_update_terrain == 0) |
714 | UpdateTerrain(); | 714 | UpdateTerrain(); |
715 | 715 | ||
716 | if (m_frame%m_update_land == 0) | 716 | if (m_frame % m_update_land == 0) |
717 | UpdateLand(); | 717 | UpdateLand(); |
718 | otherMS = System.Environment.TickCount - otherMS; | 718 | otherMS = System.Environment.TickCount - otherMS; |
719 | // if (m_frame%m_update_avatars == 0) | 719 | // if (m_frame%m_update_avatars == 0) |
720 | // UpdateInWorldTime(); | 720 | // UpdateInWorldTime(); |
721 | m_statsReporter.AddPhysicsFPS(physicsFPS); | 721 | m_statsReporter.AddPhysicsFPS(physicsFPS); |
@@ -732,7 +732,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
732 | m_statsReporter.addOtherMS(otherMS); | 732 | m_statsReporter.addOtherMS(otherMS); |
733 | m_statsReporter.SetActiveScripts(m_innerScene.GetActiveScripts()); | 733 | m_statsReporter.SetActiveScripts(m_innerScene.GetActiveScripts()); |
734 | m_statsReporter.addScriptLines(m_innerScene.GetScriptLPS()); | 734 | m_statsReporter.addScriptLines(m_innerScene.GetScriptLPS()); |
735 | 735 | ||
736 | } | 736 | } |
737 | catch (NotImplementedException) | 737 | catch (NotImplementedException) |
738 | { | 738 | { |
@@ -746,7 +746,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
746 | { | 746 | { |
747 | updateLock.ReleaseMutex(); | 747 | updateLock.ReleaseMutex(); |
748 | 748 | ||
749 | m_timedilation = m_timespan/(float) SinceLastFrame.TotalSeconds; | 749 | m_timedilation = m_timespan / (float)SinceLastFrame.TotalSeconds; |
750 | m_lastupdate = DateTime.Now; | 750 | m_lastupdate = DateTime.Now; |
751 | } | 751 | } |
752 | } | 752 | } |
@@ -871,10 +871,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
871 | public void ExportWorldMap(string fileName) | 871 | public void ExportWorldMap(string fileName) |
872 | { | 872 | { |
873 | List<MapBlockData> mapBlocks = | 873 | List<MapBlockData> mapBlocks = |
874 | CommsManager.GridService.RequestNeighbourMapBlocks((int) (RegionInfo.RegionLocX - 9), | 874 | CommsManager.GridService.RequestNeighbourMapBlocks((int)(RegionInfo.RegionLocX - 9), |
875 | (int) (RegionInfo.RegionLocY - 9), | 875 | (int)(RegionInfo.RegionLocY - 9), |
876 | (int) (RegionInfo.RegionLocX + 9), | 876 | (int)(RegionInfo.RegionLocX + 9), |
877 | (int) (RegionInfo.RegionLocY + 9)); | 877 | (int)(RegionInfo.RegionLocY + 9)); |
878 | List<AssetBase> textures = new List<AssetBase>(); | 878 | List<AssetBase> textures = new List<AssetBase>(); |
879 | List<Image> bitImages = new List<Image>(); | 879 | List<Image> bitImages = new List<Image>(); |
880 | 880 | ||
@@ -909,9 +909,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
909 | 909 | ||
910 | for (int i = 0; i < mapBlocks.Count; i++) | 910 | for (int i = 0; i < mapBlocks.Count; i++) |
911 | { | 911 | { |
912 | ushort x = (ushort) ((mapBlocks[i].X - RegionInfo.RegionLocX) + 10); | 912 | ushort x = (ushort)((mapBlocks[i].X - RegionInfo.RegionLocX) + 10); |
913 | ushort y = (ushort) ((mapBlocks[i].Y - RegionInfo.RegionLocY) + 10); | 913 | ushort y = (ushort)((mapBlocks[i].Y - RegionInfo.RegionLocY) + 10); |
914 | g.DrawImage(bitImages[i], (x*128), (y*128), 128, 128); | 914 | g.DrawImage(bitImages[i], (x * 128), (y * 128), 128, 128); |
915 | } | 915 | } |
916 | mapTexture.Save(fileName, ImageFormat.Jpeg); | 916 | mapTexture.Save(fileName, ImageFormat.Jpeg); |
917 | } | 917 | } |
@@ -1019,17 +1019,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
1019 | 1019 | ||
1020 | public void loadAllLandObjectsFromStorage() | 1020 | public void loadAllLandObjectsFromStorage() |
1021 | { | 1021 | { |
1022 | m_log.Info("[SCENE]: Loading land objects from storage"); | 1022 | m_log.Info("[SCENE]: Loading land objects from storage"); |
1023 | List<LandData> landData = m_storageManager.DataStore.LoadLandObjects(RegionInfo.RegionID); | 1023 | List<LandData> landData = m_storageManager.DataStore.LoadLandObjects(RegionInfo.RegionID); |
1024 | 1024 | ||
1025 | if (landData.Count == 0) | 1025 | if (landData.Count == 0) |
1026 | { | 1026 | { |
1027 | m_LandManager.NoLandDataFromStorage(); | 1027 | m_LandManager.NoLandDataFromStorage(); |
1028 | } | 1028 | } |
1029 | else | 1029 | else |
1030 | { | 1030 | { |
1031 | m_LandManager.IncomingLandObjectsFromStorage(landData); | 1031 | m_LandManager.IncomingLandObjectsFromStorage(landData); |
1032 | } | 1032 | } |
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | #endregion | 1035 | #endregion |
@@ -1042,7 +1042,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1042 | public virtual void LoadPrimsFromStorage(bool m_permissions) | 1042 | public virtual void LoadPrimsFromStorage(bool m_permissions) |
1043 | { | 1043 | { |
1044 | m_log.Info("[SCENE]: Loading objects from datastore"); | 1044 | m_log.Info("[SCENE]: Loading objects from datastore"); |
1045 | 1045 | ||
1046 | List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(m_regInfo.RegionID); | 1046 | List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(m_regInfo.RegionID); |
1047 | foreach (SceneObjectGroup group in PrimsFromDB) | 1047 | foreach (SceneObjectGroup group in PrimsFromDB) |
1048 | { | 1048 | { |
@@ -1054,7 +1054,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1054 | group.ApplyPhysics(m_physicalPrim); | 1054 | group.ApplyPhysics(m_physicalPrim); |
1055 | //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); | 1055 | //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); |
1056 | } | 1056 | } |
1057 | 1057 | ||
1058 | m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); | 1058 | m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); |
1059 | } | 1059 | } |
1060 | 1060 | ||
@@ -1075,7 +1075,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1075 | return myID; | 1075 | return myID; |
1076 | } | 1076 | } |
1077 | 1077 | ||
1078 | public LLVector3 GetNewRezLocation(LLVector3 RayStart, LLVector3 RayEnd, LLUUID RayTargetID, LLQuaternion rot, byte bypassRayCast, byte RayEndIsIntersection) | 1078 | public LLVector3 GetNewRezLocation(LLVector3 RayStart, LLVector3 RayEnd, LLUUID RayTargetID, LLQuaternion rot, byte bypassRayCast, byte RayEndIsIntersection) |
1079 | { | 1079 | { |
1080 | LLVector3 pos = LLVector3.Zero; | 1080 | LLVector3 pos = LLVector3.Zero; |
1081 | if (RayEndIsIntersection == (byte)1) | 1081 | if (RayEndIsIntersection == (byte)1) |
@@ -1095,42 +1095,42 @@ namespace OpenSim.Region.Environment.Scenes | |||
1095 | //ScenePresence presence = ((ScenePresence)GetScenePresence(ownerID)); | 1095 | //ScenePresence presence = ((ScenePresence)GetScenePresence(ownerID)); |
1096 | //if (presence != null) | 1096 | //if (presence != null) |
1097 | //{ | 1097 | //{ |
1098 | //Vector3 CameraPosition = presence.CameraPosition; | 1098 | //Vector3 CameraPosition = presence.CameraPosition; |
1099 | //Vector3 rayEnd = new Vector3(pos.X, pos.Y, pos.Z); | 1099 | //Vector3 rayEnd = new Vector3(pos.X, pos.Y, pos.Z); |
1100 | 1100 | ||
1101 | //float rayMag = m_innerScene.Vector3Distance(CameraPosition, rayEnd); | 1101 | //float rayMag = m_innerScene.Vector3Distance(CameraPosition, rayEnd); |
1102 | //LLVector3 rayDirectionLL = Util.GetNormal(pos); | 1102 | //LLVector3 rayDirectionLL = Util.GetNormal(pos); |
1103 | 1103 | ||
1104 | //Vector3 rayDirection = new Vector3(rayDirectionLL.X, rayDirectionLL.Y, rayDirectionLL.Z); | 1104 | //Vector3 rayDirection = new Vector3(rayDirectionLL.X, rayDirectionLL.Y, rayDirectionLL.Z); |
1105 | 1105 | ||
1106 | //Ray rezRay = new Ray(CameraPosition, rayDirection); | 1106 | //Ray rezRay = new Ray(CameraPosition, rayDirection); |
1107 | 1107 | ||
1108 | //Vector3 RezDirectionFromCamera = rezRay.Direction; | 1108 | //Vector3 RezDirectionFromCamera = rezRay.Direction; |
1109 | 1109 | ||
1110 | //rayTracing = m_innerScene.GetClosestIntersectingPrim(rezRay); | 1110 | //rayTracing = m_innerScene.GetClosestIntersectingPrim(rezRay); |
1111 | //} | 1111 | //} |
1112 | 1112 | ||
1113 | //if ((rayTracing != null) && (rayTracing.HitTF)) | 1113 | //if ((rayTracing != null) && (rayTracing.HitTF)) |
1114 | //{ | 1114 | //{ |
1115 | // We raytraced and found a prim in the way of the ground.. so | 1115 | // We raytraced and found a prim in the way of the ground.. so |
1116 | // We will rez the object somewhere close to the prim. Better math needed. This is a Stub | 1116 | // We will rez the object somewhere close to the prim. Better math needed. This is a Stub |
1117 | //Vector3 Newpos = new Vector3(rayTracing.obj.AbsolutePosition.X,rayTracing.obj.AbsolutePosition.Y,rayTracing.obj.AbsolutePosition.Z); | 1117 | //Vector3 Newpos = new Vector3(rayTracing.obj.AbsolutePosition.X,rayTracing.obj.AbsolutePosition.Y,rayTracing.obj.AbsolutePosition.Z); |
1118 | //Vector3 Newpos = rayTracing.ipoint; | 1118 | //Vector3 Newpos = rayTracing.ipoint; |
1119 | //Vector3 NewScale = | 1119 | //Vector3 NewScale = |
1120 | //new Vector3(rayTracing.obj.Scale.X, rayTracing.obj.Scale.Y, rayTracing.obj.Scale.Z); | 1120 | //new Vector3(rayTracing.obj.Scale.X, rayTracing.obj.Scale.Y, rayTracing.obj.Scale.Z); |
1121 | 1121 | ||
1122 | //Quaternion ParentRot = rayTracing.obj.ParentGroup.Rotation; | 1122 | //Quaternion ParentRot = rayTracing.obj.ParentGroup.Rotation; |
1123 | //Quaternion ParentRot = new Quaternion(primParentRot.W,primParentRot.X,primParentRot.Y,primParentRot.Z); | 1123 | //Quaternion ParentRot = new Quaternion(primParentRot.W,primParentRot.X,primParentRot.Y,primParentRot.Z); |
1124 | 1124 | ||
1125 | //LLQuaternion primLocalRot = rayTracing.obj.RotationOffset; | 1125 | //LLQuaternion primLocalRot = rayTracing.obj.RotationOffset; |
1126 | //Quaternion LocalRot = new Quaternion(primLocalRot.W, primLocalRot.X, primLocalRot.Y, primLocalRot.Z); | 1126 | //Quaternion LocalRot = new Quaternion(primLocalRot.W, primLocalRot.X, primLocalRot.Y, primLocalRot.Z); |
1127 | 1127 | ||
1128 | //Quaternion NewRot = LocalRot * ParentRot; | 1128 | //Quaternion NewRot = LocalRot * ParentRot; |
1129 | 1129 | ||
1130 | //Vector3 RezPoint = Newpos; | 1130 | //Vector3 RezPoint = Newpos; |
1131 | 1131 | ||
1132 | //m_log.Info("[REZINFO]: Possible Rez Point:" + RezPoint.ToString()); | 1132 | //m_log.Info("[REZINFO]: Possible Rez Point:" + RezPoint.ToString()); |
1133 | //pos = new LLVector3(RezPoint.x, RezPoint.y, RezPoint.z); | 1133 | //pos = new LLVector3(RezPoint.x, RezPoint.y, RezPoint.z); |
1134 | //} | 1134 | //} |
1135 | 1135 | ||
1136 | return pos; | 1136 | return pos; |
@@ -1150,16 +1150,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
1150 | } | 1150 | } |
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | public virtual void AddNewPrim(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape, | 1153 | public virtual void AddNewPrim(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape, |
1154 | byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, | 1154 | byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, |
1155 | byte RayEndIsIntersection) | 1155 | byte RayEndIsIntersection) |
1156 | { | 1156 | { |
1157 | LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection); | 1157 | LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection); |
1158 | 1158 | ||
1159 | if (PermissionsMngr.CanRezObject(ownerID, pos)) | 1159 | if (PermissionsMngr.CanRezObject(ownerID, pos)) |
1160 | { | 1160 | { |
1161 | // rez ON the ground, not IN the ground | 1161 | // rez ON the ground, not IN the ground |
1162 | pos.Z += 0.25F; | 1162 | pos.Z += 0.25F; |
1163 | 1163 | ||
1164 | 1164 | ||
1165 | AddNewPrim(ownerID, pos, rot, shape); | 1165 | AddNewPrim(ownerID, pos, rot, shape); |
@@ -1192,9 +1192,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1192 | PrimitiveBaseShape treeShape = new PrimitiveBaseShape(); | 1192 | PrimitiveBaseShape treeShape = new PrimitiveBaseShape(); |
1193 | treeShape.PathCurve = 16; | 1193 | treeShape.PathCurve = 16; |
1194 | treeShape.PathEnd = 49900; | 1194 | treeShape.PathEnd = 49900; |
1195 | treeShape.PCode = newTree ? (byte) PCode.NewTree : (byte) PCode.Tree; | 1195 | treeShape.PCode = newTree ? (byte)PCode.NewTree : (byte)PCode.Tree; |
1196 | treeShape.Scale = scale; | 1196 | treeShape.Scale = scale; |
1197 | treeShape.State = (byte) treeType; | 1197 | treeShape.State = (byte)treeType; |
1198 | return AddNewPrim(uuid, position, rotation, treeShape); | 1198 | return AddNewPrim(uuid, position, rotation, treeShape); |
1199 | } | 1199 | } |
1200 | 1200 | ||
@@ -1399,8 +1399,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1399 | else | 1399 | else |
1400 | { | 1400 | { |
1401 | m_innerScene.removeUserCount(true); | 1401 | m_innerScene.removeUserCount(true); |
1402 | CommsManager.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, | 1402 | CommsManager.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, |
1403 | avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, | 1403 | avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, |
1404 | avatar.AbsolutePosition.Z); | 1404 | avatar.AbsolutePosition.Z); |
1405 | m_sceneGridService.SendCloseChildAgentConnections(avatar); | 1405 | m_sceneGridService.SendCloseChildAgentConnections(avatar); |
1406 | } | 1406 | } |
@@ -1451,7 +1451,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1451 | { | 1451 | { |
1452 | m_log.Warn( | 1452 | m_log.Warn( |
1453 | String.Format("[SCENE] Tried to remove non-existent scene prescence with agent ID {0} from scene Entities list", agentID)); | 1453 | String.Format("[SCENE] Tried to remove non-existent scene prescence with agent ID {0} from scene Entities list", agentID)); |
1454 | } | 1454 | } |
1455 | } | 1455 | } |
1456 | 1456 | ||
1457 | try | 1457 | try |
@@ -1468,8 +1468,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1468 | } | 1468 | } |
1469 | 1469 | ||
1470 | // Remove client agent from profile, so new logins will work | 1470 | // Remove client agent from profile, so new logins will work |
1471 | CommsManager.UserService.clearUserAgent(agentID); | 1471 | CommsManager.UserService.clearUserAgent(agentID); |
1472 | 1472 | ||
1473 | //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); | 1473 | //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); |
1474 | //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); | 1474 | //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); |
1475 | } | 1475 | } |
@@ -1525,9 +1525,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1525 | m_sceneGridService.OnCloseAgentConnection += CloseConnection; | 1525 | m_sceneGridService.OnCloseAgentConnection += CloseConnection; |
1526 | m_sceneGridService.OnRegionUp += OtherRegionUp; | 1526 | m_sceneGridService.OnRegionUp += OtherRegionUp; |
1527 | m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; | 1527 | m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; |
1528 | |||
1529 | 1528 | ||
1530 | 1529 | ||
1530 | |||
1531 | 1531 | ||
1532 | 1532 | ||
1533 | m_sceneGridService.KillObject = SendKillObject; | 1533 | m_sceneGridService.KillObject = SendKillObject; |
@@ -1652,7 +1652,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1652 | childAgentUpdate.ChildAgentDataUpdate(cAgentData, tRegionX, tRegionY, rRegionX, rRegionY); | 1652 | childAgentUpdate.ChildAgentDataUpdate(cAgentData, tRegionX, tRegionY, rRegionX, rRegionY); |
1653 | // Not Implemented: | 1653 | // Not Implemented: |
1654 | //TODO: Do we need to pass the message on to one of our neighbors? | 1654 | //TODO: Do we need to pass the message on to one of our neighbors? |
1655 | 1655 | ||
1656 | } | 1656 | } |
1657 | return true; | 1657 | return true; |
1658 | } | 1658 | } |
@@ -1680,7 +1680,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1680 | m_innerScene.removeUserCount(true); | 1680 | m_innerScene.removeUserCount(true); |
1681 | } | 1681 | } |
1682 | // Tell a single agent to disconnect from the region. | 1682 | // Tell a single agent to disconnect from the region. |
1683 | libsecondlife.Packets.DisableSimulatorPacket disable = (libsecondlife.Packets.DisableSimulatorPacket) PacketPool.Instance.GetPacket(libsecondlife.Packets.PacketType.DisableSimulator); | 1683 | libsecondlife.Packets.DisableSimulatorPacket disable = (libsecondlife.Packets.DisableSimulatorPacket)PacketPool.Instance.GetPacket(libsecondlife.Packets.PacketType.DisableSimulator); |
1684 | presence.ControllingClient.OutPacket(disable, ThrottleOutPacketType.Task); | 1684 | presence.ControllingClient.OutPacket(disable, ThrottleOutPacketType.Task); |
1685 | presence.ControllingClient.Close(true); | 1685 | presence.ControllingClient.Close(true); |
1686 | } | 1686 | } |
@@ -1794,9 +1794,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1794 | /// <param name="mod"></param> | 1794 | /// <param name="mod"></param> |
1795 | public void RegisterModuleInterface<M>(M mod) | 1795 | public void RegisterModuleInterface<M>(M mod) |
1796 | { | 1796 | { |
1797 | if (!ModuleInterfaces.ContainsKey(typeof (M))) | 1797 | if (!ModuleInterfaces.ContainsKey(typeof(M))) |
1798 | { | 1798 | { |
1799 | ModuleInterfaces.Add(typeof (M), mod); | 1799 | ModuleInterfaces.Add(typeof(M), mod); |
1800 | } | 1800 | } |
1801 | } | 1801 | } |
1802 | 1802 | ||
@@ -1806,9 +1806,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1806 | /// <returns></returns> | 1806 | /// <returns></returns> |
1807 | public T RequestModuleInterface<T>() | 1807 | public T RequestModuleInterface<T>() |
1808 | { | 1808 | { |
1809 | if (ModuleInterfaces.ContainsKey(typeof (T))) | 1809 | if (ModuleInterfaces.ContainsKey(typeof(T))) |
1810 | { | 1810 | { |
1811 | return (T) ModuleInterfaces[typeof (T)]; | 1811 | return (T)ModuleInterfaces[typeof(T)]; |
1812 | } | 1812 | } |
1813 | else | 1813 | else |
1814 | { | 1814 | { |
@@ -1816,7 +1816,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1816 | } | 1816 | } |
1817 | } | 1817 | } |
1818 | 1818 | ||
1819 | 1819 | ||
1820 | 1820 | ||
1821 | #endregion | 1821 | #endregion |
1822 | 1822 | ||
@@ -1851,11 +1851,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1851 | } | 1851 | } |
1852 | } | 1852 | } |
1853 | 1853 | ||
1854 | public void SendDialogToUser(LLUUID avatarID, string objectName, LLUUID objectID, LLUUID ownerID,string message,LLUUID TextureID,int ch,string[] buttonlabels) | 1854 | public void SendDialogToUser(LLUUID avatarID, string objectName, LLUUID objectID, LLUUID ownerID, string message, LLUUID TextureID, int ch, string[] buttonlabels) |
1855 | { | 1855 | { |
1856 | if (m_scenePresences.ContainsKey(avatarID)) | 1856 | if (m_scenePresences.ContainsKey(avatarID)) |
1857 | { | 1857 | { |
1858 | m_scenePresences[avatarID].ControllingClient.SendDialog(objectName,objectID,ownerID,message,TextureID,ch,buttonlabels); | 1858 | m_scenePresences[avatarID].ControllingClient.SendDialog(objectName, objectID, ownerID, message, TextureID, ch, buttonlabels); |
1859 | } | 1859 | } |
1860 | } | 1860 | } |
1861 | 1861 | ||
@@ -1883,7 +1883,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1883 | m_LandManager.resetAllLandPrimCounts(); | 1883 | m_LandManager.resetAllLandPrimCounts(); |
1884 | m_eventManager.TriggerParcelPrimCountUpdate(); | 1884 | m_eventManager.TriggerParcelPrimCountUpdate(); |
1885 | m_LandManager.finalizeLandPrimCountUpdate(); | 1885 | m_LandManager.finalizeLandPrimCountUpdate(); |
1886 | m_LandManager.landPrimCountTainted = false; | 1886 | m_LandManager.landPrimCountTainted = false; |
1887 | } | 1887 | } |
1888 | 1888 | ||
1889 | /// <summary> | 1889 | /// <summary> |
@@ -1895,7 +1895,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1895 | { | 1895 | { |
1896 | if (obj is SceneObjectGroup) | 1896 | if (obj is SceneObjectGroup) |
1897 | { | 1897 | { |
1898 | m_eventManager.TriggerParcelPrimCountAdd((SceneObjectGroup) obj); | 1898 | m_eventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj); |
1899 | } | 1899 | } |
1900 | } | 1900 | } |
1901 | } | 1901 | } |
@@ -1910,9 +1910,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1910 | /// </summary> | 1910 | /// </summary> |
1911 | /// <param name="message">object containing the instant message data</param> | 1911 | /// <param name="message">object containing the instant message data</param> |
1912 | /// <returns>void</returns> | 1912 | /// <returns>void</returns> |
1913 | public void TriggerGridInstantMessage(GridInstantMessage message,InstantMessageReceiver options) | 1913 | public void TriggerGridInstantMessage(GridInstantMessage message, InstantMessageReceiver options) |
1914 | { | 1914 | { |
1915 | m_eventManager.TriggerGridInstantMessage(message,options); | 1915 | m_eventManager.TriggerGridInstantMessage(message, options); |
1916 | } | 1916 | } |
1917 | 1917 | ||
1918 | 1918 | ||
@@ -2096,8 +2096,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
2096 | if (controller.AgentId != godID) | 2096 | if (controller.AgentId != godID) |
2097 | controller.Kick(Helpers.FieldToUTF8String(reason)); | 2097 | controller.Kick(Helpers.FieldToUTF8String(reason)); |
2098 | 2098 | ||
2099 | 2099 | ||
2100 | 2100 | ||
2101 | } | 2101 | } |
2102 | ); | 2102 | ); |
2103 | // This is a bit crude. It seems the client will be null before it actually stops the thread | 2103 | // This is a bit crude. It seems the client will be null before it actually stops the thread |
@@ -2108,7 +2108,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2108 | ScenePresence p = GetScenePresence(controller.AgentId); | 2108 | ScenePresence p = GetScenePresence(controller.AgentId); |
2109 | bool childagent = !p.Equals(null) && p.IsChildAgent; | 2109 | bool childagent = !p.Equals(null) && p.IsChildAgent; |
2110 | if (controller.AgentId != godID && !childagent) | 2110 | if (controller.AgentId != godID && !childagent) |
2111 | // Do we really want to kick the initiator of this madness? | 2111 | // Do we really want to kick the initiator of this madness? |
2112 | { | 2112 | { |
2113 | controller.Close(true); | 2113 | controller.Close(true); |
2114 | } | 2114 | } |
@@ -2138,29 +2138,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
2138 | } | 2138 | } |
2139 | } | 2139 | } |
2140 | 2140 | ||
2141 | /// <summary> | 2141 | public void HandleObjectPermissionsUpdate(IClientAPI controller, LLUUID agentID, LLUUID sessionID, byte field, uint localId, uint mask, byte set) |
2142 | /// | ||
2143 | /// </summary> | ||
2144 | /// <param name="controller"></param> | ||
2145 | /// <param name="agentID"></param> | ||
2146 | /// <param name="sessionID"></param> | ||
2147 | /// <param name="permChanges"></param> | ||
2148 | public void HandleObjectPermissionsUpdate(IClientAPI controller, LLUUID agentID, LLUUID sessionID, | ||
2149 | List<ObjectPermissionsPacket.ObjectDataBlock> permChanges) | ||
2150 | { | 2142 | { |
2151 | // Check for spoofing.. since this is permissions we're talking about here! | 2143 | // Check for spoofing.. since this is permissions we're talking about here! |
2152 | if ((controller.SessionId == sessionID) && (controller.AgentId == agentID)) | 2144 | if ((controller.SessionId == sessionID) && (controller.AgentId == agentID)) |
2153 | { | 2145 | { |
2154 | for (int i = 0; i < permChanges.Count; i++) | 2146 | |
2155 | { | 2147 | // Tell the object to do permission update |
2156 | // Tell the object to do permission update | 2148 | SceneObjectGroup chObjectGroup = GetGroupByPrim(localId); |
2157 | byte field = permChanges[i].Field; | 2149 | chObjectGroup.UpdatePermissions(agentID, field, localId, mask, set); |
2158 | uint localID = permChanges[i].ObjectLocalID; | 2150 | |
2159 | uint mask = permChanges[i].Mask; | ||
2160 | byte addRemTF = permChanges[i].Set; | ||
2161 | SceneObjectGroup chObjectGroup = GetGroupByPrim(localID); | ||
2162 | chObjectGroup.UpdatePermissions(agentID, field, localID, mask, addRemTF); | ||
2163 | } | ||
2164 | } | 2151 | } |
2165 | } | 2152 | } |
2166 | 2153 | ||
@@ -2226,7 +2213,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2226 | { | 2213 | { |
2227 | if (ent is SceneObjectGroup) | 2214 | if (ent is SceneObjectGroup) |
2228 | { | 2215 | { |
2229 | ((SceneObjectGroup) ent).ScheduleGroupForFullUpdate(); | 2216 | ((SceneObjectGroup)ent).ScheduleGroupForFullUpdate(); |
2230 | } | 2217 | } |
2231 | } | 2218 | } |
2232 | } | 2219 | } |
@@ -2246,7 +2233,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2246 | { | 2233 | { |
2247 | if (ent is SceneObjectGroup) | 2234 | if (ent is SceneObjectGroup) |
2248 | { | 2235 | { |
2249 | SceneObjectPart part = ((SceneObjectGroup) ent).GetChildPart(((SceneObjectGroup) ent).UUID); | 2236 | SceneObjectPart part = ((SceneObjectGroup)ent).GetChildPart(((SceneObjectGroup)ent).UUID); |
2250 | if (part != null) | 2237 | if (part != null) |
2251 | { | 2238 | { |
2252 | if (part.Name == cmdparams[0]) | 2239 | if (part.Name == cmdparams[0]) |
@@ -2493,20 +2480,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
2493 | /// | 2480 | /// |
2494 | /// </summary> | 2481 | /// </summary> |
2495 | /// <param name="action"></param> | 2482 | /// <param name="action"></param> |
2496 | // public void ForEachObject(Action<SceneObjectGroup> action) | 2483 | // public void ForEachObject(Action<SceneObjectGroup> action) |
2497 | // { | 2484 | // { |
2498 | // List<SceneObjectGroup> presenceList; | 2485 | // List<SceneObjectGroup> presenceList; |
2499 | // | 2486 | // |
2500 | // lock (m_sceneObjects) | 2487 | // lock (m_sceneObjects) |
2501 | // { | 2488 | // { |
2502 | // presenceList = new List<SceneObjectGroup>(m_sceneObjects.Values); | 2489 | // presenceList = new List<SceneObjectGroup>(m_sceneObjects.Values); |
2503 | // } | 2490 | // } |
2504 | // | 2491 | // |
2505 | // foreach (SceneObjectGroup presence in presenceList) | 2492 | // foreach (SceneObjectGroup presence in presenceList) |
2506 | // { | 2493 | // { |
2507 | // action(presence); | 2494 | // action(presence); |
2508 | // } | 2495 | // } |
2509 | // } | 2496 | // } |
2510 | 2497 | ||
2511 | /// <summary> | 2498 | /// <summary> |
2512 | /// | 2499 | /// |