aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2011-01-27 02:29:10 +0100
committerMelanie2011-01-27 02:29:10 +0100
commit3321f9d745ea782667b664365f23be75a2b047f5 (patch)
treeccb46a08ca26868049d269ecd68eac5bd94867da /OpenSim/Region
parentMake bans work for teleport. Now teleport will complete block if the user (diff)
parentMostly revert the last commit with the aim of searching for a better solution (diff)
downloadopensim-SC_OLD-3321f9d745ea782667b664365f23be75a2b047f5.zip
opensim-SC_OLD-3321f9d745ea782667b664365f23be75a2b047f5.tar.gz
opensim-SC_OLD-3321f9d745ea782667b664365f23be75a2b047f5.tar.bz2
opensim-SC_OLD-3321f9d745ea782667b664365f23be75a2b047f5.tar.xz
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs42
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs4
4 files changed, 50 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
index c023a6f..5c5cb70 100644
--- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs
@@ -88,7 +88,8 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
88 88
89 public void AddCapsHandler(UUID agentId) 89 public void AddCapsHandler(UUID agentId)
90 { 90 {
91 if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId)) 91 int flags = m_scene.GetUserFlags(agentId);
92 if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId, flags))
92 return; 93 return;
93 94
94 String capsObjectPath = GetCapsPath(agentId); 95 String capsObjectPath = GetCapsPath(agentId);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index fc4110b..6a5f84a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2443,7 +2443,8 @@ namespace OpenSim.Region.Framework.Scenes
2443 // If the user is banned, we won't let any of their objects 2443 // If the user is banned, we won't let any of their objects
2444 // enter. Period. 2444 // enter. Period.
2445 // 2445 //
2446 if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID)) 2446 int flags = GetUserFlags(sceneObject.OwnerID);
2447 if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID, flags))
2447 { 2448 {
2448 m_log.Info("[INTERREGION]: Denied prim crossing for " + 2449 m_log.Info("[INTERREGION]: Denied prim crossing for " +
2449 "banned avatar"); 2450 "banned avatar");
@@ -2547,6 +2548,22 @@ namespace OpenSim.Region.Framework.Scenes
2547 return 2; // StateSource.PrimCrossing 2548 return 2; // StateSource.PrimCrossing
2548 } 2549 }
2549 2550
2551 public int GetUserFlags(UUID user)
2552 {
2553 //Unfortunately the SP approach means that the value is cached until region is restarted
2554 /*
2555 ScenePresence sp;
2556 if (TryGetScenePresence(user, out sp))
2557 {
2558 return sp.UserFlags;
2559 }
2560 else
2561 {
2562 */
2563 UserAccount uac = UserAccountService.GetUserAccount(RegionInfo.ScopeID, user);
2564 return uac.UserFlags;
2565 //}
2566 }
2550 #endregion 2567 #endregion
2551 2568
2552 #region Add/Remove Avatar Methods 2569 #region Add/Remove Avatar Methods
@@ -3626,10 +3643,26 @@ namespace OpenSim.Region.Framework.Scenes
3626 3643
3627 if (m_regInfo.EstateSettings != null) 3644 if (m_regInfo.EstateSettings != null)
3628 { 3645 {
3629 if (m_regInfo.EstateSettings.IsBanned(agentID)) 3646 int flags = GetUserFlags(agent.AgentID);
3647 if (m_regInfo.EstateSettings.IsBanned(agentID, flags))
3630 { 3648 {
3631 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} at {1} because the user is on the banlist", 3649 //Add some more info to help users
3650 if (!m_regInfo.EstateSettings.IsBanned(agentID, 32))
3651 {
3652 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} at {1} because the region requires age verification",
3632 agentID, RegionInfo.RegionName); 3653 agentID, RegionInfo.RegionName);
3654 reason = String.Format("Denied access to region {0}: Region requires age verification", RegionInfo.RegionName);
3655 return false;
3656 }
3657 if (!m_regInfo.EstateSettings.IsBanned(agentID, 4))
3658 {
3659 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} {1} because the region requires payment info on file",
3660 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
3661 reason = String.Format("Denied access to region {0}: Region requires payment info on file", RegionInfo.RegionName);
3662 return false;
3663 }
3664 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} at {3} because the user is on the banlist",
3665 agent.AgentID, RegionInfo.RegionName);
3633 reason = String.Format("Denied access to region {0}: You have been banned from that region.", 3666 reason = String.Format("Denied access to region {0}: You have been banned from that region.",
3634 RegionInfo.RegionName); 3667 RegionInfo.RegionName);
3635 return false; 3668 return false;
@@ -3788,7 +3821,8 @@ namespace OpenSim.Region.Framework.Scenes
3788 3821
3789 // We have to wait until the viewer contacts this region after receiving EAC. 3822 // We have to wait until the viewer contacts this region after receiving EAC.
3790 // That calls AddNewClient, which finally creates the ScenePresence 3823 // That calls AddNewClient, which finally creates the ScenePresence
3791 if (m_regInfo.EstateSettings.IsBanned(cAgentData.AgentID)) 3824 int flags = GetUserFlags(cAgentData.AgentID);
3825 if (m_regInfo.EstateSettings.IsBanned(cAgentData.AgentID, flags))
3792 { 3826 {
3793 m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: banned", cAgentData.AgentID); 3827 m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: banned", cAgentData.AgentID);
3794 return false; 3828 return false;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 6a3983f..c4ae0f0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -113,6 +113,7 @@ namespace OpenSim.Region.Framework.Scenes
113 { 113 {
114 get { return m_attachments; } 114 get { return m_attachments; }
115 } 115 }
116
116 protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>(); 117 protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>();
117 118
118 private Dictionary<UUID, ScriptControllers> scriptedcontrols = new Dictionary<UUID, ScriptControllers>(); 119 private Dictionary<UUID, ScriptControllers> scriptedcontrols = new Dictionary<UUID, ScriptControllers>();
@@ -136,6 +137,12 @@ namespace OpenSim.Region.Framework.Scenes
136 private bool m_updateflag; 137 private bool m_updateflag;
137 private byte m_movementflag; 138 private byte m_movementflag;
138 private Vector3? m_forceToApply; 139 private Vector3? m_forceToApply;
140 private int m_userFlags;
141 public int UserFlags
142 {
143 get { return m_userFlags; }
144 }
145
139 private uint m_requestedSitTargetID; 146 private uint m_requestedSitTargetID;
140 private UUID m_requestedSitTargetUUID; 147 private UUID m_requestedSitTargetUUID;
141 public bool SitGround = false; 148 public bool SitGround = false;
@@ -763,6 +770,7 @@ namespace OpenSim.Region.Framework.Scenes
763 m_localId = m_scene.AllocateLocalId(); 770 m_localId = m_scene.AllocateLocalId();
764 771
765 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); 772 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
773 m_userFlags = account.UserFlags;
766 774
767 if (account != null) 775 if (account != null)
768 m_userLevel = account.UserLevel; 776 m_userLevel = account.UserLevel;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index dffc0bd..f5b7f5f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6938,13 +6938,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6938 public LSL_String llMD5String(string src, int nonce) 6938 public LSL_String llMD5String(string src, int nonce)
6939 { 6939 {
6940 m_host.AddScriptLPS(1); 6940 m_host.AddScriptLPS(1);
6941 return Util.Md5Hash(String.Format("{0}:{1}", src, nonce.ToString())); 6941 return Util.Md5Hash(String.Format("{0}:{1}", src, nonce.ToString()), Encoding.UTF8);
6942 } 6942 }
6943 6943
6944 public LSL_String llSHA1String(string src) 6944 public LSL_String llSHA1String(string src)
6945 { 6945 {
6946 m_host.AddScriptLPS(1); 6946 m_host.AddScriptLPS(1);
6947 return Util.SHA1Hash(src).ToLower(); 6947 return Util.SHA1Hash(src, Encoding.UTF8).ToLower();
6948 } 6948 }
6949 6949
6950 protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist) 6950 protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist)