aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2013-08-07 23:29:42 +0100
committerMelanie2013-08-07 23:29:42 +0100
commit005c69511dac490a8353233423a3152abf5580dd (patch)
treeabae7717af4af3ed7844f3747ab28398fdad9cdf /OpenSim/Region/Framework
parentMerge branch 'avination-current' into careminster (diff)
parentminor: add some method doc to ScenePresence fields used for entity transfer, ... (diff)
downloadopensim-SC-005c69511dac490a8353233423a3152abf5580dd.zip
opensim-SC-005c69511dac490a8353233423a3152abf5580dd.tar.gz
opensim-SC-005c69511dac490a8353233423a3152abf5580dd.tar.bz2
opensim-SC-005c69511dac490a8353233423a3152abf5580dd.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs OpenSim/Region/Framework/Scenes/Scene.Inventory.cs OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs59
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs36
3 files changed, 63 insertions, 38 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 8f6073a..550ab87 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -551,6 +551,9 @@ namespace OpenSim.Region.Framework.Scenes
551 { 551 {
552 //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); 552 //Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem");
553 553
554 if (!Permissions.CanTransferUserInventory(itemId, senderId, recipient))
555 return null;
556
554 InventoryItemBase item = new InventoryItemBase(itemId, senderId); 557 InventoryItemBase item = new InventoryItemBase(itemId, senderId);
555 item = InventoryService.GetItem(item); 558 item = InventoryService.GetItem(item);
556 559
@@ -2127,7 +2130,10 @@ namespace OpenSim.Region.Framework.Scenes
2127 { 2130 {
2128 // If we don't have permission, stop right here 2131 // If we don't have permission, stop right here
2129 if (!permissionToTakeCopy) 2132 if (!permissionToTakeCopy)
2133 {
2134 remoteClient.SendAlertMessage("You don't have permission to take the object");
2130 return; 2135 return;
2136 }
2131 2137
2132 permissionToTake = true; 2138 permissionToTake = true;
2133 // Don't delete 2139 // Don't delete
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0d9028c..aa09092 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4174,28 +4174,29 @@ namespace OpenSim.Region.Framework.Scenes
4174 } 4174 }
4175 } 4175 }
4176 4176
4177 if (RegionInfo.EstateSettings != null)
4178 {
4179 if (RegionInfo.EstateSettings.IsBanned(agent.AgentID, 0))
4180 {
4181 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist",
4182 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
4183 reason = String.Format("Denied access to region {0}: You have been banned from that region.",
4184 RegionInfo.RegionName);
4185 return false;
4186 }
4187 }
4188 else
4189 {
4190 m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!");
4191 }
4192
4193 // We only test the things below when we want to cut off 4177 // We only test the things below when we want to cut off
4194 // child agents from being present in the scene for which their root 4178 // child agents from being present in the scene for which their root
4195 // agent isn't allowed. Otherwise, we allow child agents. The test for 4179 // agent isn't allowed. Otherwise, we allow child agents. The test for
4196 // the root is done elsewhere (QueryAccess) 4180 // the root is done elsewhere (QueryAccess)
4197 if (!bypassAccessControl) 4181 if (!bypassAccessControl)
4198 { 4182 {
4183 if (RegionInfo.EstateSettings != null)
4184 {
4185 int flags = GetUserFlags(agent.AgentID);
4186 if (RegionInfo.EstateSettings.IsBanned(agent.AgentID, flags))
4187 {
4188 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user is on the banlist",
4189 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
4190 reason = String.Format("Denied access to region {0}: You have been banned from that region.",
4191 RegionInfo.RegionName);
4192 return false;
4193 }
4194 }
4195 else
4196 {
4197 m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!");
4198 }
4199
4199 List<UUID> agentGroups = new List<UUID>(); 4200 List<UUID> agentGroups = new List<UUID>();
4200 4201
4201 if (m_groupsModule != null) 4202 if (m_groupsModule != null)
@@ -4392,36 +4393,42 @@ namespace OpenSim.Region.Framework.Scenes
4392 } 4393 }
4393 4394
4394 // We have to wait until the viewer contacts this region 4395 // We have to wait until the viewer contacts this region
4395 // after receiving the EnableSimulator HTTP Event Queue message. This triggers the viewer to send 4396 // after receiving the EnableSimulator HTTP Event Queue message (for the v1 teleport protocol)
4397 // or TeleportFinish (for the v2 teleport protocol). This triggers the viewer to send
4396 // a UseCircuitCode packet which in turn calls AddNewClient which finally creates the ScenePresence. 4398 // a UseCircuitCode packet which in turn calls AddNewClient which finally creates the ScenePresence.
4397 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); 4399 ScenePresence sp = WaitGetScenePresence(cAgentData.AgentID);
4398 4400
4399 if (childAgentUpdate != null) 4401 if (sp != null)
4400 { 4402 {
4401 if (cAgentData.SessionID != childAgentUpdate.ControllingClient.SessionId) 4403 if (cAgentData.SessionID != sp.ControllingClient.SessionId)
4402 { 4404 {
4403 m_log.WarnFormat("[SCENE]: Attempt to update agent {0} with invalid session id {1} (possibly from simulator in older version; tell them to update).", childAgentUpdate.UUID, cAgentData.SessionID); 4405 m_log.WarnFormat(
4406 "[SCENE]: Attempt to update agent {0} with invalid session id {1} (possibly from simulator in older version; tell them to update).",
4407 sp.UUID, cAgentData.SessionID);
4408
4404 Console.WriteLine(String.Format("[SCENE]: Attempt to update agent {0} ({1}) with invalid session id {2}", 4409 Console.WriteLine(String.Format("[SCENE]: Attempt to update agent {0} ({1}) with invalid session id {2}",
4405 childAgentUpdate.UUID, childAgentUpdate.ControllingClient.SessionId, cAgentData.SessionID)); 4410 sp.UUID, sp.ControllingClient.SessionId, cAgentData.SessionID));
4406 } 4411 }
4407 4412
4408 childAgentUpdate.ChildAgentDataUpdate(cAgentData); 4413 sp.ChildAgentDataUpdate(cAgentData);
4409 4414
4410 int ntimes = 20; 4415 int ntimes = 20;
4411 if (cAgentData.SenderWantsToWaitForRoot) 4416 if (cAgentData.SenderWantsToWaitForRoot)
4412 { 4417 {
4413 while (childAgentUpdate.IsChildAgent && ntimes-- > 0) 4418 while (sp.IsChildAgent && ntimes-- > 0)
4414 Thread.Sleep(1000); 4419 Thread.Sleep(1000);
4415 4420
4416 m_log.DebugFormat( 4421 m_log.DebugFormat(
4417 "[SCENE]: Found presence {0} {1} {2} in {3} after {4} waits", 4422 "[SCENE]: Found presence {0} {1} {2} in {3} after {4} waits",
4418 childAgentUpdate.Name, childAgentUpdate.UUID, childAgentUpdate.IsChildAgent ? "child" : "root", RegionInfo.RegionName, 20 - ntimes); 4423 sp.Name, sp.UUID, sp.IsChildAgent ? "child" : "root", Name, 20 - ntimes);
4419 4424
4420 if (childAgentUpdate.IsChildAgent) 4425 if (sp.IsChildAgent)
4421 return false; 4426 return false;
4422 } 4427 }
4428
4423 return true; 4429 return true;
4424 } 4430 }
4431
4425 return false; 4432 return false;
4426 } 4433 }
4427 4434
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c4876b3..48bf6f3 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -294,10 +294,24 @@ namespace OpenSim.Region.Framework.Scenes
294 /// </summary> 294 /// </summary>
295 private Vector3 posLastSignificantMove; 295 private Vector3 posLastSignificantMove;
296 296
297 // For teleports and crossings callbacks 297 #region For teleports and crossings callbacks
298
299 /// <summary>
300 /// In the V1 teleport protocol, the destination simulator sends ReleaseAgent to this address.
301 /// </summary>
298 string m_callbackURI; 302 string m_callbackURI;
303
299 UUID m_originRegionID; 304 UUID m_originRegionID;
300 305
306 /// <summary>
307 /// Used by the entity transfer module to signal when the presence should not be closed because a subsequent
308 /// teleport is reusing the connection.
309 /// </summary>
310 /// <remarks>May be refactored or move somewhere else soon.</remarks>
311 public bool DoNotCloseAfterTeleport { get; set; }
312
313 #endregion
314
301 /// <value> 315 /// <value>
302 /// Script engines present in the scene 316 /// Script engines present in the scene
303 /// </value> 317 /// </value>
@@ -764,13 +778,6 @@ namespace OpenSim.Region.Framework.Scenes
764 } 778 }
765 } 779 }
766 780
767 /// <summary>
768 /// Used by the entity transfer module to signal when the presence should not be closed because a subsequent
769 /// teleport is reusing the connection.
770 /// </summary>
771 /// <remarks>May be refactored or move somewhere else soon.</remarks>
772 public bool DoNotCloseAfterTeleport { get; set; }
773
774 private float m_speedModifier = 1.0f; 781 private float m_speedModifier = 1.0f;
775 782
776 public float SpeedModifier 783 public float SpeedModifier
@@ -1516,14 +1523,14 @@ namespace OpenSim.Region.Framework.Scenes
1516 int count = 20; 1523 int count = 20;
1517 while (m_originRegionID.Equals(UUID.Zero) && count-- > 0) 1524 while (m_originRegionID.Equals(UUID.Zero) && count-- > 0)
1518 { 1525 {
1519 m_log.DebugFormat("[SCENE PRESENCE]: Agent {0} waiting for update in {1}", client.Name, Scene.RegionInfo.RegionName); 1526 m_log.DebugFormat("[SCENE PRESENCE]: Agent {0} waiting for update in {1}", client.Name, Scene.Name);
1520 Thread.Sleep(200); 1527 Thread.Sleep(200);
1521 } 1528 }
1522 1529
1523 if (m_originRegionID.Equals(UUID.Zero)) 1530 if (m_originRegionID.Equals(UUID.Zero))
1524 { 1531 {
1525 // Movement into region will fail 1532 // Movement into region will fail
1526 m_log.WarnFormat("[SCENE PRESENCE]: Update agent {0} never arrived", client.Name); 1533 m_log.WarnFormat("[SCENE PRESENCE]: Update agent {0} never arrived in {1}", client.Name, Scene.Name);
1527 return false; 1534 return false;
1528 } 1535 }
1529 1536
@@ -1829,8 +1836,14 @@ namespace OpenSim.Region.Framework.Scenes
1829 // Here's where you get them. 1836 // Here's where you get them.
1830 m_AgentControlFlags = flags; 1837 m_AgentControlFlags = flags;
1831 m_headrotation = agentData.HeadRotation; 1838 m_headrotation = agentData.HeadRotation;
1839 byte oldState = State;
1832 State = agentData.State; 1840 State = agentData.State;
1833 1841
1842 // We need to send this back to the client in order to stop the edit beams
1843 if ((oldState & (uint)AgentState.Editing) != 0 && State == (uint)AgentState.None)
1844 ControllingClient.SendAgentTerseUpdate(this);
1845
1846
1834 PhysicsActor actor = PhysicsActor; 1847 PhysicsActor actor = PhysicsActor;
1835 if (actor == null) 1848 if (actor == null)
1836 { 1849 {
@@ -3199,8 +3212,7 @@ namespace OpenSim.Region.Framework.Scenes
3199 } 3212 }
3200 3213
3201 // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m 3214 // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m
3202 if (Util.GetDistanceTo(AbsolutePosition, m_lastChildAgentUpdatePosition) >= Scene.ChildReprioritizationDistance || 3215 if (Util.GetDistanceTo(AbsolutePosition, m_lastChildAgentUpdatePosition) >= Scene.ChildReprioritizationDistance)
3203 Util.GetDistanceTo(CameraPosition, m_lastChildAgentUpdateCamPosition) >= Scene.ChildReprioritizationDistance)
3204 { 3216 {
3205 m_lastChildAgentUpdatePosition = AbsolutePosition; 3217 m_lastChildAgentUpdatePosition = AbsolutePosition;
3206 m_lastChildAgentUpdateCamPosition = CameraPosition; 3218 m_lastChildAgentUpdateCamPosition = CameraPosition;