diff options
author | Adam Frisby | 2007-05-31 14:05:19 +0000 |
---|---|---|
committer | Adam Frisby | 2007-05-31 14:05:19 +0000 |
commit | a0305888bcc7cd2e97f14c5e7893d151a5b9de7b (patch) | |
tree | 54344bc967d58a368c0eda92dab9bb43b9d7cfb1 /OpenGridServices | |
parent | Shelling out a Inventory framework a bit more. (diff) | |
download | opensim-SC-a0305888bcc7cd2e97f14c5e7893d151a5b9de7b.zip opensim-SC-a0305888bcc7cd2e97f14c5e7893d151a5b9de7b.tar.gz opensim-SC-a0305888bcc7cd2e97f14c5e7893d151a5b9de7b.tar.bz2 opensim-SC-a0305888bcc7cd2e97f14c5e7893d151a5b9de7b.tar.xz |
* Yet more inventory shelling
* Very initial MySQL work done
* Refactored some of the MySQL code - functions which are passed a reader are no longer getX() but now readX().
Diffstat (limited to 'OpenGridServices')
5 files changed, 76 insertions, 24 deletions
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs index 5006aaf..e047c6d 100644 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs | |||
@@ -62,7 +62,7 @@ namespace OpenGrid.Framework.Data.MySQL | |||
62 | 62 | ||
63 | List<SimProfileData> rows = new List<SimProfileData>(); | 63 | List<SimProfileData> rows = new List<SimProfileData>(); |
64 | 64 | ||
65 | while ((row = database.getSimRow(reader)) != null) | 65 | while ((row = database.readSimRow(reader)) != null) |
66 | { | 66 | { |
67 | rows.Add(row); | 67 | rows.Add(row); |
68 | } | 68 | } |
@@ -98,7 +98,7 @@ namespace OpenGrid.Framework.Data.MySQL | |||
98 | System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param); | 98 | System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param); |
99 | System.Data.IDataReader reader = result.ExecuteReader(); | 99 | System.Data.IDataReader reader = result.ExecuteReader(); |
100 | 100 | ||
101 | SimProfileData row = database.getSimRow(reader); | 101 | SimProfileData row = database.readSimRow(reader); |
102 | reader.Close(); | 102 | reader.Close(); |
103 | result.Dispose(); | 103 | result.Dispose(); |
104 | 104 | ||
@@ -130,7 +130,7 @@ namespace OpenGrid.Framework.Data.MySQL | |||
130 | System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param); | 130 | System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param); |
131 | System.Data.IDataReader reader = result.ExecuteReader(); | 131 | System.Data.IDataReader reader = result.ExecuteReader(); |
132 | 132 | ||
133 | SimProfileData row = database.getSimRow(reader); | 133 | SimProfileData row = database.readSimRow(reader); |
134 | reader.Close(); | 134 | reader.Close(); |
135 | result.Dispose(); | 135 | result.Dispose(); |
136 | 136 | ||
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs index 8950458..72c0139 100644 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLInventoryData.cs | |||
@@ -1,10 +1,11 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using libsecondlife; | ||
4 | 5 | ||
5 | namespace OpenGrid.Framework.Data.MySQL | 6 | namespace OpenGrid.Framework.Data.MySQL |
6 | { | 7 | { |
7 | class MySQLInventoryData | 8 | class MySQLInventoryData : IInventoryData |
8 | { | 9 | { |
9 | public MySQLManager database; | 10 | public MySQLManager database; |
10 | 11 | ||
@@ -23,7 +24,7 @@ namespace OpenGrid.Framework.Data.MySQL | |||
23 | 24 | ||
24 | public string getName() | 25 | public string getName() |
25 | { | 26 | { |
26 | return "MySQL Logdata Interface"; | 27 | return "MySQL Inventory Data Interface"; |
27 | } | 28 | } |
28 | 29 | ||
29 | public void Close() | 30 | public void Close() |
@@ -35,5 +36,30 @@ namespace OpenGrid.Framework.Data.MySQL | |||
35 | { | 36 | { |
36 | return "0.1"; | 37 | return "0.1"; |
37 | } | 38 | } |
39 | |||
40 | public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID) | ||
41 | { | ||
42 | return null; | ||
43 | } | ||
44 | |||
45 | public List<InventoryFolderBase> getUserRootFolders(LLUUID user) | ||
46 | { | ||
47 | return null; | ||
48 | } | ||
49 | |||
50 | public List<InventoryFolderBase> getInventoryFolders(LLUUID parentID) | ||
51 | { | ||
52 | return null; | ||
53 | } | ||
54 | |||
55 | public InventoryItemBase getInventoryItem(LLUUID item) | ||
56 | { | ||
57 | return null; | ||
58 | } | ||
59 | |||
60 | public InventoryFolderBase getInventoryFolder(LLUUID folder) | ||
61 | { | ||
62 | return null; | ||
63 | } | ||
38 | } | 64 | } |
39 | } | 65 | } |
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs index 2eaa158..ef2e02e 100644 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLManager.cs | |||
@@ -137,7 +137,7 @@ namespace OpenGrid.Framework.Data.MySQL | |||
137 | } | 137 | } |
138 | } | 138 | } |
139 | 139 | ||
140 | public SimProfileData getSimRow(IDataReader reader) | 140 | public SimProfileData readSimRow(IDataReader reader) |
141 | { | 141 | { |
142 | SimProfileData retval = new SimProfileData(); | 142 | SimProfileData retval = new SimProfileData(); |
143 | 143 | ||
@@ -199,7 +199,7 @@ namespace OpenGrid.Framework.Data.MySQL | |||
199 | return retval; | 199 | return retval; |
200 | } | 200 | } |
201 | 201 | ||
202 | public UserAgentData getAgentRow(IDataReader reader) | 202 | public UserAgentData readAgentRow(IDataReader reader) |
203 | { | 203 | { |
204 | UserAgentData retval = new UserAgentData(); | 204 | UserAgentData retval = new UserAgentData(); |
205 | 205 | ||
@@ -231,7 +231,7 @@ namespace OpenGrid.Framework.Data.MySQL | |||
231 | return retval; | 231 | return retval; |
232 | } | 232 | } |
233 | 233 | ||
234 | public UserProfileData getUserRow(IDataReader reader) | 234 | public UserProfileData readUserRow(IDataReader reader) |
235 | { | 235 | { |
236 | UserProfileData retval = new UserProfileData(); | 236 | UserProfileData retval = new UserProfileData(); |
237 | 237 | ||
@@ -277,6 +277,32 @@ namespace OpenGrid.Framework.Data.MySQL | |||
277 | return retval; | 277 | return retval; |
278 | } | 278 | } |
279 | 279 | ||
280 | public List<InventoryFolderBase> readInventoryInFolder(IDataReader reader) | ||
281 | { | ||
282 | List<InventoryFolderBase> rows = new List<InventoryFolderBase>(); | ||
283 | |||
284 | while(reader.Read()) | ||
285 | { | ||
286 | try | ||
287 | { | ||
288 | InventoryFolderBase retval = new InventoryFolderBase(); | ||
289 | |||
290 | retval.agentID = new libsecondlife.LLUUID((string)reader["agentID"]); | ||
291 | retval.parentID = new libsecondlife.LLUUID((string)reader["parentFolderID"]); | ||
292 | retval.folderID = new libsecondlife.LLUUID((string)reader["folderID"]); | ||
293 | retval.name = (string)reader["folderName"]; | ||
294 | |||
295 | rows.Add(retval); | ||
296 | } | ||
297 | catch (Exception e) | ||
298 | { | ||
299 | Console.WriteLine(e.ToString()); | ||
300 | } | ||
301 | } | ||
302 | |||
303 | return rows; | ||
304 | } | ||
305 | |||
280 | public bool insertLogRow(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) | 306 | public bool insertLogRow(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage) |
281 | { | 307 | { |
282 | string sql = "INSERT INTO logs (`target`, `server`, `method`, `arguments`, `priority`, `message`) VALUES "; | 308 | string sql = "INSERT INTO logs (`target`, `server`, `method`, `arguments`, `priority`, `message`) VALUES "; |
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs index 6f3cad6..4a7276c 100644 --- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLUserData.cs | |||
@@ -41,7 +41,7 @@ namespace OpenGrid.Framework.Data.MySQL | |||
41 | System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE username = ?first AND lastname = ?second", param); | 41 | System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE username = ?first AND lastname = ?second", param); |
42 | System.Data.IDataReader reader = result.ExecuteReader(); | 42 | System.Data.IDataReader reader = result.ExecuteReader(); |
43 | 43 | ||
44 | UserProfileData row = database.getUserRow(reader); | 44 | UserProfileData row = database.readUserRow(reader); |
45 | 45 | ||
46 | reader.Close(); | 46 | reader.Close(); |
47 | result.Dispose(); | 47 | result.Dispose(); |
@@ -69,7 +69,7 @@ namespace OpenGrid.Framework.Data.MySQL | |||
69 | System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE UUID = ?uuid", param); | 69 | System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE UUID = ?uuid", param); |
70 | System.Data.IDataReader reader = result.ExecuteReader(); | 70 | System.Data.IDataReader reader = result.ExecuteReader(); |
71 | 71 | ||
72 | UserProfileData row = database.getUserRow(reader); | 72 | UserProfileData row = database.readUserRow(reader); |
73 | 73 | ||
74 | reader.Close(); | 74 | reader.Close(); |
75 | result.Dispose(); | 75 | result.Dispose(); |
@@ -108,7 +108,7 @@ namespace OpenGrid.Framework.Data.MySQL | |||
108 | System.Data.IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param); | 108 | System.Data.IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param); |
109 | System.Data.IDataReader reader = result.ExecuteReader(); | 109 | System.Data.IDataReader reader = result.ExecuteReader(); |
110 | 110 | ||
111 | UserAgentData row = database.getAgentRow(reader); | 111 | UserAgentData row = database.readAgentRow(reader); |
112 | 112 | ||
113 | reader.Close(); | 113 | reader.Close(); |
114 | result.Dispose(); | 114 | result.Dispose(); |
diff --git a/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs b/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs index 1d70c73..2b3d826 100644 --- a/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs +++ b/OpenGridServices/OpenGrid.Framework.Data/InventoryData.cs | |||
@@ -7,23 +7,23 @@ namespace OpenGrid.Framework.Data | |||
7 | { | 7 | { |
8 | public class InventoryItemBase | 8 | public class InventoryItemBase |
9 | { | 9 | { |
10 | LLUUID inventoryID; | 10 | public LLUUID inventoryID; |
11 | LLUUID assetID; | 11 | public LLUUID assetID; |
12 | int type; | 12 | public int type; |
13 | LLUUID parentFolderID; | 13 | public LLUUID parentFolderID; |
14 | LLUUID avatarID; | 14 | public LLUUID avatarID; |
15 | string inventoryName; | 15 | public string inventoryName; |
16 | string inventoryDescription; | 16 | public string inventoryDescription; |
17 | uint inventoryNextPermissions; | 17 | public uint inventoryNextPermissions; |
18 | uint inventoryCurrentPermissions; | 18 | public uint inventoryCurrentPermissions; |
19 | } | 19 | } |
20 | 20 | ||
21 | public class InventoryFolderBase | 21 | public class InventoryFolderBase |
22 | { | 22 | { |
23 | string name; | 23 | public string name; |
24 | LLUUID agentID; | 24 | public LLUUID agentID; |
25 | LLUUID parentID; | 25 | public LLUUID parentID; |
26 | LLUUID folderID; | 26 | public LLUUID folderID; |
27 | } | 27 | } |
28 | 28 | ||
29 | public interface IInventoryData | 29 | public interface IInventoryData |