aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorDiva Canto2009-09-14 10:29:28 -0700
committerDiva Canto2009-09-14 10:29:28 -0700
commit69b19a3b85cc18c417500da4acbf07ef21e0a8b4 (patch)
treed98fbb2dfe5f63e7f2dfff4efa4dacc7532036a9 /OpenSim/Region/Framework/Scenes
parentRemoved dependencies that OptionalModules had on IronPython and Puma. They ar... (diff)
parentlabel load and save iar commands as experimental. (diff)
downloadopensim-SC_OLD-69b19a3b85cc18c417500da4acbf07ef21e0a8b4.zip
opensim-SC_OLD-69b19a3b85cc18c417500da4acbf07ef21e0a8b4.tar.gz
opensim-SC_OLD-69b19a3b85cc18c417500da4acbf07ef21e0a8b4.tar.bz2
opensim-SC_OLD-69b19a3b85cc18c417500da4acbf07ef21e0a8b4.tar.xz
Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs146
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs26
4 files changed, 164 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 4ea283f..eb397f6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1136,7 +1136,7 @@ namespace OpenSim.Region.Framework.Scenes
1136 1136
1137 UUID newFolderID = UUID.Random(); 1137 UUID newFolderID = UUID.Random();
1138 1138
1139 InventoryFolderBase newFolder = new InventoryFolderBase(newFolderID, category, destID, 0xff, rootFolder.ID, rootFolder.Version); 1139 InventoryFolderBase newFolder = new InventoryFolderBase(newFolderID, category, destID, -1, rootFolder.ID, rootFolder.Version);
1140 InventoryService.AddFolder(newFolder); 1140 InventoryService.AddFolder(newFolder);
1141 1141
1142 foreach (UUID itemID in items) 1142 foreach (UUID itemID in items)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d95d9d3..0c2f991 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3253,18 +3253,18 @@ namespace OpenSim.Region.Framework.Scenes
3253 3253
3254 if (AuthorizationService != null) 3254 if (AuthorizationService != null)
3255 { 3255 {
3256 if(!AuthorizationService.IsAuthorizedForRegion(agent.AgentID.ToString(), RegionInfo.RegionID.ToString())) 3256 if (!AuthorizationService.IsAuthorizedForRegion(agent.AgentID.ToString(), RegionInfo.RegionID.ToString()))
3257 { 3257 {
3258 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the region", 3258 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the region",
3259 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); 3259 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
3260 return false; 3260 return false;
3261 } 3261 }
3262 } 3262 }
3263 3263
3264 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) 3264 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID))
3265 { 3265 {
3266 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist", 3266 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist",
3267 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); 3267 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
3268 reason = String.Format("Denied access to region {0}: You have been banned from that region.", 3268 reason = String.Format("Denied access to region {0}: You have been banned from that region.",
3269 RegionInfo.RegionName); 3269 RegionInfo.RegionName);
3270 return false; 3270 return false;
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 1c71a99..204c319 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -1074,7 +1074,7 @@ namespace OpenSim.Region.Framework.Scenes
1074 if (eq != null) 1074 if (eq != null)
1075 { 1075 {
1076 eq.TeleportFinishEvent(reg.RegionHandle, 13, endPoint, 1076 eq.TeleportFinishEvent(reg.RegionHandle, 13, endPoint,
1077 4, teleportFlags, capsPath, avatar.UUID); 1077 0, teleportFlags, capsPath, avatar.UUID);
1078 } 1078 }
1079 else 1079 else
1080 { 1080 {
@@ -1269,16 +1269,53 @@ namespace OpenSim.Region.Framework.Scenes
1269 if (scene.TestBorderCross(pos + northCross, Cardinals.N)) 1269 if (scene.TestBorderCross(pos + northCross, Cardinals.N))
1270 { 1270 {
1271 Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N); 1271 Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N);
1272 neighboury += (uint)(int)(b.BorderLine.Z/(int)Constants.RegionSize); 1272 neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize);
1273 } 1273 }
1274 else if (scene.TestBorderCross(pos + southCross, Cardinals.S)) 1274 else if (scene.TestBorderCross(pos + southCross, Cardinals.S))
1275 { 1275 {
1276 neighboury--; 1276 Border b = scene.GetCrossedBorder(pos + southCross, Cardinals.S);
1277 newpos.Y = Constants.RegionSize - enterDistance; 1277 if (b.TriggerRegionX == 0 && b.TriggerRegionY == 0)
1278 {
1279 neighboury--;
1280 newpos.Y = Constants.RegionSize - enterDistance;
1281 }
1282 else
1283 {
1284 neighboury = b.TriggerRegionY;
1285 neighbourx = b.TriggerRegionX;
1286
1287 Vector3 newposition = pos;
1288 newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize;
1289 newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize;
1290 agent.ControllingClient.SendAgentAlertMessage(
1291 String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false);
1292 InformClientToInitateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene);
1293 return;
1294 }
1278 } 1295 }
1279 1296
1280 neighbourx--; 1297 Border ba = scene.GetCrossedBorder(pos + westCross, Cardinals.W);
1281 newpos.X = Constants.RegionSize - enterDistance; 1298 if (ba.TriggerRegionX == 0 && ba.TriggerRegionY == 0)
1299 {
1300 neighbourx--;
1301 newpos.X = Constants.RegionSize - enterDistance;
1302 }
1303 else
1304 {
1305 neighboury = ba.TriggerRegionY;
1306 neighbourx = ba.TriggerRegionX;
1307
1308
1309 Vector3 newposition = pos;
1310 newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize;
1311 newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize;
1312 agent.ControllingClient.SendAgentAlertMessage(
1313 String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false);
1314 InformClientToInitateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene);
1315
1316
1317 return;
1318 }
1282 1319
1283 } 1320 }
1284 else if (scene.TestBorderCross(pos + eastCross, Cardinals.E)) 1321 else if (scene.TestBorderCross(pos + eastCross, Cardinals.E))
@@ -1289,8 +1326,24 @@ namespace OpenSim.Region.Framework.Scenes
1289 1326
1290 if (scene.TestBorderCross(pos + southCross, Cardinals.S)) 1327 if (scene.TestBorderCross(pos + southCross, Cardinals.S))
1291 { 1328 {
1292 neighboury--; 1329 Border ba = scene.GetCrossedBorder(pos + southCross, Cardinals.S);
1293 newpos.Y = Constants.RegionSize - enterDistance; 1330 if (ba.TriggerRegionX == 0 && ba.TriggerRegionY == 0)
1331 {
1332 neighboury--;
1333 newpos.Y = Constants.RegionSize - enterDistance;
1334 }
1335 else
1336 {
1337 neighboury = ba.TriggerRegionY;
1338 neighbourx = ba.TriggerRegionX;
1339 Vector3 newposition = pos;
1340 newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize;
1341 newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize;
1342 agent.ControllingClient.SendAgentAlertMessage(
1343 String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false);
1344 InformClientToInitateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene);
1345 return;
1346 }
1294 } 1347 }
1295 else if (scene.TestBorderCross(pos + northCross, Cardinals.N)) 1348 else if (scene.TestBorderCross(pos + northCross, Cardinals.N))
1296 { 1349 {
@@ -1298,16 +1351,33 @@ namespace OpenSim.Region.Framework.Scenes
1298 neighboury += (uint)(int)(c.BorderLine.Z / (int)Constants.RegionSize); 1351 neighboury += (uint)(int)(c.BorderLine.Z / (int)Constants.RegionSize);
1299 newpos.Y = enterDistance; 1352 newpos.Y = enterDistance;
1300 } 1353 }
1301 1354
1302 1355
1303 } 1356 }
1304 else if (scene.TestBorderCross(pos + southCross, Cardinals.S)) 1357 else if (scene.TestBorderCross(pos + southCross, Cardinals.S))
1305 { 1358 {
1306 neighboury--; 1359 Border b = scene.GetCrossedBorder(pos + southCross, Cardinals.S);
1307 newpos.Y = Constants.RegionSize - enterDistance; 1360 if (b.TriggerRegionX == 0 && b.TriggerRegionY == 0)
1361 {
1362 neighboury--;
1363 newpos.Y = Constants.RegionSize - enterDistance;
1364 }
1365 else
1366 {
1367 neighboury = b.TriggerRegionY;
1368 neighbourx = b.TriggerRegionX;
1369 Vector3 newposition = pos;
1370 newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize;
1371 newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize;
1372 agent.ControllingClient.SendAgentAlertMessage(
1373 String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false);
1374 InformClientToInitateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene);
1375 return;
1376 }
1308 } 1377 }
1309 else if (scene.TestBorderCross(pos + northCross, Cardinals.N)) 1378 else if (scene.TestBorderCross(pos + northCross, Cardinals.N))
1310 { 1379 {
1380
1311 Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N); 1381 Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N);
1312 neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize); 1382 neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize);
1313 newpos.Y = enterDistance; 1383 newpos.Y = enterDistance;
@@ -1342,9 +1412,61 @@ namespace OpenSim.Region.Framework.Scenes
1342 d.BeginInvoke(agent, newpos, neighbourx, neighboury, isFlying, CrossAgentToNewRegionCompleted, d); 1412 d.BeginInvoke(agent, newpos, neighbourx, neighboury, isFlying, CrossAgentToNewRegionCompleted, d);
1343 } 1413 }
1344 1414
1415 public delegate void InformClientToInitateTeleportToLocationDelegate(ScenePresence agent, uint regionX, uint regionY,
1416 Vector3 position,
1417 Scene initiatingScene);
1418
1419 public void InformClientToInitateTeleportToLocation(ScenePresence agent, uint regionX, uint regionY, Vector3 position,
1420 Scene initiatingScene)
1421 {
1422
1423 // This assumes that we know what our neighbors are.
1424
1425 InformClientToInitateTeleportToLocationDelegate d = InformClientToInitiateTeleportToLocationAsync;
1426 d.BeginInvoke(agent,regionX,regionY,position,initiatingScene,
1427 InformClientToInitiateTeleportToLocationCompleted,
1428 d);
1429 }
1430
1431 public void InformClientToInitiateTeleportToLocationAsync(ScenePresence agent, uint regionX, uint regionY, Vector3 position,
1432 Scene initiatingScene)
1433 {
1434 Thread.Sleep(10000);
1435 IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>();
1436 if (im != null)
1437 {
1438 UUID gotoLocation = Util.BuildFakeParcelID(
1439 Util.UIntsToLong(
1440 (regionX *
1441 (uint)Constants.RegionSize),
1442 (regionY *
1443 (uint)Constants.RegionSize)),
1444 (uint)(int)position.X,
1445 (uint)(int)position.Y,
1446 (uint)(int)position.Z);
1447 GridInstantMessage m = new GridInstantMessage(initiatingScene, UUID.Zero,
1448 "Region", agent.UUID,
1449 (byte)InstantMessageDialog.GodLikeRequestTeleport, false,
1450 "", gotoLocation, false, new Vector3(127, 0, 0),
1451 new Byte[0]);
1452 im.SendInstantMessage(m, delegate(bool success)
1453 {
1454 m_log.DebugFormat("[CLIENT]: Client Initiating Teleport sending IM success = {0}", success);
1455 });
1456
1457 }
1458 }
1459
1460 private void InformClientToInitiateTeleportToLocationCompleted(IAsyncResult iar)
1461 {
1462 InformClientToInitateTeleportToLocationDelegate icon =
1463 (InformClientToInitateTeleportToLocationDelegate) iar.AsyncState;
1464 icon.EndInvoke(iar);
1465 }
1466
1345 public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, bool isFlying); 1467 public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, bool isFlying);
1346 1468
1347 /// <summary> 1469 /// <summary>
1348 /// This Closes child agents on neighboring regions 1470 /// This Closes child agents on neighboring regions
1349 /// Calls an asynchronous method to do so.. so it doesn't lag the sim. 1471 /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
1350 /// </summary> 1472 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 1024857..23fe2d3 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -776,8 +776,20 @@ namespace OpenSim.Region.Framework.Scenes
776 // before the inventory is processed in MakeRootAgent. This fixes a race condition 776 // before the inventory is processed in MakeRootAgent. This fixes a race condition
777 // related to the handling of attachments 777 // related to the handling of attachments
778 //m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); 778 //m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
779 if (m_scene.TestBorderCross(pos, Cardinals.E))
780 {
781 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.E);
782 pos.X = crossedBorder.BorderLine.Z - 1;
783 }
784
785 if (m_scene.TestBorderCross(pos, Cardinals.N))
786 {
787 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.N);
788 pos.Y = crossedBorder.BorderLine.Z - 1;
789 }
790
779 791
780 if (pos.X < 0 || pos.X >= (int)Constants.RegionSize || pos.Y < 0 || pos.Y >= (int)Constants.RegionSize || pos.Z < 0) 792 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
781 { 793 {
782 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128); 794 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
783 795
@@ -795,7 +807,11 @@ namespace OpenSim.Region.Framework.Scenes
795 localAVHeight = m_avHeight; 807 localAVHeight = m_avHeight;
796 } 808 }
797 809
798 float posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y]; 810 float posZLimit = 0;
811
812 if (pos.X <Constants.RegionSize && pos.Y < Constants.RegionSize)
813 posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y];
814
799 float newPosZ = posZLimit + localAVHeight / 2; 815 float newPosZ = posZLimit + localAVHeight / 2;
800 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) 816 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
801 { 817 {
@@ -877,6 +893,7 @@ namespace OpenSim.Region.Framework.Scenes
877 m_isChildAgent = true; 893 m_isChildAgent = true;
878 m_scene.SwapRootAgentCount(true); 894 m_scene.SwapRootAgentCount(true);
879 RemoveFromPhysicalScene(); 895 RemoveFromPhysicalScene();
896
880 m_scene.EventManager.TriggerOnMakeChildAgent(this); 897 m_scene.EventManager.TriggerOnMakeChildAgent(this);
881 } 898 }
882 899
@@ -904,7 +921,7 @@ namespace OpenSim.Region.Framework.Scenes
904 bool isFlying = false; 921 bool isFlying = false;
905 if (m_physicsActor != null) 922 if (m_physicsActor != null)
906 isFlying = m_physicsActor.Flying; 923 isFlying = m_physicsActor.Flying;
907 924
908 RemoveFromPhysicalScene(); 925 RemoveFromPhysicalScene();
909 Velocity = new Vector3(0, 0, 0); 926 Velocity = new Vector3(0, 0, 0);
910 AbsolutePosition = pos; 927 AbsolutePosition = pos;
@@ -2412,7 +2429,8 @@ namespace OpenSim.Region.Framework.Scenes
2412 } 2429 }
2413 2430
2414 // followed suggestion from mic bowman. reversed the two lines below. 2431 // followed suggestion from mic bowman. reversed the two lines below.
2415 CheckForBorderCrossing(); 2432 if (m_parentID == 0 && m_physicsActor != null || m_parentID != 0) // Check that we have a physics actor or we're sitting on something
2433 CheckForBorderCrossing();
2416 CheckForSignificantMovement(); // sends update to the modules. 2434 CheckForSignificantMovement(); // sends update to the modules.
2417 } 2435 }
2418 } 2436 }