aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs71
-rw-r--r--OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs9
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs17
4 files changed, 64 insertions, 40 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 273c128..7e1bed5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
98 /// <param name="godID">The person doing the kicking</param> 98 /// <param name="godID">The person doing the kicking</param>
99 /// <param name="sessionID">The session of the person doing the kicking</param> 99 /// <param name="sessionID">The session of the person doing the kicking</param>
100 /// <param name="agentID">the person that is being kicked</param> 100 /// <param name="agentID">the person that is being kicked</param>
101 /// <param name="kickflags">This isn't used apparently</param> 101 /// <param name="kickflags">Tells what to do to the user</param>
102 /// <param name="reason">The message to send to the user after it's been turned into a field</param> 102 /// <param name="reason">The message to send to the user after it's been turned into a field</param>
103 public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) 103 public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason)
104 { 104 {
@@ -110,39 +110,56 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
110 { 110 {
111 if (m_scene.Permissions.IsGod(godID)) 111 if (m_scene.Permissions.IsGod(godID))
112 { 112 {
113 if (agentID == kickUserID) 113 if (kickflags == 0)
114 { 114 {
115 string reasonStr = Utils.BytesToString(reason); 115 if (agentID == kickUserID)
116 {
117 string reasonStr = Utils.BytesToString(reason);
116 118
117 m_scene.ForEachClient( 119 m_scene.ForEachClient(
118 delegate(IClientAPI controller) 120 delegate(IClientAPI controller)
119 { 121 {
120 if (controller.AgentId != godID) 122 if (controller.AgentId != godID)
121 controller.Kick(reasonStr); 123 controller.Kick(reasonStr);
122 } 124 }
123 ); 125 );
124 126
125 // This is a bit crude. It seems the client will be null before it actually stops the thread 127 // This is a bit crude. It seems the client will be null before it actually stops the thread
126 // The thread will kill itself eventually :/ 128 // The thread will kill itself eventually :/
127 // Is there another way to make sure *all* clients get this 'inter region' message? 129 // Is there another way to make sure *all* clients get this 'inter region' message?
128 m_scene.ForEachScenePresence( 130 m_scene.ForEachScenePresence(
129 delegate(ScenePresence p) 131 delegate(ScenePresence p)
130 {
131 if (p.UUID != godID && !p.IsChildAgent)
132 { 132 {
133 // Possibly this should really be p.Close() though that method doesn't send a close 133 if (p.UUID != godID && !p.IsChildAgent)
134 // to the client 134 {
135 p.ControllingClient.Close(); 135 // Possibly this should really be p.Close() though that method doesn't send a close
136 // to the client
137 p.ControllingClient.Close();
138 }
136 } 139 }
137 } 140 );
138 ); 141 }
142 else
143 {
144 m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent);
145
146 sp.ControllingClient.Kick(Utils.BytesToString(reason));
147 sp.ControllingClient.Close();
148 }
139 } 149 }
140 else 150
151 if (kickflags == 1)
141 { 152 {
142 m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent); 153 sp.AllowMovement = false;
143 154 m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
144 sp.ControllingClient.Kick(Utils.BytesToString(reason)); 155 m_dialogModule.SendAlertToUser(godID, "User Frozen");
145 sp.ControllingClient.Close(); 156 }
157
158 if (kickflags == 2)
159 {
160 sp.AllowMovement = true;
161 m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
162 m_dialogModule.SendAlertToUser(godID, "User Unfrozen");
146 } 163 }
147 } 164 }
148 else 165 else
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
index d4a28e2..60df2e7 100644
--- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
@@ -602,9 +602,12 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
602 ListenerInfo info = 602 ListenerInfo info =
603 ListenerInfo.FromData(localID, itemID, hostID, item); 603 ListenerInfo.FromData(localID, itemID, hostID, item);
604 604
605 if (!m_listeners.ContainsKey((int)item[2])) 605 lock (m_listeners)
606 m_listeners.Add((int)item[2], new List<ListenerInfo>()); 606 {
607 m_listeners[(int)item[2]].Add(info); 607 if (!m_listeners.ContainsKey((int)item[2]))
608 m_listeners.Add((int)item[2], new List<ListenerInfo>());
609 m_listeners[(int)item[2]].Add(info);
610 }
608 611
609 idx+=6; 612 idx+=6;
610 } 613 }
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 34b81d8..af72968 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -454,6 +454,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
454 /// <summary> 454 /// <summary>
455 /// Resolve path to a working FileStream 455 /// Resolve path to a working FileStream
456 /// </summary> 456 /// </summary>
457 /// <param name="path"></param>
458 /// <returns></returns>
457 private Stream GetStream(string path) 459 private Stream GetStream(string path)
458 { 460 {
459 if (File.Exists(path)) 461 if (File.Exists(path))
@@ -500,8 +502,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
500 WebResponse response = request.GetResponse(); 502 WebResponse response = request.GetResponse();
501 Stream file = response.GetResponseStream(); 503 Stream file = response.GetResponseStream();
502 504
503 if (response.ContentType != "application/x-oar") 505 // justincc: gonna ignore the content type for now and just try anything
504 throw new Exception(String.Format("{0} does not identify an OAR file", uri.ToString())); 506 //if (response.ContentType != "application/x-oar")
507 // throw new Exception(String.Format("{0} does not identify an OAR file", uri.ToString()));
505 508
506 if (response.ContentLength == 0) 509 if (response.ContentLength == 0)
507 throw new Exception(String.Format("{0} returned an empty file", uri.ToString())); 510 throw new Exception(String.Format("{0} returned an empty file", uri.ToString()));
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 013a0ef..c9b3071 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -800,30 +800,31 @@ namespace OpenSim.Region.CoreModules.World.Permissions
800 } 800 }
801 801
802 protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers) 802 protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers)
803 { 803 {
804 bool permission = false;
805
806 if (parcel.LandData.OwnerID == user) 804 if (parcel.LandData.OwnerID == user)
807 { 805 {
808 permission = true; 806 // Returning immediately so that group deeded objects on group deeded land don't trigger a NRE on
807 // the subsequent redundant checks when using lParcelMediaCommandList()
808 // See http://opensimulator.org/mantis/view.php?id=3999 for more details
809 return true;
809 } 810 }
810 811
811 if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers)) 812 if (parcel.LandData.IsGroupOwned && IsGroupMember(parcel.LandData.GroupID, user, groupPowers))
812 { 813 {
813 permission = true; 814 return true;
814 } 815 }
815 816
816 if (IsEstateManager(user)) 817 if (IsEstateManager(user))
817 { 818 {
818 permission = true; 819 return true;
819 } 820 }
820 821
821 if (IsAdministrator(user)) 822 if (IsAdministrator(user))
822 { 823 {
823 permission = true; 824 return true;
824 } 825 }
825 826
826 return permission; 827 return false;
827 } 828 }
828 829
829 protected bool GenericParcelPermission(UUID user, Vector3 pos, ulong groupPowers) 830 protected bool GenericParcelPermission(UUID user, Vector3 pos, ulong groupPowers)