aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
diff options
context:
space:
mode:
authorDiva Canto2010-01-10 15:34:56 -0800
committerDiva Canto2010-01-10 15:34:56 -0800
commit4dd523b45d1e635c66eb4e556764fabe29dbfc58 (patch)
treedbd92b59418535e6c2967021124a906a9987088d /OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
parent* Last reference to CommsManager.UserProfileCacheService removed (diff)
downloadopensim-SC_OLD-4dd523b45d1e635c66eb4e556764fabe29dbfc58.zip
opensim-SC_OLD-4dd523b45d1e635c66eb4e556764fabe29dbfc58.tar.gz
opensim-SC_OLD-4dd523b45d1e635c66eb4e556764fabe29dbfc58.tar.bz2
opensim-SC_OLD-4dd523b45d1e635c66eb4e556764fabe29dbfc58.tar.xz
* Changed IPresenceService Logout, so that it takes a position and a lookat
* CommsManager.AvatarService rerouted
Diffstat (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs26
1 files changed, 15 insertions, 11 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
index 0a45eff..5429890 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
@@ -32,6 +32,7 @@ using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.Servers; 33using OpenSim.Framework.Servers;
34using OpenSim.Framework.Servers.HttpServer; 34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Services.Interfaces;
35 36
36namespace OpenSim.ApplicationPlugins.Rest.Inventory 37namespace OpenSim.ApplicationPlugins.Rest.Inventory
37{ 38{
@@ -295,15 +296,15 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
295 296
296 private void DoGet(AppearanceRequestData rdata) 297 private void DoGet(AppearanceRequestData rdata)
297 { 298 {
299 AvatarData adata = Rest.AvatarServices.GetAvatar(rdata.userProfile.ID);
298 300
299 rdata.userAppearance = Rest.AvatarServices.GetUserAppearance(rdata.userProfile.ID); 301 if (adata == null)
300
301 if (rdata.userAppearance == null)
302 { 302 {
303 rdata.Fail(Rest.HttpStatusCodeNoContent, 303 rdata.Fail(Rest.HttpStatusCodeNoContent,
304 String.Format("appearance data not found for user {0} {1}", 304 String.Format("appearance data not found for user {0} {1}",
305 rdata.userProfile.FirstName, rdata.userProfile.SurName)); 305 rdata.userProfile.FirstName, rdata.userProfile.SurName));
306 } 306 }
307 rdata.userAppearance = adata.ToAvatarAppearance();
307 308
308 rdata.initXmlWriter(); 309 rdata.initXmlWriter();
309 310
@@ -342,18 +343,20 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
342 // increasingly doubtful that it is appropriate for REST. If I attempt to 343 // increasingly doubtful that it is appropriate for REST. If I attempt to
343 // add a new record, and it already exists, then it seems to me that the 344 // add a new record, and it already exists, then it seems to me that the
344 // attempt should fail, rather than update the existing record. 345 // attempt should fail, rather than update the existing record.
345 346 AvatarData adata = null;
346 if (GetUserAppearance(rdata)) 347 if (GetUserAppearance(rdata))
347 { 348 {
348 modified = rdata.userAppearance != null; 349 modified = rdata.userAppearance != null;
349 created = !modified; 350 created = !modified;
350 Rest.AvatarServices.UpdateUserAppearance(rdata.userProfile.ID, rdata.userAppearance); 351 adata = new AvatarData(rdata.userAppearance);
352 Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
351 // Rest.UserServices.UpdateUserProfile(rdata.userProfile); 353 // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
352 } 354 }
353 else 355 else
354 { 356 {
355 created = true; 357 created = true;
356 Rest.AvatarServices.UpdateUserAppearance(rdata.userProfile.ID, rdata.userAppearance); 358 adata = new AvatarData(rdata.userAppearance);
359 Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
357 // Rest.UserServices.UpdateUserProfile(rdata.userProfile); 360 // Rest.UserServices.UpdateUserProfile(rdata.userProfile);
358 } 361 }
359 362
@@ -439,21 +442,22 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
439 442
440 private void DoDelete(AppearanceRequestData rdata) 443 private void DoDelete(AppearanceRequestData rdata)
441 { 444 {
445 AvatarData adata = Rest.AvatarServices.GetAvatar(rdata.userProfile.ID);
442 446
443 AvatarAppearance old = Rest.AvatarServices.GetUserAppearance(rdata.userProfile.ID); 447 if (adata != null)
444
445 if (old != null)
446 { 448 {
449 AvatarAppearance old = adata.ToAvatarAppearance();
447 rdata.userAppearance = new AvatarAppearance(); 450 rdata.userAppearance = new AvatarAppearance();
448
449 rdata.userAppearance.Owner = old.Owner; 451 rdata.userAppearance.Owner = old.Owner;
452 adata = new AvatarData(rdata.userAppearance);
450 453
451 Rest.AvatarServices.UpdateUserAppearance(rdata.userProfile.ID, rdata.userAppearance); 454 Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
452 455
453 rdata.Complete(); 456 rdata.Complete();
454 } 457 }
455 else 458 else
456 { 459 {
460
457 rdata.Complete(Rest.HttpStatusCodeNoContent); 461 rdata.Complete(Rest.HttpStatusCodeNoContent);
458 } 462 }
459 463