aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
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
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')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs19
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs9
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs26
3 files changed, 29 insertions, 25 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index a82d25a..eda2934 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -1430,8 +1430,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1430 private void establishAppearance(UUID dest, UUID srca) 1430 private void establishAppearance(UUID dest, UUID srca)
1431 { 1431 {
1432 m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", dest, srca); 1432 m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", dest, srca);
1433 1433 AvatarAppearance ava = null;
1434 AvatarAppearance ava = m_app.CommunicationsManager.AvatarService.GetUserAppearance(srca); 1434 AvatarData avatar = m_app.SceneManager.CurrentOrFirstScene.AvatarService.GetAvatar(srca);
1435 if (avatar != null)
1436 ava = avatar.ToAvatarAppearance();
1435 1437
1436 // If the model has no associated appearance we're done. 1438 // If the model has no associated appearance we're done.
1437 1439
@@ -1524,7 +1526,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1524 throw new Exception("Unable to load both inventories"); 1526 throw new Exception("Unable to load both inventories");
1525 } 1527 }
1526 1528
1527 m_app.CommunicationsManager.AvatarService.UpdateUserAppearance(dest, ava); 1529 AvatarData adata = new AvatarData(ava);
1530 m_app.SceneManager.CurrentOrFirstScene.AvatarService.SetAvatar(dest, adata);
1528 } 1531 }
1529 catch (Exception e) 1532 catch (Exception e)
1530 { 1533 {
@@ -1671,10 +1674,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1671 iserv.GetUserInventory(ID, uic.callback); 1674 iserv.GetUserInventory(ID, uic.callback);
1672 1675
1673 // While the inventory is being fetched, setup for appearance processing 1676 // While the inventory is being fetched, setup for appearance processing
1674 if ((mava = m_app.CommunicationsManager.AvatarService.GetUserAppearance(ID)) == null) 1677 AvatarData adata = m_app.SceneManager.CurrentOrFirstScene.AvatarService.GetAvatar(ID);
1675 { 1678 if (adata != null)
1679 mava = adata.ToAvatarAppearance();
1680 else
1676 mava = new AvatarAppearance(); 1681 mava = new AvatarAppearance();
1677 }
1678 1682
1679 { 1683 {
1680 AvatarWearable[] wearables = mava.Wearables; 1684 AvatarWearable[] wearables = mava.Wearables;
@@ -1809,7 +1813,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1809 m_log.DebugFormat("[RADMIN] Outfit {0} load completed", oname); 1813 m_log.DebugFormat("[RADMIN] Outfit {0} load completed", oname);
1810 } // foreach outfit 1814 } // foreach outfit
1811 m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name); 1815 m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name);
1812 m_app.CommunicationsManager.AvatarService.UpdateUserAppearance(ID, mava); 1816 AvatarData adata2 = new AvatarData(mava);
1817 m_app.SceneManager.CurrentOrFirstScene.AvatarService.SetAvatar(ID, adata2);
1813 } 1818 }
1814 catch (Exception e) 1819 catch (Exception e)
1815 { 1820 {
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs
index 791cfcd..c40ea0e 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs
@@ -36,7 +36,7 @@ using OpenSim.Framework;
36using OpenSim.Framework.Communications; 36using OpenSim.Framework.Communications;
37using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
38using IUserService = OpenSim.Framework.Communications.IUserService; 38using IUserService = OpenSim.Framework.Communications.IUserService;
39using IAvatarService = OpenSim.Framework.Communications.IAvatarService; 39using IAvatarService = OpenSim.Services.Interfaces.IAvatarService;
40 40
41namespace OpenSim.ApplicationPlugins.Rest.Inventory 41namespace OpenSim.ApplicationPlugins.Rest.Inventory
42{ 42{
@@ -93,11 +93,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
93 /// initializes. 93 /// initializes.
94 /// </summary> 94 /// </summary>
95 95
96 internal static CommunicationsManager Comms
97 {
98 get { return main.CommunicationsManager; }
99 }
100
101 internal static IInventoryService InventoryServices 96 internal static IInventoryService InventoryServices
102 { 97 {
103 get { return main.SceneManager.CurrentOrFirstScene.InventoryService; } 98 get { return main.SceneManager.CurrentOrFirstScene.InventoryService; }
@@ -115,7 +110,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
115 110
116 internal static IAvatarService AvatarServices 111 internal static IAvatarService AvatarServices
117 { 112 {
118 get { return Comms.AvatarService; } 113 get { return main.SceneManager.CurrentOrFirstScene.AvatarService; }
119 } 114 }
120 115
121 internal static IAssetService AssetServices 116 internal static IAssetService AssetServices
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