diff options
author | Melanie | 2011-12-08 03:24:25 +0000 |
---|---|---|
committer | Melanie | 2011-12-08 03:24:25 +0000 |
commit | 50aa89dae66246395e9aac4d7d31f010e55473e8 (patch) | |
tree | b2d23662cc5a51e13f582728bf7064077f9edc32 | |
parent | Fix intersim object give messages (diff) | |
parent | Remove unused SceneManager.TryGetAvatarsScene() (diff) | |
download | opensim-SC_OLD-50aa89dae66246395e9aac4d7d31f010e55473e8.zip opensim-SC_OLD-50aa89dae66246395e9aac4d7d31f010e55473e8.tar.gz opensim-SC_OLD-50aa89dae66246395e9aac4d7d31f010e55473e8.tar.bz2 opensim-SC_OLD-50aa89dae66246395e9aac4d7d31f010e55473e8.tar.xz |
Merge commit 'eda770e978c09c756d15ba62dbbf6ee34a61b2f5' into bigmerge
Conflicts:
OpenSim/Region/Framework/Scenes/Scene.cs
19 files changed, 229 insertions, 106 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 468eeb4..256a971 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -135,16 +135,22 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
135 | availableMethods["admin_restart"] = XmlRpcRestartMethod; | 135 | availableMethods["admin_restart"] = XmlRpcRestartMethod; |
136 | availableMethods["admin_load_heightmap"] = XmlRpcLoadHeightmapMethod; | 136 | availableMethods["admin_load_heightmap"] = XmlRpcLoadHeightmapMethod; |
137 | availableMethods["admin_save_heightmap"] = XmlRpcSaveHeightmapMethod; | 137 | availableMethods["admin_save_heightmap"] = XmlRpcSaveHeightmapMethod; |
138 | |||
139 | // Agent management | ||
140 | availableMethods["admin_teleport_agent"] = XmlRpcTeleportAgentMethod; | ||
141 | |||
138 | // User management | 142 | // User management |
139 | availableMethods["admin_create_user"] = XmlRpcCreateUserMethod; | 143 | availableMethods["admin_create_user"] = XmlRpcCreateUserMethod; |
140 | availableMethods["admin_create_user_email"] = XmlRpcCreateUserMethod; | 144 | availableMethods["admin_create_user_email"] = XmlRpcCreateUserMethod; |
141 | availableMethods["admin_exists_user"] = XmlRpcUserExistsMethod; | 145 | availableMethods["admin_exists_user"] = XmlRpcUserExistsMethod; |
142 | availableMethods["admin_update_user"] = XmlRpcUpdateUserAccountMethod; | 146 | availableMethods["admin_update_user"] = XmlRpcUpdateUserAccountMethod; |
147 | |||
143 | // Region state management | 148 | // Region state management |
144 | availableMethods["admin_load_xml"] = XmlRpcLoadXMLMethod; | 149 | availableMethods["admin_load_xml"] = XmlRpcLoadXMLMethod; |
145 | availableMethods["admin_save_xml"] = XmlRpcSaveXMLMethod; | 150 | availableMethods["admin_save_xml"] = XmlRpcSaveXMLMethod; |
146 | availableMethods["admin_load_oar"] = XmlRpcLoadOARMethod; | 151 | availableMethods["admin_load_oar"] = XmlRpcLoadOARMethod; |
147 | availableMethods["admin_save_oar"] = XmlRpcSaveOARMethod; | 152 | availableMethods["admin_save_oar"] = XmlRpcSaveOARMethod; |
153 | |||
148 | // Estate access list management | 154 | // Estate access list management |
149 | availableMethods["admin_acl_clear"] = XmlRpcAccessListClear; | 155 | availableMethods["admin_acl_clear"] = XmlRpcAccessListClear; |
150 | availableMethods["admin_acl_add"] = XmlRpcAccessListAdd; | 156 | availableMethods["admin_acl_add"] = XmlRpcAccessListAdd; |
@@ -3073,6 +3079,112 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
3073 | return response; | 3079 | return response; |
3074 | } | 3080 | } |
3075 | 3081 | ||
3082 | public XmlRpcResponse XmlRpcTeleportAgentMethod(XmlRpcRequest request, IPEndPoint remoteClient) | ||
3083 | { | ||
3084 | XmlRpcResponse response = new XmlRpcResponse(); | ||
3085 | Hashtable responseData = new Hashtable(); | ||
3086 | |||
3087 | try | ||
3088 | { | ||
3089 | responseData["success"] = true; | ||
3090 | |||
3091 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
3092 | |||
3093 | CheckStringParameters(request, new string[] {"password"}); | ||
3094 | |||
3095 | FailIfRemoteAdminNotAllowed((string)requestData["password"], remoteClient.Address.ToString()); | ||
3096 | |||
3097 | UUID agentId; | ||
3098 | string regionName = null; | ||
3099 | Vector3 pos, lookAt; | ||
3100 | bool agentSpecified = false; | ||
3101 | ScenePresence sp = null; | ||
3102 | |||
3103 | if (requestData.Contains("agent_first_name") && requestData.Contains("agent_last_name")) | ||
3104 | { | ||
3105 | string firstName = requestData["agent_first_name"].ToString(); | ||
3106 | string lastName = requestData["agent_last_name"].ToString(); | ||
3107 | m_application.SceneManager.TryGetRootScenePresenceByName(firstName, lastName, out sp); | ||
3108 | |||
3109 | if (sp == null) | ||
3110 | throw new Exception( | ||
3111 | string.Format( | ||
3112 | "No agent found with agent_first_name {0} and agent_last_name {1}", firstName, lastName)); | ||
3113 | } | ||
3114 | else if (requestData.Contains("agent_id")) | ||
3115 | { | ||
3116 | string rawAgentId = (string)requestData["agent_id"]; | ||
3117 | |||
3118 | if (!UUID.TryParse(rawAgentId, out agentId)) | ||
3119 | throw new Exception(string.Format("agent_id {0} does not have the correct id format", rawAgentId)); | ||
3120 | |||
3121 | m_application.SceneManager.TryGetRootScenePresence(agentId, out sp); | ||
3122 | |||
3123 | if (sp == null) | ||
3124 | throw new Exception(string.Format("No agent with agent_id {0} found in this simulator", agentId)); | ||
3125 | } | ||
3126 | else | ||
3127 | { | ||
3128 | throw new Exception("No agent_id or agent_first_name and agent_last_name parameters specified"); | ||
3129 | } | ||
3130 | |||
3131 | if (requestData.Contains("region_name")) | ||
3132 | regionName = (string)requestData["region_name"]; | ||
3133 | |||
3134 | pos.X = ParseFloat(requestData, "pos_x", sp.AbsolutePosition.X); | ||
3135 | pos.Y = ParseFloat(requestData, "pos_y", sp.AbsolutePosition.Y); | ||
3136 | pos.Z = ParseFloat(requestData, "pos_z", sp.AbsolutePosition.Z); | ||
3137 | lookAt.X = ParseFloat(requestData, "lookat_x", sp.Lookat.X); | ||
3138 | lookAt.Y = ParseFloat(requestData, "lookat_y", sp.Lookat.Y); | ||
3139 | lookAt.Z = ParseFloat(requestData, "lookat_z", sp.Lookat.Z); | ||
3140 | |||
3141 | sp.Scene.RequestTeleportLocation( | ||
3142 | sp.ControllingClient, regionName, pos, lookAt, (uint)Constants.TeleportFlags.ViaLocation); | ||
3143 | } | ||
3144 | catch (Exception e) | ||
3145 | { | ||
3146 | m_log.ErrorFormat("[RADMIN]: admin_teleport_agent exception: {0}{1}", e.Message, e.StackTrace); | ||
3147 | |||
3148 | responseData["success"] = false; | ||
3149 | responseData["error"] = e.Message; | ||
3150 | } | ||
3151 | finally | ||
3152 | { | ||
3153 | response.Value = responseData; | ||
3154 | } | ||
3155 | |||
3156 | return response; | ||
3157 | } | ||
3158 | |||
3159 | /// <summary> | ||
3160 | /// Parse a float with the given parameter name from a request data hash table. | ||
3161 | /// </summary> | ||
3162 | /// <remarks> | ||
3163 | /// Will throw an exception if parameter is not a float. | ||
3164 | /// Will not throw if parameter is not found, passes back default value instead. | ||
3165 | /// </remarks> | ||
3166 | /// <param name="requestData"></param> | ||
3167 | /// <param name="paramName"></param> | ||
3168 | /// <param name="defaultVal"></param> | ||
3169 | /// <returns></returns> | ||
3170 | private static float ParseFloat(Hashtable requestData, string paramName, float defaultVal) | ||
3171 | { | ||
3172 | if (requestData.Contains(paramName)) | ||
3173 | { | ||
3174 | string rawVal = (string)requestData[paramName]; | ||
3175 | float val; | ||
3176 | |||
3177 | if (!float.TryParse(rawVal, out val)) | ||
3178 | throw new Exception(string.Format("{0} {1} is not a valid float", paramName, rawVal)); | ||
3179 | else | ||
3180 | return val; | ||
3181 | } | ||
3182 | else | ||
3183 | { | ||
3184 | return defaultVal; | ||
3185 | } | ||
3186 | } | ||
3187 | |||
3076 | private static void CheckStringParameters(XmlRpcRequest request, string[] param) | 3188 | private static void CheckStringParameters(XmlRpcRequest request, string[] param) |
3077 | { | 3189 | { |
3078 | Hashtable requestData = (Hashtable) request.Params[0]; | 3190 | Hashtable requestData = (Hashtable) request.Params[0]; |
@@ -3252,6 +3364,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
3252 | return false; | 3364 | return false; |
3253 | } | 3365 | } |
3254 | } | 3366 | } |
3367 | |||
3255 | private bool LoadHeightmap(string file, UUID regionID) | 3368 | private bool LoadHeightmap(string file, UUID regionID) |
3256 | { | 3369 | { |
3257 | m_log.InfoFormat("[RADMIN]: Terrain Loading: {0}", file); | 3370 | m_log.InfoFormat("[RADMIN]: Terrain Loading: {0}", file); |
diff --git a/OpenSim/Capabilities/CapsHandlers.cs b/OpenSim/Capabilities/CapsHandlers.cs index a0e9ebc..1709f46 100644 --- a/OpenSim/Capabilities/CapsHandlers.cs +++ b/OpenSim/Capabilities/CapsHandlers.cs | |||
@@ -51,11 +51,10 @@ namespace OpenSim.Framework.Capabilities | |||
51 | /// supplied BaseHttpServer. | 51 | /// supplied BaseHttpServer. |
52 | /// </summary> | 52 | /// </summary> |
53 | /// <param name="httpListener">base HTTP server</param> | 53 | /// <param name="httpListener">base HTTP server</param> |
54 | /// <param name="httpListenerHostname">host name of the HTTP | 54 | /// <param name="httpListenerHostname">host name of the HTTP server</param> |
55 | /// server</param> | ||
56 | /// <param name="httpListenerPort">HTTP port</param> | 55 | /// <param name="httpListenerPort">HTTP port</param> |
57 | public CapsHandlers(BaseHttpServer httpListener, string httpListenerHostname, uint httpListenerPort) | 56 | public CapsHandlers(BaseHttpServer httpListener, string httpListenerHostname, uint httpListenerPort) |
58 | : this (httpListener,httpListenerHostname,httpListenerPort, false) | 57 | : this(httpListener,httpListenerHostname,httpListenerPort, false) |
59 | { | 58 | { |
60 | } | 59 | } |
61 | 60 | ||
@@ -88,44 +87,52 @@ namespace OpenSim.Framework.Capabilities | |||
88 | /// handler to be removed</param> | 87 | /// handler to be removed</param> |
89 | public void Remove(string capsName) | 88 | public void Remove(string capsName) |
90 | { | 89 | { |
91 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[capsName].Path); | 90 | lock (m_capsHandlers) |
92 | m_httpListener.RemoveStreamHandler("GET", m_capsHandlers[capsName].Path); | 91 | { |
93 | m_capsHandlers.Remove(capsName); | 92 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[capsName].Path); |
93 | m_httpListener.RemoveStreamHandler("GET", m_capsHandlers[capsName].Path); | ||
94 | m_capsHandlers.Remove(capsName); | ||
95 | } | ||
94 | } | 96 | } |
95 | 97 | ||
96 | public bool ContainsCap(string cap) | 98 | public bool ContainsCap(string cap) |
97 | { | 99 | { |
98 | return m_capsHandlers.ContainsKey(cap); | 100 | lock (m_capsHandlers) |
101 | return m_capsHandlers.ContainsKey(cap); | ||
99 | } | 102 | } |
100 | 103 | ||
101 | /// <summary> | 104 | /// <summary> |
102 | /// The indexer allows us to treat the CapsHandlers object | 105 | /// The indexer allows us to treat the CapsHandlers object |
103 | /// in an intuitive dictionary like way. | 106 | /// in an intuitive dictionary like way. |
104 | /// </summary> | 107 | /// </summary> |
105 | /// <Remarks> | 108 | /// <remarks> |
106 | /// The indexer will throw an exception when you try to | 109 | /// The indexer will throw an exception when you try to |
107 | /// retrieve a cap handler for a cap that is not contained in | 110 | /// retrieve a cap handler for a cap that is not contained in |
108 | /// CapsHandlers. | 111 | /// CapsHandlers. |
109 | /// </Remarks> | 112 | /// </remarks> |
110 | public IRequestHandler this[string idx] | 113 | public IRequestHandler this[string idx] |
111 | { | 114 | { |
112 | get | 115 | get |
113 | { | 116 | { |
114 | return m_capsHandlers[idx]; | 117 | lock (m_capsHandlers) |
118 | return m_capsHandlers[idx]; | ||
115 | } | 119 | } |
116 | 120 | ||
117 | set | 121 | set |
118 | { | 122 | { |
119 | if (m_capsHandlers.ContainsKey(idx)) | 123 | lock (m_capsHandlers) |
120 | { | 124 | { |
121 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[idx].Path); | 125 | if (m_capsHandlers.ContainsKey(idx)) |
122 | m_capsHandlers.Remove(idx); | 126 | { |
127 | m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[idx].Path); | ||
128 | m_capsHandlers.Remove(idx); | ||
129 | } | ||
130 | |||
131 | if (null == value) return; | ||
132 | |||
133 | m_capsHandlers[idx] = value; | ||
134 | m_httpListener.AddStreamHandler(value); | ||
123 | } | 135 | } |
124 | |||
125 | if (null == value) return; | ||
126 | |||
127 | m_capsHandlers[idx] = value; | ||
128 | m_httpListener.AddStreamHandler(value); | ||
129 | } | 136 | } |
130 | } | 137 | } |
131 | 138 | ||
@@ -137,9 +144,12 @@ namespace OpenSim.Framework.Capabilities | |||
137 | { | 144 | { |
138 | get | 145 | get |
139 | { | 146 | { |
140 | string[] __keys = new string[m_capsHandlers.Keys.Count]; | 147 | lock (m_capsHandlers) |
141 | m_capsHandlers.Keys.CopyTo(__keys, 0); | 148 | { |
142 | return __keys; | 149 | string[] __keys = new string[m_capsHandlers.Keys.Count]; |
150 | m_capsHandlers.Keys.CopyTo(__keys, 0); | ||
151 | return __keys; | ||
152 | } | ||
143 | } | 153 | } |
144 | } | 154 | } |
145 | 155 | ||
@@ -157,15 +167,19 @@ namespace OpenSim.Framework.Capabilities | |||
157 | protocol = "https://"; | 167 | protocol = "https://"; |
158 | 168 | ||
159 | string baseUrl = protocol + m_httpListenerHostName + ":" + m_httpListenerPort.ToString(); | 169 | string baseUrl = protocol + m_httpListenerHostName + ":" + m_httpListenerPort.ToString(); |
160 | foreach (string capsName in m_capsHandlers.Keys) | 170 | |
171 | lock (m_capsHandlers) | ||
161 | { | 172 | { |
162 | if (excludeSeed && "SEED" == capsName) | 173 | foreach (string capsName in m_capsHandlers.Keys) |
163 | continue; | 174 | { |
175 | if (excludeSeed && "SEED" == capsName) | ||
176 | continue; | ||
164 | 177 | ||
165 | caps[capsName] = baseUrl + m_capsHandlers[capsName].Path; | 178 | caps[capsName] = baseUrl + m_capsHandlers[capsName].Path; |
179 | } | ||
166 | } | 180 | } |
167 | 181 | ||
168 | return caps; | 182 | return caps; |
169 | } | 183 | } |
170 | } | 184 | } |
171 | } | 185 | } \ No newline at end of file |
diff --git a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs index e3bf8cf..b7ca703 100644 --- a/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/UploadBakedTexture/UploadBakedTextureHandler.cs | |||
@@ -77,8 +77,6 @@ namespace OpenSim.Capabilities.Handlers | |||
77 | { | 77 | { |
78 | try | 78 | try |
79 | { | 79 | { |
80 | // m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " + m_regionName); | ||
81 | |||
82 | string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath; | 80 | string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath; |
83 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 81 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
84 | 82 | ||
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index 07de27a..eabb62d 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs | |||
@@ -232,9 +232,8 @@ namespace OpenSim.Framework.Console | |||
232 | 232 | ||
233 | string uri = "/ReadResponses/" + sessionID.ToString() + "/"; | 233 | string uri = "/ReadResponses/" + sessionID.ToString() + "/"; |
234 | 234 | ||
235 | m_Server.AddPollServiceHTTPHandler(uri, HandleHttpPoll, | 235 | m_Server.AddPollServiceHTTPHandler( |
236 | new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, | 236 | uri, new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, sessionID)); |
237 | sessionID)); | ||
238 | 237 | ||
239 | XmlDocument xmldoc = new XmlDocument(); | 238 | XmlDocument xmldoc = new XmlDocument(); |
240 | XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration, | 239 | XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration, |
@@ -266,11 +265,6 @@ namespace OpenSim.Framework.Console | |||
266 | return reply; | 265 | return reply; |
267 | } | 266 | } |
268 | 267 | ||
269 | private Hashtable HandleHttpPoll(Hashtable request) | ||
270 | { | ||
271 | return new Hashtable(); | ||
272 | } | ||
273 | |||
274 | private Hashtable HandleHttpCloseSession(Hashtable request) | 268 | private Hashtable HandleHttpCloseSession(Hashtable request) |
275 | { | 269 | { |
276 | DoExpire(); | 270 | DoExpire(); |
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index 76b731f..7b0fe37 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs | |||
@@ -90,9 +90,9 @@ namespace OpenSim.Framework | |||
90 | /// <summary> | 90 | /// <summary> |
91 | /// Is the agent denoted by the given agentID a child presence in this scene? | 91 | /// Is the agent denoted by the given agentID a child presence in this scene? |
92 | /// </summary> | 92 | /// </summary> |
93 | /// | 93 | /// <remarks> |
94 | /// Used by ClientView when a 'kick everyone' or 'estate message' occurs | 94 | /// Used by ClientView when a 'kick everyone' or 'estate message' occurs |
95 | /// | 95 | /// </remarks> |
96 | /// <param name="avatarID">AvatarID to lookup</param> | 96 | /// <param name="avatarID">AvatarID to lookup</param> |
97 | /// <returns>true if the presence is a child agent, false if the presence is a root exception</returns> | 97 | /// <returns>true if the presence is a child agent, false if the presence is a root exception</returns> |
98 | /// <exception cref="System.NullReferenceException"> | 98 | /// <exception cref="System.NullReferenceException"> |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 04739fe..2c0d8f0 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -227,21 +227,17 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
227 | return new List<string>(m_HTTPHandlers.Keys); | 227 | return new List<string>(m_HTTPHandlers.Keys); |
228 | } | 228 | } |
229 | 229 | ||
230 | public bool AddPollServiceHTTPHandler(string methodName, GenericHTTPMethod handler, PollServiceEventArgs args) | 230 | public bool AddPollServiceHTTPHandler(string methodName, PollServiceEventArgs args) |
231 | { | 231 | { |
232 | bool pollHandlerResult = false; | ||
233 | lock (m_pollHandlers) | 232 | lock (m_pollHandlers) |
234 | { | 233 | { |
235 | if (!m_pollHandlers.ContainsKey(methodName)) | 234 | if (!m_pollHandlers.ContainsKey(methodName)) |
236 | { | 235 | { |
237 | m_pollHandlers.Add(methodName,args); | 236 | m_pollHandlers.Add(methodName, args); |
238 | pollHandlerResult = true; | 237 | return true; |
239 | } | 238 | } |
240 | } | 239 | } |
241 | 240 | ||
242 | if (pollHandlerResult) | ||
243 | return AddHTTPHandler(methodName, handler); | ||
244 | |||
245 | return false; | 241 | return false; |
246 | } | 242 | } |
247 | 243 | ||
@@ -1871,8 +1867,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1871 | { | 1867 | { |
1872 | lock (m_pollHandlers) | 1868 | lock (m_pollHandlers) |
1873 | m_pollHandlers.Remove(path); | 1869 | m_pollHandlers.Remove(path); |
1874 | |||
1875 | RemoveHTTPHandler(httpMethod, path); | ||
1876 | } | 1870 | } |
1877 | 1871 | ||
1878 | public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) | 1872 | public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) |
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs index fd77984..db58f6f 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs | |||
@@ -77,8 +77,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
77 | /// true if the handler was successfully registered, false if a handler with the same name already existed. | 77 | /// true if the handler was successfully registered, false if a handler with the same name already existed. |
78 | /// </returns> | 78 | /// </returns> |
79 | bool AddHTTPHandler(string methodName, GenericHTTPMethod handler); | 79 | bool AddHTTPHandler(string methodName, GenericHTTPMethod handler); |
80 | 80 | ||
81 | bool AddPollServiceHTTPHandler(string methodName, GenericHTTPMethod handler, PollServiceEventArgs args); | 81 | bool AddPollServiceHTTPHandler(string methodName, PollServiceEventArgs args); |
82 | 82 | ||
83 | /// <summary> | 83 | /// <summary> |
84 | /// Adds a LLSD handler, yay. | 84 | /// Adds a LLSD handler, yay. |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index e8e4f19..50baa56 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -62,6 +62,7 @@ namespace OpenSim | |||
62 | 62 | ||
63 | // These are the names of the plugin-points extended by this | 63 | // These are the names of the plugin-points extended by this |
64 | // class during system startup. | 64 | // class during system startup. |
65 | // | ||
65 | 66 | ||
66 | private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache"; | 67 | private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache"; |
67 | private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient"; | 68 | private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient"; |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 9f27abc..8ba6f61 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -361,7 +361,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
361 | // This will persist this beyond the expiry of the caps handlers | 361 | // This will persist this beyond the expiry of the caps handlers |
362 | MainServer.Instance.AddPollServiceHTTPHandler( | 362 | MainServer.Instance.AddPollServiceHTTPHandler( |
363 | capsBase + EventQueueGetUUID.ToString() + "/", | 363 | capsBase + EventQueueGetUUID.ToString() + "/", |
364 | EventQueuePoll, | ||
365 | new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID)); | 364 | new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID)); |
366 | 365 | ||
367 | Random rnd = new Random(Environment.TickCount); | 366 | Random rnd = new Random(Environment.TickCount); |
@@ -578,11 +577,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
578 | // return responsedata; | 577 | // return responsedata; |
579 | // } | 578 | // } |
580 | 579 | ||
581 | public Hashtable EventQueuePoll(Hashtable request) | ||
582 | { | ||
583 | return new Hashtable(); | ||
584 | } | ||
585 | |||
586 | // public Hashtable EventQueuePath2(Hashtable request) | 580 | // public Hashtable EventQueuePath2(Hashtable request) |
587 | // { | 581 | // { |
588 | // string capuuid = (string)request["uri"]; //path.Replace("/CAPS/EQG/",""); | 582 | // string capuuid = (string)request["uri"]; //path.Replace("/CAPS/EQG/",""); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs index e61815f..45d6071 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs | |||
@@ -104,7 +104,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
104 | "UploadBakedTexture", | 104 | "UploadBakedTexture", |
105 | new RestStreamHandler( | 105 | new RestStreamHandler( |
106 | "POST", | 106 | "POST", |
107 | "/CAPS/" + m_uploadBakedTexturePath, | 107 | "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath, |
108 | new UploadBakedTextureHandler( | 108 | new UploadBakedTextureHandler( |
109 | caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture)); | 109 | caps, m_scene.AssetService, m_persistBakedTextures).UploadBakedTexture)); |
110 | } | 110 | } |
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 458426b..f5683f0 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -91,11 +91,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
91 | get { return null; } | 91 | get { return null; } |
92 | } | 92 | } |
93 | 93 | ||
94 | private Hashtable HandleHttpPoll(Hashtable request) | ||
95 | { | ||
96 | return new Hashtable(); | ||
97 | } | ||
98 | |||
99 | public string Name | 94 | public string Name |
100 | { | 95 | { |
101 | get { return "UrlModule"; } | 96 | get { return "UrlModule"; } |
@@ -171,9 +166,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
171 | 166 | ||
172 | string uri = "/lslhttp/" + urlcode.ToString(); | 167 | string uri = "/lslhttp/" + urlcode.ToString(); |
173 | 168 | ||
174 | m_HttpServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, | 169 | m_HttpServer.AddPollServiceHTTPHandler( |
175 | new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, | 170 | uri, |
176 | urlcode)); | 171 | new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode)); |
177 | 172 | ||
178 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); | 173 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); |
179 | } | 174 | } |
@@ -213,9 +208,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
213 | 208 | ||
214 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; | 209 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; |
215 | 210 | ||
216 | m_HttpsServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll, | 211 | m_HttpsServer.AddPollServiceHTTPHandler( |
217 | new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents, | 212 | uri, |
218 | urlcode)); | 213 | new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode)); |
219 | 214 | ||
220 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); | 215 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); |
221 | } | 216 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 171443e..f9ae39c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3241,37 +3241,38 @@ namespace OpenSim.Region.Framework.Scenes | |||
3241 | // Avatar is already disposed :/ | 3241 | // Avatar is already disposed :/ |
3242 | } | 3242 | } |
3243 | 3243 | ||
3244 | m_log.Debug("[Scene] Beginning OnRemovePresence"); | 3244 | try |
3245 | m_eventManager.TriggerOnRemovePresence(agentID); | 3245 | { |
3246 | m_log.Debug("[Scene] Finished OnRemovePresence"); | 3246 | m_eventManager.TriggerOnRemovePresence(agentID); |
3247 | 3247 | ||
3248 | if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) | 3248 | if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) |
3249 | AttachmentsModule.SaveChangedAttachments(avatar); | 3249 | AttachmentsModule.SaveChangedAttachments(avatar); |
3250 | 3250 | ||
3251 | if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) | 3251 | ForEachClient( |
3252 | AttachmentsModule.SaveChangedAttachments(avatar); | 3252 | delegate(IClientAPI client) |
3253 | 3253 | { | |
3254 | ForEachClient( | 3254 | //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway |
3255 | delegate(IClientAPI client) | 3255 | try { client.SendKillObject(avatar.RegionHandle, new List<uint> { avatar.LocalId }); } |
3256 | catch (NullReferenceException) { } | ||
3257 | }); | ||
3258 | |||
3259 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); | ||
3260 | if (agentTransactions != null) | ||
3256 | { | 3261 | { |
3257 | //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway | 3262 | agentTransactions.RemoveAgentAssetTransactions(agentID); |
3258 | try { client.SendKillObject(avatar.RegionHandle, new List<uint> { avatar.LocalId }); } | 3263 | } |
3259 | catch (NullReferenceException) { } | 3264 | } |
3260 | }); | 3265 | finally |
3261 | |||
3262 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); | ||
3263 | if (agentTransactions != null) | ||
3264 | { | 3266 | { |
3265 | agentTransactions.RemoveAgentAssetTransactions(agentID); | 3267 | // Always clean these structures up so that any failure above doesn't cause them to remain in the |
3268 | // scene with possibly bad effects (e.g. continually timing out on unacked packets and triggering | ||
3269 | // the same cleanup exception continually. | ||
3270 | // TODO: This should probably extend to the whole method, but we don't want to also catch the NRE | ||
3271 | // since this would hide the underlying failure and other associated problems. | ||
3272 | m_sceneGraph.RemoveScenePresence(agentID); | ||
3273 | m_clientManager.Remove(agentID); | ||
3266 | } | 3274 | } |
3267 | 3275 | ||
3268 | // Remove the avatar from the scene | ||
3269 | m_log.Debug("[Scene] Begin RemoveScenePresence"); | ||
3270 | m_sceneGraph.RemoveScenePresence(agentID); | ||
3271 | m_log.Debug("[Scene] Finished RemoveScenePresence. Removing the client manager"); | ||
3272 | m_clientManager.Remove(agentID); | ||
3273 | m_log.Debug("[Scene] Removed the client manager. Firing avatar.close"); | ||
3274 | |||
3275 | try | 3276 | try |
3276 | { | 3277 | { |
3277 | avatar.Close(); | 3278 | avatar.Close(); |
@@ -4390,7 +4391,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4390 | /// <param name="action"></param> | 4391 | /// <param name="action"></param> |
4391 | public void ForEachRootScenePresence(Action<ScenePresence> action) | 4392 | public void ForEachRootScenePresence(Action<ScenePresence> action) |
4392 | { | 4393 | { |
4393 | if(m_sceneGraph != null) | 4394 | if (m_sceneGraph != null) |
4394 | { | 4395 | { |
4395 | m_sceneGraph.ForEachAvatar(action); | 4396 | m_sceneGraph.ForEachAvatar(action); |
4396 | } | 4397 | } |
@@ -4470,9 +4471,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4470 | return m_sceneGraph.GetGroupByPrim(localID); | 4471 | return m_sceneGraph.GetGroupByPrim(localID); |
4471 | } | 4472 | } |
4472 | 4473 | ||
4473 | public override bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) | 4474 | public override bool TryGetScenePresence(UUID agentID, out ScenePresence sp) |
4474 | { | 4475 | { |
4475 | return m_sceneGraph.TryGetScenePresence(avatarId, out avatar); | 4476 | return m_sceneGraph.TryGetScenePresence(agentID, out sp); |
4476 | } | 4477 | } |
4477 | 4478 | ||
4478 | public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar) | 4479 | public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 0fd5164..29ab071 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -193,6 +193,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
193 | return false; | 193 | return false; |
194 | } | 194 | } |
195 | 195 | ||
196 | /// <summary> | ||
197 | /// Try to get a scene presence from the scene | ||
198 | /// </summary> | ||
199 | /// <param name="agentID"></param> | ||
200 | /// <param name="scenePresence">null if there is no scene presence with the given agent id</param> | ||
201 | /// <returns>true if there was a scene presence with the given id, false otherwise.</returns> | ||
196 | public abstract bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence); | 202 | public abstract bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence); |
197 | 203 | ||
198 | #endregion | 204 | #endregion |
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index 82458e2..d73a959 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs | |||
@@ -545,23 +545,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
545 | return false; | 545 | return false; |
546 | } | 546 | } |
547 | 547 | ||
548 | public bool TryGetAvatarsScene(UUID avatarId, out Scene scene) | 548 | public bool TryGetRootScenePresence(UUID avatarId, out ScenePresence avatar) |
549 | { | 549 | { |
550 | ScenePresence avatar = null; | ||
551 | |||
552 | lock (m_localScenes) | 550 | lock (m_localScenes) |
553 | { | 551 | { |
554 | foreach (Scene mScene in m_localScenes) | 552 | foreach (Scene scene in m_localScenes) |
555 | { | 553 | { |
556 | if (mScene.TryGetScenePresence(avatarId, out avatar)) | 554 | avatar = scene.GetScenePresence(avatarId); |
557 | { | 555 | |
558 | scene = mScene; | 556 | if (avatar != null && !avatar.IsChildAgent) |
559 | return true; | 557 | return true; |
560 | } | ||
561 | } | 558 | } |
562 | } | 559 | } |
563 | 560 | ||
564 | scene = null; | 561 | avatar = null; |
565 | return false; | 562 | return false; |
566 | } | 563 | } |
567 | 564 | ||
@@ -590,6 +587,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
590 | return false; | 587 | return false; |
591 | } | 588 | } |
592 | 589 | ||
590 | public bool TryGetRootScenePresenceByName(string firstName, string lastName, out ScenePresence sp) | ||
591 | { | ||
592 | lock (m_localScenes) | ||
593 | { | ||
594 | foreach (Scene scene in m_localScenes) | ||
595 | { | ||
596 | sp = scene.GetScenePresence(firstName, lastName); | ||
597 | if (sp != null && !sp.IsChildAgent) | ||
598 | return true; | ||
599 | } | ||
600 | } | ||
601 | |||
602 | sp = null; | ||
603 | return false; | ||
604 | } | ||
605 | |||
593 | public void ForEachScene(Action<Scene> action) | 606 | public void ForEachScene(Action<Scene> action) |
594 | { | 607 | { |
595 | lock (m_localScenes) | 608 | lock (m_localScenes) |
diff --git a/bin/Nini.dll b/bin/Nini.dll index c421005..2d16d95 100755 --- a/bin/Nini.dll +++ b/bin/Nini.dll | |||
Binary files differ | |||
diff --git a/bin/OpenMetaverse.Rendering.Meshmerizer.dll b/bin/OpenMetaverse.Rendering.Meshmerizer.dll index a6dec04..e0a3aa5 100755 --- a/bin/OpenMetaverse.Rendering.Meshmerizer.dll +++ b/bin/OpenMetaverse.Rendering.Meshmerizer.dll | |||
Binary files differ | |||
diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll index ed0a2d6..aa05418 100755 --- a/bin/OpenMetaverse.StructuredData.dll +++ b/bin/OpenMetaverse.StructuredData.dll | |||
Binary files differ | |||
diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll index 37ec47a..523f5a7 100755 --- a/bin/OpenMetaverse.dll +++ b/bin/OpenMetaverse.dll | |||
Binary files differ | |||
diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index 6f7fbac..e3356c9 100755 --- a/bin/OpenMetaverseTypes.dll +++ b/bin/OpenMetaverseTypes.dll | |||
Binary files differ | |||