aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2007-12-15 19:42:23 +0000
committerJustin Clarke Casey2007-12-15 19:42:23 +0000
commitc63369017f0ac8e204f79978f20d5c2abdf5bef2 (patch)
tree97b26f9efc262bdf0d691e84bf19f2175124984b
parent* Added support for multiple terrain blocks to be edited at the same time (diff)
downloadopensim-SC_OLD-c63369017f0ac8e204f79978f20d5c2abdf5bef2.zip
opensim-SC_OLD-c63369017f0ac8e204f79978f20d5c2abdf5bef2.tar.gz
opensim-SC_OLD-c63369017f0ac8e204f79978f20d5c2abdf5bef2.tar.bz2
opensim-SC_OLD-c63369017f0ac8e204f79978f20d5c2abdf5bef2.tar.xz
* Make inventory operations sync rather than async. This is to alleviate race conditions such as that in mantis #190
* Make inventory messages more verbose. Hopefully they aren't now too verbose * This may resolve some grid instability but it's likely there's much more out there.
-rw-r--r--OpenSim/Grid/InventoryServer/GridInventoryService.cs36
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs14
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs37
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs5
4 files changed, 53 insertions, 39 deletions
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
index 6ae1d82..150a262 100644
--- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs
+++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
@@ -31,6 +31,7 @@ using System.Collections.Generic;
31using System.Text; 31using System.Text;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.Communications; 33using OpenSim.Framework.Communications;
34using OpenSim.Framework.Console;
34using libsecondlife; 35using libsecondlife;
35 36
36namespace OpenSim.Grid.InventoryServer 37namespace OpenSim.Grid.InventoryServer
@@ -105,9 +106,10 @@ namespace OpenSim.Grid.InventoryServer
105 106
106 public InventoryCollection GetUserInventory(Guid rawUserID) 107 public InventoryCollection GetUserInventory(Guid rawUserID)
107 { 108 {
108 Console.WriteLine("Request for Inventory for " + rawUserID.ToString());
109 LLUUID userID = new LLUUID(rawUserID); 109 LLUUID userID = new LLUUID(rawUserID);
110 110
111 MainLog.Instance.Verbose("INVENTORY", "Request for inventory for " + userID.ToStringHyphenated());
112
111 InventoryCollection invCollection = new InventoryCollection(); 113 InventoryCollection invCollection = new InventoryCollection();
112 List<InventoryFolderBase> folders; 114 List<InventoryFolderBase> folders;
113 List<InventoryItemBase> allItems; 115 List<InventoryItemBase> allItems;
@@ -124,7 +126,9 @@ namespace OpenSim.Grid.InventoryServer
124 { 126 {
125 LLUUID userID = new LLUUID(rawUserID); 127 LLUUID userID = new LLUUID(rawUserID);
126 128
127 Console.WriteLine("Creating New Set of Inventory Folders for " + userID.ToStringHyphenated()); 129 MainLog.Instance.Verbose(
130 "INVENTORY", "Creating new set of inventory folders for " + userID.ToStringHyphenated());
131
128 CreateNewUserInventory(userID); 132 CreateNewUserInventory(userID);
129 return true; 133 return true;
130 } 134 }
@@ -145,27 +149,49 @@ namespace OpenSim.Grid.InventoryServer
145 AddItem(item); 149 AddItem(item);
146 } 150 }
147 151
148 public bool AddInventoryFolder( InventoryFolderBase folder) 152 public bool AddInventoryFolder(InventoryFolderBase folder)
149 { 153 {
154 // Right now, this actions act more like an update/insert combination than a simple create.
155 MainLog.Instance.Verbose(
156 "INVENTORY",
157 "Updating in " + folder.parentID.ToStringHyphenated()
158 + ", folder " + folder.name);
159
150 AddNewInventoryFolder(folder.agentID, folder); 160 AddNewInventoryFolder(folder.agentID, folder);
151 return true; 161 return true;
152 } 162 }
153 163
154 public bool MoveInventoryFolder(InventoryFolderBase folder) 164 public bool MoveInventoryFolder(InventoryFolderBase folder)
155 { 165 {
166 MainLog.Instance.Verbose(
167 "INVENTORY",
168 "Moving folder " + folder.folderID
169 + " to " + folder.parentID.ToStringHyphenated());
170
156 MoveExistingInventoryFolder(folder); 171 MoveExistingInventoryFolder(folder);
157 return true; 172 return true;
158 } 173 }
159 174
160 public bool AddInventoryItem( InventoryItemBase item) 175 public bool AddInventoryItem( InventoryItemBase item)
161 { 176 {
162 Console.WriteLine("creating new item for " + item.avatarID.ToString()); 177 // Right now, this actions act more like an update/insert combination than a simple create.
178 MainLog.Instance.Verbose(
179 "INVENTORY",
180 "Updating in " + item.parentFolderID.ToStringHyphenated()
181 + ", item " + item.inventoryName);
182
163 AddNewInventoryItem(item.avatarID, item); 183 AddNewInventoryItem(item.avatarID, item);
164 return true; 184 return true;
165 } 185 }
166 186
167 public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) 187 public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
168 { 188 {
189 // extra spaces to align with other inventory messages
190 MainLog.Instance.Verbose(
191 "INVENTORY",
192 "Deleting in " + item.parentFolderID.ToStringHyphenated()
193 + ", item " + item.inventoryName);
194
169 DeleteItem(item); 195 DeleteItem(item);
170 } 196 }
171 197
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 02db6d0..ccba1de 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Grid.UserServer
60 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) 60 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
61 { 61 {
62 bool tryDefault = false; 62 bool tryDefault = false;
63 System.Console.WriteLine("Load information from the gridserver"); 63 MainLog.Instance.Verbose("LOGIN", "Load information from the gridserver");
64 RegionProfileData SimInfo = new RegionProfileData(); 64 RegionProfileData SimInfo = new RegionProfileData();
65 try 65 try
66 { 66 {
@@ -69,7 +69,7 @@ namespace OpenSim.Grid.UserServer
69 m_config.GridSendKey, m_config.GridRecvKey); 69 m_config.GridSendKey, m_config.GridRecvKey);
70 70
71 // Customise the response 71 // Customise the response
72 System.Console.WriteLine("Home Location"); 72 MainLog.Instance.Verbose("LOGIN", "Home Location");
73 response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + 73 response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" +
74 (SimInfo.regionLocY * 256).ToString() + "], " + 74 (SimInfo.regionLocY * 256).ToString() + "], " +
75 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + 75 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
@@ -128,7 +128,11 @@ namespace OpenSim.Grid.UserServer
128 // Load information from the gridserver 128 // Load information from the gridserver
129 129
130 ulong defaultHandle = (((ulong)m_config.DefaultX * 256) << 32) | ((ulong) m_config.DefaultY * 256); 130 ulong defaultHandle = (((ulong)m_config.DefaultX * 256) << 32) | ((ulong) m_config.DefaultY * 256);
131 MainLog.Instance.Warn("Home region not available: sending to default region " + defaultHandle.ToString()); 131
132 MainLog.Instance.Warn(
133 "LOGIN",
134 "Home region not available: sending to default region " + defaultHandle.ToString());
135
132 SimInfo = new RegionProfileData(); 136 SimInfo = new RegionProfileData();
133 try 137 try
134 { 138 {
@@ -137,7 +141,7 @@ namespace OpenSim.Grid.UserServer
137 m_config.GridSendKey, m_config.GridRecvKey); 141 m_config.GridSendKey, m_config.GridRecvKey);
138 142
139 // Customise the response 143 // Customise the response
140 System.Console.WriteLine("Home Location"); 144 MainLog.Instance.Verbose("LOGIN", "Home Location");
141 response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + 145 response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" +
142 (SimInfo.regionLocY * 256).ToString() + "], " + 146 (SimInfo.regionLocY * 256).ToString() + "], " +
143 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + 147 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
@@ -189,7 +193,7 @@ namespace OpenSim.Grid.UserServer
189 catch (Exception e) 193 catch (Exception e)
190 { 194 {
191 MainLog.Instance.Warn("LOGIN", "Default region also not available"); 195 MainLog.Instance.Warn("LOGIN", "Default region also not available");
192 MainLog.Instance.Verbose("LOGIN", e.ToString()); 196 MainLog.Instance.Warn("LOGIN", e.ToString());
193 } 197 }
194 198
195 } 199 }
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 4f5d9ab..709a227 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -117,45 +117,26 @@ namespace OpenSim.Region.Communications.OGS1
117 117
118 public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder) 118 public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder)
119 { 119 {
120 try 120 SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>(
121 { 121 "POST", _inventoryServerUrl + "/NewFolder/", folder);
122 RestObjectPoster.BeginPostObject<InventoryFolderBase>(_inventoryServerUrl + "/NewFolder/", folder);
123 }
124 catch (Exception)
125 {
126 }
127 } 122 }
128 123
129 public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder) 124 public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder)
130 { 125 {
131 try 126 SynchronousRestObjectPoster.BeginPostObject<InventoryFolderBase, bool>(
132 { 127 "POST", _inventoryServerUrl + "/MoveFolder/", folder);
133 RestObjectPoster.BeginPostObject<InventoryFolderBase>(_inventoryServerUrl + "/MoveFolder/", folder);
134 }
135 catch (Exception)
136 {
137 }
138 } 128 }
129
139 public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) 130 public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
140 { 131 {
141 try 132 SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>(
142 { 133 "POST", _inventoryServerUrl + "/NewItem/", item);
143 RestObjectPoster.BeginPostObject<InventoryItemBase>(_inventoryServerUrl + "/NewItem/", item);
144 }
145 catch (Exception)
146 {
147 }
148 } 134 }
149 135
150 public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) 136 public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
151 { 137 {
152 try 138 SynchronousRestObjectPoster.BeginPostObject<InventoryItemBase, bool>(
153 { 139 "POST", _inventoryServerUrl + "/DeleteItem/", item);
154 RestObjectPoster.BeginPostObject<InventoryItemBase>(_inventoryServerUrl + "/DeleteItem/", item);
155 }
156 catch (Exception)
157 {
158 }
159 } 140 }
160 141
161 public void CreateNewUserInventory(LLUUID user) 142 public void CreateNewUserInventory(LLUUID user)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 710e443..7026fea 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -238,7 +238,10 @@ namespace OpenSim.Region.Environment.Scenes
238 238
239 public void MoveInventoryItem(IClientAPI remoteClient,LLUUID folderID, LLUUID itemID, int length, string newName) 239 public void MoveInventoryItem(IClientAPI remoteClient,LLUUID folderID, LLUUID itemID, int length, string newName)
240 { 240 {
241 MainLog.Instance.Verbose("INVENTORY", "Moving item for " + remoteClient.AgentId.ToStringHyphenated()); 241 MainLog.Instance.Verbose(
242 "INVENTORY",
243 "Moving item for " + remoteClient.AgentId.ToStringHyphenated());
244
242 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 245 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
243 if (userInfo == null) 246 if (userInfo == null)
244 { 247 {