diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 68 |
1 files changed, 26 insertions, 42 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 7adfeca..04ce8d4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -79,12 +79,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
79 | private int m_timePhase = 24; | 79 | private int m_timePhase = 24; |
80 | 80 | ||
81 | private readonly Mutex updateLock; | 81 | private readonly Mutex updateLock; |
82 | 82 | ||
83 | /// <summary> | 83 | /// <summary> |
84 | /// Are we applying physics to any of the prims in this scene? | 84 | /// Are we applying physics to any of the prims in this scene? |
85 | /// </summary> | 85 | /// </summary> |
86 | public bool m_physicalPrim; | 86 | public bool m_physicalPrim; |
87 | 87 | ||
88 | public bool m_seeIntoRegionFromNeighbor; | 88 | public bool m_seeIntoRegionFromNeighbor; |
89 | public int MaxUndoCount = 5; | 89 | public int MaxUndoCount = 5; |
90 | private int m_RestartTimerCounter; | 90 | private int m_RestartTimerCounter; |
@@ -410,7 +410,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
410 | if (!CheckNeighborRegion(region)) | 410 | if (!CheckNeighborRegion(region)) |
411 | { | 411 | { |
412 | m_neighbours.Add(region); | 412 | m_neighbours.Add(region); |
413 | |||
414 | } | 413 | } |
415 | } | 414 | } |
416 | } | 415 | } |
@@ -430,9 +429,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
430 | } | 429 | } |
431 | } | 430 | } |
432 | return found; | 431 | return found; |
433 | |||
434 | |||
435 | } | 432 | } |
433 | |||
436 | public virtual void Restart(float seconds) | 434 | public virtual void Restart(float seconds) |
437 | { | 435 | { |
438 | // notifications are done in 15 second increments | 436 | // notifications are done in 15 second increments |
@@ -779,17 +777,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
779 | catch (AccessViolationException e) | 777 | catch (AccessViolationException e) |
780 | { | 778 | { |
781 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); | 779 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); |
782 | |||
783 | } | 780 | } |
784 | catch (NullReferenceException e) | 781 | catch (NullReferenceException e) |
785 | { | 782 | { |
786 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); | 783 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); |
787 | |||
788 | } | 784 | } |
789 | catch (InvalidOperationException e) | 785 | catch (InvalidOperationException e) |
790 | { | 786 | { |
791 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); | 787 | m_log.Error("[Scene]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); |
792 | |||
793 | } | 788 | } |
794 | catch (Exception e) | 789 | catch (Exception e) |
795 | { | 790 | { |
@@ -873,7 +868,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
873 | /// <returns></returns> | 868 | /// <returns></returns> |
874 | public void Backup() | 869 | public void Backup() |
875 | { | 870 | { |
876 | EventManager.TriggerOnBackup(m_storageManager.DataStore); | 871 | EventManager.TriggerOnBackup(m_storageManager.DataStore); |
877 | m_backingup = false; | 872 | m_backingup = false; |
878 | //return true; | 873 | //return true; |
879 | } | 874 | } |
@@ -1188,12 +1183,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1188 | continue; | 1183 | continue; |
1189 | 1184 | ||
1190 | LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA; | 1185 | LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA; |
1191 | |||
1192 | // Not sure why some of these are null, oh well. | ||
1193 | |||
1194 | |||
1195 | |||
1196 | 1186 | ||
1187 | // Not sure why some of these are null, oh well. | ||
1197 | 1188 | ||
1198 | int colorr = 255 - (int)(texcolor.R * 255f); | 1189 | int colorr = 255 - (int)(texcolor.R * 255f); |
1199 | int colorg = 255 - (int)(texcolor.G * 255f); | 1190 | int colorg = 255 - (int)(texcolor.G * 255f); |
@@ -1314,8 +1305,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
1314 | return; | 1305 | return; |
1315 | } | 1306 | } |
1316 | 1307 | ||
1317 | |||
1318 | |||
1319 | LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; | 1308 | LLUUID lastMapRegionUUID = m_regInfo.lastMapUUID; |
1320 | 1309 | ||
1321 | int lastMapRefresh = 0; | 1310 | int lastMapRefresh = 0; |
@@ -1325,23 +1314,25 @@ namespace OpenSim.Region.Environment.Scenes | |||
1325 | try | 1314 | try |
1326 | { | 1315 | { |
1327 | lastMapRefresh = Convert.ToInt32(m_regInfo.lastMapRefresh); | 1316 | lastMapRefresh = Convert.ToInt32(m_regInfo.lastMapRefresh); |
1328 | } catch (ArgumentException) | 1317 | } |
1329 | {} | 1318 | catch (ArgumentException) |
1319 | { | ||
1320 | } | ||
1330 | catch (FormatException) | 1321 | catch (FormatException) |
1331 | {} | 1322 | { |
1323 | } | ||
1332 | catch (OverflowException) | 1324 | catch (OverflowException) |
1333 | {} | 1325 | { |
1326 | } | ||
1334 | 1327 | ||
1335 | LLUUID TerrainImageLLUUID = LLUUID.Random(); | 1328 | LLUUID TerrainImageLLUUID = LLUUID.Random(); |
1336 | 1329 | ||
1337 | if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) | 1330 | if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) |
1338 | { | 1331 | { |
1339 | |||
1340 | m_regInfo.SaveLastMapUUID(TerrainImageLLUUID); | 1332 | m_regInfo.SaveLastMapUUID(TerrainImageLLUUID); |
1341 | 1333 | ||
1342 | m_log.Warn("[MAPTILE]: STORING MAPTILE IMAGE"); | 1334 | m_log.Warn("[MAPTILE]: STORING MAPTILE IMAGE"); |
1343 | //Extra protection.. probably not needed. | 1335 | //Extra protection.. probably not needed. |
1344 | |||
1345 | } | 1336 | } |
1346 | else | 1337 | else |
1347 | { | 1338 | { |
@@ -1349,16 +1340,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1349 | m_log.Warn("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID"); | 1340 | m_log.Warn("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID"); |
1350 | } | 1341 | } |
1351 | 1342 | ||
1352 | |||
1353 | |||
1354 | m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID; | 1343 | m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID; |
1355 | 1344 | ||
1356 | AssetBase asset = new AssetBase(); | 1345 | AssetBase asset = new AssetBase(); |
1357 | asset.FullID = m_regInfo.EstateSettings.terrainImageID; | 1346 | asset.FullID = m_regInfo.EstateSettings.terrainImageID; |
1358 | asset.Data = data; | 1347 | asset.Data = data; |
1359 | asset.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(); | 1348 | asset.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(); |
1360 | asset.Description = RegionInfo.RegionName; | 1349 | asset.Description = RegionInfo.RegionName; |
1361 | 1350 | ||
1362 | asset.Type = 0; | 1351 | asset.Type = 0; |
1363 | asset.Temporary = temporary; | 1352 | asset.Temporary = temporary; |
1364 | AssetCache.AddAsset(asset); | 1353 | AssetCache.AddAsset(asset); |
@@ -1379,22 +1368,23 @@ namespace OpenSim.Region.Environment.Scenes | |||
1379 | lastMapRefresh = Convert.ToInt32(m_regInfo.lastMapRefresh); | 1368 | lastMapRefresh = Convert.ToInt32(m_regInfo.lastMapRefresh); |
1380 | } | 1369 | } |
1381 | catch (ArgumentException) | 1370 | catch (ArgumentException) |
1382 | { } | 1371 | { |
1372 | } | ||
1383 | catch (FormatException) | 1373 | catch (FormatException) |
1384 | { } | 1374 | { |
1375 | } | ||
1385 | catch (OverflowException) | 1376 | catch (OverflowException) |
1386 | { } | 1377 | { |
1378 | } | ||
1387 | 1379 | ||
1388 | LLUUID TerrainImageLLUUID = LLUUID.Random(); | 1380 | LLUUID TerrainImageLLUUID = LLUUID.Random(); |
1389 | 1381 | ||
1390 | if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) | 1382 | if (lastMapRegionUUID == LLUUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) |
1391 | { | 1383 | { |
1392 | |||
1393 | m_regInfo.SaveLastMapUUID(TerrainImageLLUUID); | 1384 | m_regInfo.SaveLastMapUUID(TerrainImageLLUUID); |
1394 | 1385 | ||
1395 | //m_log.Warn(terrainImageID); | 1386 | //m_log.Warn(terrainImageID); |
1396 | //Extra protection.. probably not needed. | 1387 | //Extra protection.. probably not needed. |
1397 | |||
1398 | } | 1388 | } |
1399 | else | 1389 | else |
1400 | { | 1390 | { |
@@ -1402,7 +1392,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1402 | } | 1392 | } |
1403 | 1393 | ||
1404 | m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID; | 1394 | m_regInfo.EstateSettings.terrainImageID = TerrainImageLLUUID; |
1405 | 1395 | ||
1406 | AssetBase asset = new AssetBase(); | 1396 | AssetBase asset = new AssetBase(); |
1407 | asset.FullID = m_regInfo.EstateSettings.terrainImageID; | 1397 | asset.FullID = m_regInfo.EstateSettings.terrainImageID; |
1408 | asset.Data = data; | 1398 | asset.Data = data; |
@@ -1579,10 +1569,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1579 | { | 1569 | { |
1580 | //m_log.DebugFormat( | 1570 | //m_log.DebugFormat( |
1581 | // "[SCENE]: Scene.AddNewPrim() called for agent {0} in {1}", ownerID, RegionInfo.RegionName); | 1571 | // "[SCENE]: Scene.AddNewPrim() called for agent {0} in {1}", ownerID, RegionInfo.RegionName); |
1582 | 1572 | ||
1583 | SceneObjectGroup sceneOb = | 1573 | SceneObjectGroup sceneOb = |
1584 | new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); | 1574 | new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); |
1585 | 1575 | ||
1586 | SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); | 1576 | SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); |
1587 | // if grass or tree, make phantom | 1577 | // if grass or tree, make phantom |
1588 | //rootPart.TrimPermissions(); | 1578 | //rootPart.TrimPermissions(); |
@@ -2980,9 +2970,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
2980 | { | 2970 | { |
2981 | if (controller.AgentId != godID) | 2971 | if (controller.AgentId != godID) |
2982 | controller.Kick(Helpers.FieldToUTF8String(reason)); | 2972 | controller.Kick(Helpers.FieldToUTF8String(reason)); |
2983 | |||
2984 | |||
2985 | |||
2986 | } | 2973 | } |
2987 | ); | 2974 | ); |
2988 | 2975 | ||
@@ -3261,13 +3248,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
3261 | 3248 | ||
3262 | public void TriggerObjectChanged(uint localID, uint change) | 3249 | public void TriggerObjectChanged(uint localID, uint change) |
3263 | { | 3250 | { |
3264 | |||
3265 | m_eventManager.TriggerOnScriptChangedEvent(localID, change); | 3251 | m_eventManager.TriggerOnScriptChangedEvent(localID, change); |
3266 | } | 3252 | } |
3267 | 3253 | ||
3268 | public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos) | 3254 | public void TriggerAtTargetEvent(uint localID, uint handle, LLVector3 targetpos, LLVector3 currentpos) |
3269 | { | 3255 | { |
3270 | |||
3271 | m_eventManager.TriggerAtTargetEvent(localID, handle, targetpos, currentpos); | 3256 | m_eventManager.TriggerAtTargetEvent(localID, handle, targetpos, currentpos); |
3272 | } | 3257 | } |
3273 | 3258 | ||
@@ -3331,6 +3316,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
3331 | return false; | 3316 | return false; |
3332 | } | 3317 | } |
3333 | } | 3318 | } |
3319 | |||
3334 | public bool scriptDanger(uint localID, LLVector3 pos) | 3320 | public bool scriptDanger(uint localID, LLVector3 pos) |
3335 | { | 3321 | { |
3336 | SceneObjectPart part = GetSceneObjectPart(localID); | 3322 | SceneObjectPart part = GetSceneObjectPart(localID); |
@@ -3351,7 +3337,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
3351 | { | 3337 | { |
3352 | LLVector3 pos = part.GetWorldPosition(); | 3338 | LLVector3 pos = part.GetWorldPosition(); |
3353 | return scriptDanger(part, pos); | 3339 | return scriptDanger(part, pos); |
3354 | |||
3355 | } | 3340 | } |
3356 | else | 3341 | else |
3357 | { | 3342 | { |
@@ -3589,8 +3574,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
3589 | } | 3574 | } |
3590 | return visualParams; | 3575 | return visualParams; |
3591 | } | 3576 | } |
3592 | #endregion | ||
3593 | |||
3594 | 3577 | ||
3578 | #endregion | ||
3595 | } | 3579 | } |
3596 | } | 3580 | } |