diff options
Diffstat (limited to 'OpenSim/Server/Handlers')
4 files changed, 23 insertions, 57 deletions
diff --git a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs index 7bb2f39..bd1ddbd 100644 --- a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.IO; | 29 | using System.IO; |
30 | using System.Net; | 30 | using System.Net; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Threading; | ||
32 | 33 | ||
33 | using Nini.Config; | 34 | using Nini.Config; |
34 | using log4net; | 35 | using log4net; |
@@ -70,6 +71,8 @@ namespace OpenSim.Server.Handlers.MapImage | |||
70 | 71 | ||
71 | class MapServerGetHandler : BaseStreamHandler | 72 | class MapServerGetHandler : BaseStreamHandler |
72 | { | 73 | { |
74 | public static ManualResetEvent ev = new ManualResetEvent(true); | ||
75 | |||
73 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 76 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
74 | 77 | ||
75 | private IMapImageService m_MapService; | 78 | private IMapImageService m_MapService; |
@@ -82,8 +85,13 @@ namespace OpenSim.Server.Handlers.MapImage | |||
82 | 85 | ||
83 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 86 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
84 | { | 87 | { |
85 | byte[] result = new byte[0]; | 88 | ev.WaitOne(); |
89 | lock (ev) | ||
90 | { | ||
91 | ev.Reset(); | ||
92 | } | ||
86 | 93 | ||
94 | byte[] result = new byte[0]; | ||
87 | string format = string.Empty; | 95 | string format = string.Empty; |
88 | result = m_MapService.GetMapTile(path.Trim('/'), out format); | 96 | result = m_MapService.GetMapTile(path.Trim('/'), out format); |
89 | if (result.Length > 0) | 97 | if (result.Length > 0) |
@@ -100,6 +108,11 @@ namespace OpenSim.Server.Handlers.MapImage | |||
100 | httpResponse.ContentType = "text/plain"; | 108 | httpResponse.ContentType = "text/plain"; |
101 | } | 109 | } |
102 | 110 | ||
111 | lock (ev) | ||
112 | { | ||
113 | ev.Set(); | ||
114 | } | ||
115 | |||
103 | return result; | 116 | return result; |
104 | } | 117 | } |
105 | 118 | ||
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs index 6403882..28dbbc2 100644 --- a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs +++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs | |||
@@ -104,8 +104,6 @@ namespace OpenSim.Server.Handlers.Profiles | |||
104 | Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest); | 104 | Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest); |
105 | Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate); | 105 | Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate); |
106 | Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate); | 106 | Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate); |
107 | Server.AddJsonRPCHandler("user_preferences_update", handler.UserPreferenecesUpdate); | ||
108 | Server.AddJsonRPCHandler("user_preferences_request", handler.UserPreferencesRequest); | ||
109 | Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); | 107 | Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); |
110 | Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); | 108 | Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); |
111 | Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); | 109 | Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); |
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs index d30cc22..f5f0794 100644 --- a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs +++ b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs | |||
@@ -381,59 +381,6 @@ namespace OpenSim.Server.Handlers | |||
381 | } | 381 | } |
382 | #endregion Interests | 382 | #endregion Interests |
383 | 383 | ||
384 | #region User Preferences | ||
385 | public bool UserPreferencesRequest(OSDMap json, ref JsonRpcResponse response) | ||
386 | { | ||
387 | if(!json.ContainsKey("params")) | ||
388 | { | ||
389 | response.Error.Code = ErrorCode.ParseError; | ||
390 | m_log.DebugFormat ("User Preferences Request"); | ||
391 | return false; | ||
392 | } | ||
393 | |||
394 | string result = string.Empty; | ||
395 | UserPreferences prefs = new UserPreferences(); | ||
396 | object Prefs = (object)prefs; | ||
397 | OSD.DeserializeMembers(ref Prefs, (OSDMap)json["params"]); | ||
398 | if(Service.UserPreferencesRequest(ref prefs, ref result)) | ||
399 | { | ||
400 | response.Result = OSD.SerializeMembers(prefs); | ||
401 | return true; | ||
402 | } | ||
403 | |||
404 | response.Error.Code = ErrorCode.InternalError; | ||
405 | response.Error.Message = string.Format("{0}", result); | ||
406 | m_log.InfoFormat("[PROFILES]: User preferences request error - {0}", response.Error.Message); | ||
407 | return false; | ||
408 | } | ||
409 | |||
410 | public bool UserPreferenecesUpdate(OSDMap json, ref JsonRpcResponse response) | ||
411 | { | ||
412 | if(!json.ContainsKey("params")) | ||
413 | { | ||
414 | response.Error.Code = ErrorCode.ParseError; | ||
415 | response.Error.Message = "no parameters supplied"; | ||
416 | m_log.DebugFormat ("User Preferences Update Request"); | ||
417 | return false; | ||
418 | } | ||
419 | |||
420 | string result = string.Empty; | ||
421 | UserPreferences prefs = new UserPreferences(); | ||
422 | object Prefs = (object)prefs; | ||
423 | OSD.DeserializeMembers(ref Prefs, (OSDMap)json["params"]); | ||
424 | if(Service.UserPreferencesUpdate(ref prefs, ref result)) | ||
425 | { | ||
426 | response.Result = OSD.SerializeMembers(prefs); | ||
427 | return true; | ||
428 | } | ||
429 | |||
430 | response.Error.Code = ErrorCode.InternalError; | ||
431 | response.Error.Message = string.Format("{0}", result); | ||
432 | m_log.InfoFormat("[PROFILES]: User preferences update error - {0}", response.Error.Message); | ||
433 | return false; | ||
434 | } | ||
435 | #endregion User Preferences | ||
436 | |||
437 | #region Utility | 384 | #region Utility |
438 | public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response) | 385 | public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response) |
439 | { | 386 | { |
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 4ac477f..964ccf8 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -386,7 +386,15 @@ namespace OpenSim.Server.Handlers.Simulation | |||
386 | // subclasses can override this | 386 | // subclasses can override this |
387 | protected virtual bool CreateAgent(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) | 387 | protected virtual bool CreateAgent(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) |
388 | { | 388 | { |
389 | return m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason); | 389 | reason = String.Empty; |
390 | |||
391 | Util.FireAndForget(x => | ||
392 | { | ||
393 | string r; | ||
394 | m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out r); | ||
395 | }); | ||
396 | |||
397 | return true; | ||
390 | } | 398 | } |
391 | } | 399 | } |
392 | 400 | ||