diff options
author | Kitto Flora | 2011-01-20 06:52:10 +0000 |
---|---|---|
committer | Kitto Flora | 2011-01-20 06:52:10 +0000 |
commit | b92673c1c97b2c0f5d76be7d5093b7611483c5a0 (patch) | |
tree | 71632ad1bb4d79fb401316b723b6439682ea6f45 /OpenSim/Region | |
parent | Fix drift of static prim. (diff) | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC_OLD-b92673c1c97b2c0f5d76be7d5093b7611483c5a0.zip opensim-SC_OLD-b92673c1c97b2c0f5d76be7d5093b7611483c5a0.tar.gz opensim-SC_OLD-b92673c1c97b2c0f5d76be7d5093b7611483c5a0.tar.bz2 opensim-SC_OLD-b92673c1c97b2c0f5d76be7d5093b7611483c5a0.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region')
13 files changed, 217 insertions, 123 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e416d05..eb5c0f5 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3493,9 +3493,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3493 | ani.AnimationList[i].AnimSequenceID = seqs[i]; | 3493 | ani.AnimationList[i].AnimSequenceID = seqs[i]; |
3494 | 3494 | ||
3495 | ani.AnimationSourceList[i] = new AvatarAnimationPacket.AnimationSourceListBlock(); | 3495 | ani.AnimationSourceList[i] = new AvatarAnimationPacket.AnimationSourceListBlock(); |
3496 | ani.AnimationSourceList[i].ObjectID = objectIDs[i]; | 3496 | if (objectIDs[i].Equals(sourceAgentId)) |
3497 | if (objectIDs[i] == UUID.Zero) | 3497 | ani.AnimationSourceList[i].ObjectID = UUID.Zero; |
3498 | ani.AnimationSourceList[i].ObjectID = sourceAgentId; | 3498 | else |
3499 | ani.AnimationSourceList[i].ObjectID = objectIDs[i]; | ||
3499 | } | 3500 | } |
3500 | ani.Header.Reliable = false; | 3501 | ani.Header.Reliable = false; |
3501 | OutPacket(ani, ThrottleOutPacketType.Task); | 3502 | OutPacket(ani, ThrottleOutPacketType.Task); |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 6985449..f969bc3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -585,8 +585,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
585 | 585 | ||
586 | // Stats tracking | 586 | // Stats tracking |
587 | Interlocked.Increment(ref udpClient.PacketsSent); | 587 | Interlocked.Increment(ref udpClient.PacketsSent); |
588 | if (isReliable) | ||
589 | Interlocked.Add(ref udpClient.UnackedBytes, outgoingPacket.Buffer.DataLength); | ||
590 | 588 | ||
591 | // Put the UDP payload on the wire | 589 | // Put the UDP payload on the wire |
592 | AsyncBeginSend(buffer); | 590 | AsyncBeginSend(buffer); |
@@ -859,9 +857,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
859 | // Acknowledge the UseCircuitCode packet | 857 | // Acknowledge the UseCircuitCode packet |
860 | SendAckImmediate(remoteEndPoint, packet.Header.Sequence); | 858 | SendAckImmediate(remoteEndPoint, packet.Header.Sequence); |
861 | 859 | ||
862 | m_log.DebugFormat( | 860 | // m_log.DebugFormat( |
863 | "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", | 861 | // "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", |
864 | buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); | 862 | // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); |
865 | } | 863 | } |
866 | 864 | ||
867 | private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber) | 865 | private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber) |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs index 4cb4aee..9d40688 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Threading; | ||
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | 33 | ||
33 | namespace OpenSim.Region.ClientStack.LindenUDP | 34 | namespace OpenSim.Region.ClientStack.LindenUDP |
@@ -77,6 +78,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
77 | public void Add(OutgoingPacket packet) | 78 | public void Add(OutgoingPacket packet) |
78 | { | 79 | { |
79 | m_pendingAdds.Enqueue(packet); | 80 | m_pendingAdds.Enqueue(packet); |
81 | Interlocked.Add(ref packet.Client.UnackedBytes, packet.Buffer.DataLength); | ||
80 | } | 82 | } |
81 | 83 | ||
82 | /// <summary> | 84 | /// <summary> |
@@ -139,46 +141,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
139 | private void ProcessQueues() | 141 | private void ProcessQueues() |
140 | { | 142 | { |
141 | // Process all the pending adds | 143 | // Process all the pending adds |
142 | |||
143 | OutgoingPacket pendingAdd; | 144 | OutgoingPacket pendingAdd; |
144 | if (m_pendingAdds != null) | 145 | while (m_pendingAdds.TryDequeue(out pendingAdd)) |
145 | { | 146 | m_packets[pendingAdd.SequenceNumber] = pendingAdd; |
146 | while (m_pendingAdds.TryDequeue(out pendingAdd)) | ||
147 | { | ||
148 | if (pendingAdd != null && m_packets != null) | ||
149 | { | ||
150 | m_packets[pendingAdd.SequenceNumber] = pendingAdd; | ||
151 | } | ||
152 | } | ||
153 | } | ||
154 | 147 | ||
155 | // Process all the pending removes, including updating statistics and round-trip times | 148 | // Process all the pending removes, including updating statistics and round-trip times |
156 | PendingAck pendingRemove; | 149 | PendingAck pendingRemove; |
157 | OutgoingPacket ackedPacket; | 150 | OutgoingPacket ackedPacket; |
158 | if (m_pendingRemoves != null) | 151 | while (m_pendingRemoves.TryDequeue(out pendingRemove)) |
159 | { | 152 | { |
160 | while (m_pendingRemoves.TryDequeue(out pendingRemove)) | 153 | if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) |
161 | { | 154 | { |
162 | if (m_pendingRemoves != null && m_packets != null) | 155 | m_packets.Remove(pendingRemove.SequenceNumber); |
156 | |||
157 | // Update stats | ||
158 | Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); | ||
159 | |||
160 | if (!pendingRemove.FromResend) | ||
163 | { | 161 | { |
164 | if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) | 162 | // Calculate the round-trip time for this packet and its ACK |
165 | { | 163 | int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount; |
166 | m_packets.Remove(pendingRemove.SequenceNumber); | 164 | if (rtt > 0) |
167 | 165 | ackedPacket.Client.UpdateRoundTrip(rtt); | |
168 | // Update stats | ||
169 | System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); | ||
170 | |||
171 | if (!pendingRemove.FromResend) | ||
172 | { | ||
173 | // Calculate the round-trip time for this packet and its ACK | ||
174 | int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount; | ||
175 | if (rtt > 0) | ||
176 | ackedPacket.Client.UpdateRoundTrip(rtt); | ||
177 | } | ||
178 | } | ||
179 | } | 166 | } |
180 | } | 167 | } |
181 | } | 168 | } |
182 | } | 169 | } |
183 | } | 170 | } |
184 | } | 171 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs index 36aaab3..8347e35 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs | |||
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets | |||
102 | { | 102 | { |
103 | UUID capID = UUID.Random(); | 103 | UUID capID = UUID.Random(); |
104 | 104 | ||
105 | m_log.Info("[GETMESH]: /CAPS/" + capID); | 105 | // m_log.Info("[GETMESH]: /CAPS/" + capID); |
106 | caps.RegisterHandler("GetMesh", | 106 | caps.RegisterHandler("GetMesh", |
107 | new RestHTTPHandler("GET", "/CAPS/" + capID, | 107 | new RestHTTPHandler("GET", "/CAPS/" + capID, |
108 | delegate(Hashtable m_dhttpMethod) | 108 | delegate(Hashtable m_dhttpMethod) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 1f60e36..6fb8b46 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | |||
@@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
105 | { | 105 | { |
106 | UUID capID = UUID.Random(); | 106 | UUID capID = UUID.Random(); |
107 | 107 | ||
108 | m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); | 108 | // m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); |
109 | caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); | 109 | caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); |
110 | } | 110 | } |
111 | 111 | ||
@@ -171,7 +171,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
171 | /// <returns>False for "caller try another codec"; true otherwise</returns> | 171 | /// <returns>False for "caller try another codec"; true otherwise</returns> |
172 | private bool FetchTexture(OSHttpRequest httpRequest, OSHttpResponse httpResponse, UUID textureID, string format) | 172 | private bool FetchTexture(OSHttpRequest httpRequest, OSHttpResponse httpResponse, UUID textureID, string format) |
173 | { | 173 | { |
174 | m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format); | 174 | // m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format); |
175 | AssetBase texture; | 175 | AssetBase texture; |
176 | 176 | ||
177 | string fullID = textureID.ToString(); | 177 | string fullID = textureID.ToString(); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index 7303fe7..7df2beb 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
69 | item = invService.GetItem(item); | 69 | item = invService.GetItem(item); |
70 | if (item != null) | 70 | if (item != null) |
71 | { | 71 | { |
72 | item.Flags = 1; | 72 | item.Flags |= 1; |
73 | invService.UpdateItem(item); | 73 | invService.UpdateItem(item); |
74 | } | 74 | } |
75 | else | 75 | else |
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
85 | item = invService.GetItem(item); | 85 | item = invService.GetItem(item); |
86 | if (item != null) | 86 | if (item != null) |
87 | { | 87 | { |
88 | item.Flags = 0; | 88 | item.Flags &= ~(uint)1; |
89 | invService.UpdateItem(item); | 89 | invService.UpdateItem(item); |
90 | } | 90 | } |
91 | else | 91 | else |
@@ -93,4 +93,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
93 | "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); | 93 | "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | } \ No newline at end of file | 96 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 5ec64d5..a83b3df 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -31,16 +31,40 @@ using OpenMetaverse; | |||
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Framework.Scenes; | 32 | using OpenSim.Region.Framework.Scenes; |
33 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
34 | using System; | ||
35 | using System.Reflection; | ||
36 | using System.Collections; | ||
37 | using System.Collections.Specialized; | ||
38 | using System.Reflection; | ||
39 | using System.IO; | ||
40 | using System.Web; | ||
41 | using System.Xml; | ||
42 | using log4net; | ||
43 | using Mono.Addins; | ||
44 | using OpenMetaverse.Messages.Linden; | ||
45 | using OpenMetaverse.StructuredData; | ||
46 | using OpenSim.Framework.Capabilities; | ||
47 | using OpenSim.Framework.Servers; | ||
48 | using OpenSim.Framework.Servers.HttpServer; | ||
49 | using Caps = OpenSim.Framework.Capabilities.Caps; | ||
50 | using OSDArray = OpenMetaverse.StructuredData.OSDArray; | ||
51 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | ||
34 | 52 | ||
35 | namespace OpenSim.Region.CoreModules.Avatar.Gods | 53 | namespace OpenSim.Region.CoreModules.Avatar.Gods |
36 | { | 54 | { |
37 | public class GodsModule : IRegionModule, IGodsModule | 55 | public class GodsModule : IRegionModule, IGodsModule |
38 | { | 56 | { |
57 | private static readonly ILog m_log = | ||
58 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
59 | |||
39 | /// <summary>Special UUID for actions that apply to all agents</summary> | 60 | /// <summary>Special UUID for actions that apply to all agents</summary> |
40 | private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb"); | 61 | private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb"); |
41 | 62 | ||
42 | protected Scene m_scene; | 63 | protected Scene m_scene; |
43 | protected IDialogModule m_dialogModule; | 64 | protected IDialogModule m_dialogModule; |
65 | |||
66 | protected Dictionary<UUID, string> m_capsDict = | ||
67 | new Dictionary<UUID, string>(); | ||
44 | 68 | ||
45 | public void Initialise(Scene scene, IConfigSource source) | 69 | public void Initialise(Scene scene, IConfigSource source) |
46 | { | 70 | { |
@@ -48,6 +72,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
48 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); | 72 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); |
49 | m_scene.RegisterModuleInterface<IGodsModule>(this); | 73 | m_scene.RegisterModuleInterface<IGodsModule>(this); |
50 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | 74 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; |
75 | m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; | ||
76 | m_scene.EventManager.OnClientClosed += OnClientClosed; | ||
77 | scene.EventManager.OnIncomingInstantMessage += | ||
78 | OnIncomingInstantMessage; | ||
51 | } | 79 | } |
52 | 80 | ||
53 | public void PostInitialise() {} | 81 | public void PostInitialise() {} |
@@ -67,6 +95,54 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
67 | client.OnRequestGodlikePowers -= RequestGodlikePowers; | 95 | client.OnRequestGodlikePowers -= RequestGodlikePowers; |
68 | } | 96 | } |
69 | 97 | ||
98 | private void OnClientClosed(UUID agentID, Scene scene) | ||
99 | { | ||
100 | m_capsDict.Remove(agentID); | ||
101 | } | ||
102 | |||
103 | private void OnRegisterCaps(UUID agentID, Caps caps) | ||
104 | { | ||
105 | string uri = "/CAPS/" + UUID.Random(); | ||
106 | m_capsDict[agentID] = uri; | ||
107 | |||
108 | caps.RegisterHandler("UntrustedSimulatorMessage", | ||
109 | new RestStreamHandler("POST", uri, | ||
110 | HandleUntrustedSimulatorMessage)); | ||
111 | } | ||
112 | |||
113 | private string HandleUntrustedSimulatorMessage(string request, | ||
114 | string path, string param, OSHttpRequest httpRequest, | ||
115 | OSHttpResponse httpResponse) | ||
116 | { | ||
117 | OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request); | ||
118 | |||
119 | string message = osd["message"].AsString(); | ||
120 | |||
121 | if (message == "GodKickUser") | ||
122 | { | ||
123 | OSDMap body = (OSDMap)osd["body"]; | ||
124 | OSDArray userInfo = (OSDArray)body["UserInfo"]; | ||
125 | OSDMap userData = (OSDMap)userInfo[0]; | ||
126 | |||
127 | UUID agentID = userData["AgentID"].AsUUID(); | ||
128 | UUID godID = userData["GodID"].AsUUID(); | ||
129 | UUID godSessionID = userData["GodSessionID"].AsUUID(); | ||
130 | uint kickFlags = userData["KickFlags"].AsUInteger(); | ||
131 | string reason = userData["Reason"].AsString(); | ||
132 | |||
133 | ScenePresence god = m_scene.GetScenePresence(godID); | ||
134 | if (god == null || god.ControllingClient.SessionId != godSessionID) | ||
135 | return String.Empty; | ||
136 | |||
137 | KickUser(godID, godSessionID, agentID, kickFlags, Util.StringToBytes1024(reason)); | ||
138 | } | ||
139 | else | ||
140 | { | ||
141 | m_log.ErrorFormat("[GOD]: Unhandled UntrustedSimulatorMessage: {0}", message); | ||
142 | } | ||
143 | return String.Empty; | ||
144 | } | ||
145 | |||
70 | public void RequestGodlikePowers( | 146 | public void RequestGodlikePowers( |
71 | UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) | 147 | UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) |
72 | { | 148 | { |
@@ -115,71 +191,85 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
115 | /// <param name="reason">The message to send to the user after it's been turned into a field</param> | 191 | /// <param name="reason">The message to send to the user after it's been turned into a field</param> |
116 | public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) | 192 | public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason) |
117 | { | 193 | { |
118 | UUID kickUserID = ALL_AGENTS; | 194 | if (!m_scene.Permissions.IsGod(godID)) |
119 | 195 | return; | |
196 | |||
120 | ScenePresence sp = m_scene.GetScenePresence(agentID); | 197 | ScenePresence sp = m_scene.GetScenePresence(agentID); |
121 | 198 | ||
122 | if (sp != null || agentID == kickUserID) | 199 | if (sp == null && agentID != ALL_AGENTS) |
123 | { | 200 | { |
124 | if (m_scene.Permissions.IsGod(godID)) | 201 | IMessageTransferModule transferModule = |
202 | m_scene.RequestModuleInterface<IMessageTransferModule>(); | ||
203 | if (transferModule != null) | ||
125 | { | 204 | { |
126 | if (kickflags == 0) | 205 | m_log.DebugFormat("[GODS]: Sending nonlocal kill for agent {0}", agentID); |
127 | { | 206 | transferModule.SendInstantMessage(new GridInstantMessage( |
128 | if (agentID == kickUserID) | 207 | m_scene, godID, "God", agentID, (byte)250, false, |
129 | { | 208 | Utils.BytesToString(reason), UUID.Zero, true, |
130 | string reasonStr = Utils.BytesToString(reason); | 209 | new Vector3(), new byte[] {(byte)kickflags}), |
131 | 210 | delegate(bool success) {} ); | |
132 | m_scene.ForEachClient( | 211 | } |
133 | delegate(IClientAPI controller) | 212 | return; |
134 | { | 213 | } |
135 | if (controller.AgentId != godID) | ||
136 | controller.Kick(reasonStr); | ||
137 | } | ||
138 | ); | ||
139 | |||
140 | // This is a bit crude. It seems the client will be null before it actually stops the thread | ||
141 | // The thread will kill itself eventually :/ | ||
142 | // Is there another way to make sure *all* clients get this 'inter region' message? | ||
143 | m_scene.ForEachScenePresence( | ||
144 | delegate(ScenePresence p) | ||
145 | { | ||
146 | if (p.UUID != godID && !p.IsChildAgent) | ||
147 | { | ||
148 | // Possibly this should really be p.Close() though that method doesn't send a close | ||
149 | // to the client | ||
150 | p.ControllingClient.Close(); | ||
151 | } | ||
152 | } | ||
153 | ); | ||
154 | } | ||
155 | else | ||
156 | { | ||
157 | m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent); | ||
158 | 214 | ||
159 | sp.ControllingClient.Kick(Utils.BytesToString(reason)); | 215 | switch (kickflags) |
160 | sp.ControllingClient.Close(); | 216 | { |
161 | } | 217 | case 0: |
162 | } | 218 | if (sp != null) |
163 | 219 | { | |
164 | if (kickflags == 1) | 220 | KickPresence(sp, Utils.BytesToString(reason)); |
165 | { | ||
166 | sp.AllowMovement = false; | ||
167 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | ||
168 | m_dialogModule.SendAlertToUser(godID, "User Frozen"); | ||
169 | } | ||
170 | |||
171 | if (kickflags == 2) | ||
172 | { | ||
173 | sp.AllowMovement = true; | ||
174 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | ||
175 | m_dialogModule.SendAlertToUser(godID, "User Unfrozen"); | ||
176 | } | ||
177 | } | 221 | } |
178 | else | 222 | else if (agentID == ALL_AGENTS) |
179 | { | 223 | { |
180 | m_dialogModule.SendAlertToUser(godID, "Kick request denied"); | 224 | m_scene.ForEachScenePresence( |
225 | delegate(ScenePresence p) | ||
226 | { | ||
227 | if (p.UUID != godID && (!m_scene.Permissions.IsGod(p.UUID))) | ||
228 | KickPresence(p, Utils.BytesToString(reason)); | ||
229 | } | ||
230 | ); | ||
181 | } | 231 | } |
232 | break; | ||
233 | case 1: | ||
234 | if (sp != null) | ||
235 | { | ||
236 | sp.AllowMovement = false; | ||
237 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | ||
238 | m_dialogModule.SendAlertToUser(godID, "User Frozen"); | ||
239 | } | ||
240 | break; | ||
241 | case 2: | ||
242 | if (sp != null) | ||
243 | { | ||
244 | sp.AllowMovement = true; | ||
245 | m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason)); | ||
246 | m_dialogModule.SendAlertToUser(godID, "User Unfrozen"); | ||
247 | } | ||
248 | break; | ||
249 | default: | ||
250 | break; | ||
251 | } | ||
252 | } | ||
253 | |||
254 | private void KickPresence(ScenePresence sp, string reason) | ||
255 | { | ||
256 | if (sp.IsChildAgent) | ||
257 | return; | ||
258 | sp.ControllingClient.Kick(reason); | ||
259 | sp.Scene.IncomingCloseAgent(sp.UUID); | ||
260 | } | ||
261 | |||
262 | private void OnIncomingInstantMessage(GridInstantMessage msg) | ||
263 | { | ||
264 | if (msg.dialog == (uint)250) // Nonlocal kick | ||
265 | { | ||
266 | UUID agentID = new UUID(msg.toAgentID); | ||
267 | string reason = msg.message; | ||
268 | UUID godID = new UUID(msg.fromAgentID); | ||
269 | uint kickMode = (uint)msg.binaryBucket[0]; | ||
270 | |||
271 | KickUser(godID, UUID.Zero, agentID, kickMode, Util.StringToBytes1024(reason)); | ||
182 | } | 272 | } |
183 | } | 273 | } |
184 | } | 274 | } |
185 | } \ No newline at end of file | 275 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs index c011776..008233b 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
63 | { | 63 | { |
64 | UUID capuuid = UUID.Random(); | 64 | UUID capuuid = UUID.Random(); |
65 | 65 | ||
66 | m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); | 66 | // m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/"); |
67 | 67 | ||
68 | caps.RegisterHandler("ObjectAdd", | 68 | caps.RegisterHandler("ObjectAdd", |
69 | new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/", | 69 | new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/", |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index f9d28b9..e0f36a2 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -641,7 +641,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
641 | lock (m_openRequests) | 641 | lock (m_openRequests) |
642 | m_openRequests.Add(requestID, mrs); | 642 | m_openRequests.Add(requestID, mrs); |
643 | 643 | ||
644 | WebRequest mapitemsrequest = WebRequest.Create(httpserver); | 644 | WebRequest mapitemsrequest = null; |
645 | try | ||
646 | { | ||
647 | mapitemsrequest = WebRequest.Create(httpserver); | ||
648 | } | ||
649 | catch (Exception e) | ||
650 | { | ||
651 | m_log.DebugFormat("[WORLD MAP]: Access to {0} failed with {1}", httpserver, e); | ||
652 | return new OSDMap(); | ||
653 | } | ||
654 | |||
645 | mapitemsrequest.Method = "POST"; | 655 | mapitemsrequest.Method = "POST"; |
646 | mapitemsrequest.ContentType = "application/xml+llsd"; | 656 | mapitemsrequest.ContentType = "application/xml+llsd"; |
647 | OSDMap RAMap = new OSDMap(); | 657 | OSDMap RAMap = new OSDMap(); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index e1fedf4..48beb9c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -49,6 +49,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
49 | public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); | 49 | public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); |
50 | public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene); | 50 | public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene); |
51 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); | 51 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); |
52 | public delegate bool ViewObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); | ||
52 | public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene); | 53 | public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene); |
53 | public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene); | 54 | public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene); |
54 | public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene); | 55 | public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene); |
@@ -116,6 +117,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
116 | public event DuplicateObjectHandler OnDuplicateObject; | 117 | public event DuplicateObjectHandler OnDuplicateObject; |
117 | public event EditObjectHandler OnEditObject; | 118 | public event EditObjectHandler OnEditObject; |
118 | public event EditObjectInventoryHandler OnEditObjectInventory; | 119 | public event EditObjectInventoryHandler OnEditObjectInventory; |
120 | public event ViewObjectInventoryHandler OnViewObjectInventory; | ||
119 | public event MoveObjectHandler OnMoveObject; | 121 | public event MoveObjectHandler OnMoveObject; |
120 | public event ObjectEntryHandler OnObjectEntry; | 122 | public event ObjectEntryHandler OnObjectEntry; |
121 | public event ReturnObjectsHandler OnReturnObjects; | 123 | public event ReturnObjectsHandler OnReturnObjects; |
@@ -401,6 +403,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
401 | return true; | 403 | return true; |
402 | } | 404 | } |
403 | 405 | ||
406 | public bool CanViewObjectInventory(UUID objectID, UUID editorID) | ||
407 | { | ||
408 | ViewObjectInventoryHandler handler = OnViewObjectInventory; | ||
409 | if (handler != null) | ||
410 | { | ||
411 | Delegate[] list = handler.GetInvocationList(); | ||
412 | foreach (ViewObjectInventoryHandler h in list) | ||
413 | { | ||
414 | if (h(objectID, editorID, m_scene) == false) | ||
415 | return false; | ||
416 | } | ||
417 | } | ||
418 | return true; | ||
419 | } | ||
420 | |||
404 | #endregion | 421 | #endregion |
405 | 422 | ||
406 | #region MOVE OBJECT | 423 | #region MOVE OBJECT |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 066e504..a4f630a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -151,7 +151,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
151 | private int m_update_events = 1; | 151 | private int m_update_events = 1; |
152 | private int m_update_backup = 200; | 152 | private int m_update_backup = 200; |
153 | private int m_update_terrain = 50; | 153 | private int m_update_terrain = 50; |
154 | // private int m_update_land = 1; | 154 | private int m_update_land = 10; |
155 | private int m_update_coarse_locations = 50; | 155 | private int m_update_coarse_locations = 50; |
156 | 156 | ||
157 | private int frameMS; | 157 | private int frameMS; |
@@ -1330,12 +1330,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1330 | terrainMS = Util.EnvironmentTickCountSubtract(terMS); | 1330 | terrainMS = Util.EnvironmentTickCountSubtract(terMS); |
1331 | } | 1331 | } |
1332 | 1332 | ||
1333 | //if (m_frame % m_update_land == 0) | 1333 | if (m_frame % m_update_land == 0) |
1334 | //{ | 1334 | { |
1335 | // int ldMS = Util.EnvironmentTickCount(); | 1335 | int ldMS = Util.EnvironmentTickCount(); |
1336 | // UpdateLand(); | 1336 | UpdateLand(); |
1337 | // landMS = Util.EnvironmentTickCountSubtract(ldMS); | 1337 | landMS = Util.EnvironmentTickCountSubtract(ldMS); |
1338 | //} | 1338 | } |
1339 | 1339 | ||
1340 | frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS); | 1340 | frameMS = Util.EnvironmentTickCountSubtract(tmpFrameMS); |
1341 | otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; | 1341 | otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 8761284..2ee8c07 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -881,7 +881,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
881 | { | 881 | { |
882 | item.ParentID = m_part.UUID; | 882 | item.ParentID = m_part.UUID; |
883 | item.ParentPartID = m_part.UUID; | 883 | item.ParentPartID = m_part.UUID; |
884 | item.Flags = m_items[item.ItemID].Flags; | ||
885 | 884 | ||
886 | // If group permissions have been set on, check that the groupID is up to date in case it has | 885 | // If group permissions have been set on, check that the groupID is up to date in case it has |
887 | // changed since permissions were last set. | 886 | // changed since permissions were last set. |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 927f78d..6a3983f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1054,10 +1054,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1054 | //else | 1054 | //else |
1055 | // m_log.ErrorFormat("[SCENE]: Could not find user info for {0} when making it a root agent", m_uuid); | 1055 | // m_log.ErrorFormat("[SCENE]: Could not find user info for {0} when making it a root agent", m_uuid); |
1056 | 1056 | ||
1057 | // On the next prim update, all objects will be sent | ||
1058 | // | ||
1059 | m_sceneViewer.Reset(); | ||
1060 | |||
1061 | m_isChildAgent = false; | 1057 | m_isChildAgent = false; |
1062 | 1058 | ||
1063 | // send the animations of the other presences to me | 1059 | // send the animations of the other presences to me |
@@ -1241,7 +1237,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1241 | /// </summary> | 1237 | /// </summary> |
1242 | public void CompleteMovement(IClientAPI client) | 1238 | public void CompleteMovement(IClientAPI client) |
1243 | { | 1239 | { |
1244 | DateTime startTime = DateTime.Now; | 1240 | // DateTime startTime = DateTime.Now; |
1245 | 1241 | ||
1246 | m_log.DebugFormat( | 1242 | m_log.DebugFormat( |
1247 | "[SCENE PRESENCE]: Completing movement of {0} into region {1}", | 1243 | "[SCENE PRESENCE]: Completing movement of {0} into region {1}", |
@@ -1294,9 +1290,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1294 | friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); | 1290 | friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); |
1295 | } | 1291 | } |
1296 | 1292 | ||
1297 | m_log.DebugFormat( | 1293 | // m_log.DebugFormat( |
1298 | "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", | 1294 | // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", |
1299 | client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); | 1295 | // client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); |
1300 | } | 1296 | } |
1301 | 1297 | ||
1302 | /// <summary> | 1298 | /// <summary> |
@@ -3311,10 +3307,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3311 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) | 3307 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) |
3312 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); | 3308 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); |
3313 | 3309 | ||
3314 | // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. | ||
3315 | if (m_scene.m_seeIntoRegionFromNeighbor) | ||
3316 | m_sceneViewer.Reset(); | ||
3317 | |||
3318 | //cAgentData.AVHeight; | 3310 | //cAgentData.AVHeight; |
3319 | m_rootRegionHandle = cAgentData.RegionHandle; | 3311 | m_rootRegionHandle = cAgentData.RegionHandle; |
3320 | //m_velocity = cAgentData.Velocity; | 3312 | //m_velocity = cAgentData.Velocity; |