aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-14 07:55:33 +0000
committerTeravus Ovares2007-12-14 07:55:33 +0000
commit79935881aa4ac16990625360b256aa5eebe12ce7 (patch)
tree2059842c03a6b7ae36692e530c18fb1d9956ba40 /OpenSim
parentAdded copyright notice. (diff)
downloadopensim-SC-79935881aa4ac16990625360b256aa5eebe12ce7.zip
opensim-SC-79935881aa4ac16990625360b256aa5eebe12ce7.tar.gz
opensim-SC-79935881aa4ac16990625360b256aa5eebe12ce7.tar.bz2
opensim-SC-79935881aa4ac16990625360b256aa5eebe12ce7.tar.xz
* Patch from Justincc that swaps out LLUUIDs for Guid on the inventory REST calls
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs2
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs10
-rw-r--r--OpenSim/Grid/InventoryServer/GridInventoryService.cs12
-rw-r--r--OpenSim/Grid/InventoryServer/Main.cs8
-rw-r--r--OpenSim/Grid/UserServer/Main.cs2
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs12
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs6
7 files changed, 31 insertions, 21 deletions
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index 96bb7b3..191cdf2 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -51,4 +51,4 @@ namespace OpenSim.Framework.Communications
51 /// <returns></returns> 51 /// <returns></returns>
52 List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID); 52 List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID);
53 } 53 }
54} \ No newline at end of file 54}
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index e86eaac..1f64187 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -74,14 +74,20 @@ namespace OpenSim.Framework.Communications
74 } 74 }
75 } 75 }
76 } 76 }
77 77
78 public List<InventoryFolderBase> RequestFirstLevelFolders(Guid rawUserID)
79 {
80 LLUUID userID = new LLUUID(rawUserID);
81 return RequestFirstLevelFolders(userID);
82 }
83
78 /// <summary> 84 /// <summary>
79 /// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree) 85 /// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree)
80 /// </summary> 86 /// </summary>
81 /// <param name="userID"></param> 87 /// <param name="userID"></param>
82 /// <returns></returns> 88 /// <returns></returns>
83 public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID) 89 public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID)
84 { 90 {
85 List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>(); 91 List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>();
86 InventoryFolderBase rootFolder = null; 92 InventoryFolderBase rootFolder = null;
87 93
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
index 797de91..c6d3302 100644
--- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs
+++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
@@ -72,8 +72,10 @@ namespace OpenSim.Grid.InventoryServer
72 } 72 }
73 } 73 }
74 74
75 public InventoryCollection GetUserInventory(LLUUID userID) 75 public InventoryCollection GetUserInventory(Guid rawUserID)
76 { 76 {
77 LLUUID userID = new LLUUID(rawUserID);
78
77 InventoryCollection invCollection = new InventoryCollection(); 79 InventoryCollection invCollection = new InventoryCollection();
78 List<InventoryFolderBase> folders; 80 List<InventoryFolderBase> folders;
79 List<InventoryItemBase> allItems; 81 List<InventoryItemBase> allItems;
@@ -86,10 +88,12 @@ namespace OpenSim.Grid.InventoryServer
86 return invCollection; 88 return invCollection;
87 } 89 }
88 90
89 public bool CreateUsersInventory(LLUUID user) 91 public bool CreateUsersInventory(Guid rawUserID)
90 { 92 {
91 Console.WriteLine("Creating New Set of Inventory Folders for " + user.ToStringHyphenated()); 93 LLUUID userID = new LLUUID(rawUserID);
92 CreateNewUserInventory(user); 94
95 Console.WriteLine("Creating New Set of Inventory Folders for " + userID.ToStringHyphenated());
96 CreateNewUserInventory(userID);
93 return true; 97 return true;
94 } 98 }
95 99
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs
index 611e0c7..58b63f4 100644
--- a/OpenSim/Grid/InventoryServer/Main.cs
+++ b/OpenSim/Grid/InventoryServer/Main.cs
@@ -78,10 +78,10 @@ namespace OpenSim.Grid.InventoryServer
78 MainLog.Instance.Notice(LogName, "Starting HTTP server ..."); 78 MainLog.Instance.Notice(LogName, "Starting HTTP server ...");
79 BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); 79 BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort);
80 httpServer.AddStreamHandler( 80 httpServer.AddStreamHandler(
81 new RestDeserialisehandler<LLUUID, InventoryCollection>("POST", "/GetInventory/", 81 new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/",
82 m_inventoryService.GetUserInventory)); 82 m_inventoryService.GetUserInventory));
83 httpServer.AddStreamHandler( 83 httpServer.AddStreamHandler(
84 new RestDeserialisehandler<LLUUID, bool>("POST", "/CreateInventory/", 84 new RestDeserialisehandler<Guid, bool>("POST", "/CreateInventory/",
85 m_inventoryService.CreateUsersInventory)); 85 m_inventoryService.CreateUsersInventory));
86 httpServer.AddStreamHandler( 86 httpServer.AddStreamHandler(
87 new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/NewFolder/", 87 new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/NewFolder/",
@@ -95,7 +95,7 @@ namespace OpenSim.Grid.InventoryServer
95 m_inventoryService.DeleteInvItem)); 95 m_inventoryService.DeleteInvItem));
96 96
97 httpServer.AddStreamHandler( 97 httpServer.AddStreamHandler(
98 new RestDeserialisehandler<LLUUID, List<InventoryFolderBase>>("POST", "/RootFolders/", 98 new RestDeserialisehandler<Guid, List<InventoryFolderBase>>("POST", "/RootFolders/",
99 m_inventoryService.RequestFirstLevelFolders)); 99 m_inventoryService.RequestFirstLevelFolders));
100 100
101 // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); 101 // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager));
@@ -120,7 +120,7 @@ namespace OpenSim.Grid.InventoryServer
120 { 120 {
121 case "quit": 121 case "quit":
122 case "add-user": 122 case "add-user":
123 m_inventoryService.CreateUsersInventory(LLUUID.Random()); 123 m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID);
124 break; 124 break;
125 case "shutdown": 125 case "shutdown":
126 m_console.Close(); 126 m_console.Close();
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index 90fcac3..4806e52 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -129,7 +129,7 @@ namespace OpenSim.Grid.UserServer
129 tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + ""); 129 tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + "");
130 130
131 LLUUID userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); 131 LLUUID userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
132 RestObjectPoster.BeginPostObject<LLUUID>(m_userManager._config.InventoryUrl + "CreateInventory/", userID); 132 RestObjectPoster.BeginPostObject<Guid>(m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID);
133 m_lastCreatedUser = userID; 133 m_lastCreatedUser = userID;
134 break; 134 break;
135 } 135 }
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index fa5eac5..02db6d0 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -198,8 +198,8 @@ namespace OpenSim.Grid.UserServer
198 protected override InventoryData CreateInventoryData(LLUUID userID) 198 protected override InventoryData CreateInventoryData(LLUUID userID)
199 { 199 {
200 List<InventoryFolderBase> folders 200 List<InventoryFolderBase> folders
201 = SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>( 201 = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>(
202 "POST", m_config.InventoryUrl + "RootFolders/", userID); 202 "POST", m_config.InventoryUrl + "RootFolders/", userID.UUID);
203 203
204 // In theory, the user will only ever be missing a root folder in situations where a grid 204 // In theory, the user will only ever be missing a root folder in situations where a grid
205 // which didn't previously run a grid wide inventory server is being transitioned to one 205 // which didn't previously run a grid wide inventory server is being transitioned to one
@@ -211,15 +211,15 @@ namespace OpenSim.Grid.UserServer
211 "A root inventory folder for user ID " + userID + " was not found. A new set" 211 "A root inventory folder for user ID " + userID + " was not found. A new set"
212 + " of empty inventory folders is being created."); 212 + " of empty inventory folders is being created.");
213 213
214 RestObjectPoster.BeginPostObject<LLUUID>( 214 RestObjectPoster.BeginPostObject<Guid>(
215 m_config.InventoryUrl + "CreateInventory/", userID); 215 m_config.InventoryUrl + "CreateInventory/", userID.UUID);
216 216
217 // A big delay should be okay here since the recreation of the user's root folders should 217 // A big delay should be okay here since the recreation of the user's root folders should
218 // only ever happen once. We need to sleep to let the inventory server do its work - 218 // only ever happen once. We need to sleep to let the inventory server do its work -
219 // previously 1000ms has been found to be too short. 219 // previously 1000ms has been found to be too short.
220 Thread.Sleep(10000); 220 Thread.Sleep(10000);
221 folders = SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>( 221 folders = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>(
222 "POST", m_config.InventoryUrl + "RootFolders/", userID); 222 "POST", m_config.InventoryUrl + "RootFolders/", userID.UUID);
223 } 223 }
224 224
225 if (folders.Count > 0) 225 if (folders.Count > 0)
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 6edb149..5342127 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -65,8 +65,8 @@ namespace OpenSim.Region.Communications.OGS1
65 { 65 {
66 RestObjectPosterResponse<InventoryCollection> requester = new RestObjectPosterResponse<InventoryCollection>(); 66 RestObjectPosterResponse<InventoryCollection> requester = new RestObjectPosterResponse<InventoryCollection>();
67 requester.ResponseCallback = InventoryResponse; 67 requester.ResponseCallback = InventoryResponse;
68 // THIS SHOULD BE A Guid, NOT A LLUUID! No longer Serializable! This will fail EVERY TIME. 68
69 requester.BeginPostObject<LLUUID>(_inventoryServerUrl + "/GetInventory/", userID); 69 requester.BeginPostObject<Guid>(_inventoryServerUrl + "/GetInventory/", userID.UUID);
70 } 70 }
71 catch (Exception) 71 catch (Exception)
72 { 72 {
@@ -169,4 +169,4 @@ namespace OpenSim.Region.Communications.OGS1
169 } 169 }
170 } 170 }
171 } 171 }
172} \ No newline at end of file 172}