aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs2
-rw-r--r--OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs53
2 files changed, 55 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
index 28dbbc2..6403882 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
@@ -104,6 +104,8 @@ 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);
107 Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); 109 Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest);
108 Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); 110 Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData);
109 Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); 111 Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData);
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
index f5f0794..d30cc22 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
@@ -381,6 +381,59 @@ 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
384 #region Utility 437 #region Utility
385 public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response) 438 public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response)
386 { 439 {