aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
diff options
context:
space:
mode:
authorDiva Canto2009-08-12 20:39:48 -0700
committerDiva Canto2009-08-12 20:39:48 -0700
commit7aa54593e0b6672979feec97b8151ed134388723 (patch)
treeeaa145993ba39c61f6cbfcd202deb50fbd125fe6 /OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
parent* Added two new packet handler implementations for inventory ops. This is sta... (diff)
downloadopensim-SC_OLD-7aa54593e0b6672979feec97b8151ed134388723.zip
opensim-SC_OLD-7aa54593e0b6672979feec97b8151ed134388723.tar.gz
opensim-SC_OLD-7aa54593e0b6672979feec97b8151ed134388723.tar.bz2
opensim-SC_OLD-7aa54593e0b6672979feec97b8151ed134388723.tar.xz
Redirected all calls to CachedUserProfile methods to the inventory service. Redirection of the RootFolder property is still todo. This compiles but probably inventory will be inconsistent.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs39
1 files changed, 15 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
index 102feaf..e61648c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs
@@ -33,6 +33,7 @@ using OpenSim.Framework;
33using OpenSim.Framework.Communications.Cache; 33using OpenSim.Framework.Communications.Cache;
34using OpenSim.Region.Framework.Interfaces; 34using OpenSim.Region.Framework.Interfaces;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Services.Interfaces;
36 37
37namespace OpenSim.Region.CoreModules.Avatar.Gestures 38namespace OpenSim.Region.CoreModules.Avatar.Gestures
38{ 39{
@@ -62,42 +63,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
62 63
63 public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) 64 public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId)
64 { 65 {
65 CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); 66 IInventoryService invService = m_scene.InventoryService;
66 67
67 if (userInfo != null) 68 InventoryItemBase item = invService.QueryItem(new InventoryItemBase(gestureId));
69 if (item != null)
68 { 70 {
69 InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId); 71 item.Flags = 1;
70 if (item != null) 72 invService.UpdateItem(item);
71 {
72 item.Flags = 1;
73 userInfo.UpdateItem(item);
74 }
75 else
76 m_log.ErrorFormat(
77 "[GESTURES]: Unable to find gesture to activate {0} for {1}", gestureId, client.Name);
78 } 73 }
79 else 74 else
80 m_log.ErrorFormat("[GESTURES]: Unable to find user {0}", client.Name); 75 m_log.WarnFormat(
76 "[GESTURES]: Unable to find gesture {0} to activate for {1}", gestureId, client.Name);
81 } 77 }
82 78
83 public virtual void DeactivateGesture(IClientAPI client, UUID gestureId) 79 public virtual void DeactivateGesture(IClientAPI client, UUID gestureId)
84 { 80 {
85 CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); 81 IInventoryService invService = m_scene.InventoryService;
86 82
87 if (userInfo != null) 83 InventoryItemBase item = invService.QueryItem(new InventoryItemBase(gestureId));
84 if (item != null)
88 { 85 {
89 InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId); 86 item.Flags = 0;
90 if (item != null) 87 invService.UpdateItem(item);
91 {
92 item.Flags = 0;
93 userInfo.UpdateItem(item);
94 }
95 else
96 m_log.ErrorFormat(
97 "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name);
98 } 88 }
99 else 89 else
100 m_log.ErrorFormat("[GESTURES]: Unable to find user {0}", client.Name); 90 m_log.ErrorFormat(
91 "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name);
101 } 92 }
102 } 93 }
103} \ No newline at end of file 94} \ No newline at end of file