diff options
author | Melanie | 2010-04-19 07:00:40 +0100 |
---|---|---|
committer | Melanie | 2010-04-19 07:00:40 +0100 |
commit | 98cb4f74b265dfb8ca3eb8c8d3ad604249398df1 (patch) | |
tree | 1339d3707430a20662bdcd3eb4e9ef86abc6a4fd /OpenSim/Data | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
parent | All scripts are now created suspended and are only unsuspended when the object (diff) | |
download | opensim-SC-98cb4f74b265dfb8ca3eb8c8d3ad604249398df1.zip opensim-SC-98cb4f74b265dfb8ca3eb8c8d3ad604249398df1.tar.gz opensim-SC-98cb4f74b265dfb8ca3eb8c8d3ad604249398df1.tar.bz2 opensim-SC-98cb4f74b265dfb8ca3eb8c8d3ad604249398df1.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/IUserAccountData.cs | 1 | ||||
-rw-r--r-- | OpenSim/Data/Null/NullInventoryData.cs | 193 | ||||
-rw-r--r-- | OpenSim/Data/Null/NullUserAccountData.cs | 21 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/Resources/001_UserAccount.sql | 2 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAssetData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAuthenticationData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteUserAccountData.cs | 2 |
7 files changed, 219 insertions, 4 deletions
diff --git a/OpenSim/Data/IUserAccountData.cs b/OpenSim/Data/IUserAccountData.cs index 6ee5995..906ba6c 100644 --- a/OpenSim/Data/IUserAccountData.cs +++ b/OpenSim/Data/IUserAccountData.cs | |||
@@ -48,6 +48,7 @@ namespace OpenSim.Data | |||
48 | { | 48 | { |
49 | UserAccountData[] Get(string[] fields, string[] values); | 49 | UserAccountData[] Get(string[] fields, string[] values); |
50 | bool Store(UserAccountData data); | 50 | bool Store(UserAccountData data); |
51 | bool Delete(string field, string val); | ||
51 | UserAccountData[] GetUsers(UUID scopeID, string query); | 52 | UserAccountData[] GetUsers(UUID scopeID, string query); |
52 | } | 53 | } |
53 | } | 54 | } |
diff --git a/OpenSim/Data/Null/NullInventoryData.cs b/OpenSim/Data/Null/NullInventoryData.cs new file mode 100644 index 0000000..8f196e2 --- /dev/null +++ b/OpenSim/Data/Null/NullInventoryData.cs | |||
@@ -0,0 +1,193 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | |||
4 | using OpenMetaverse; | ||
5 | using OpenSim.Framework; | ||
6 | |||
7 | namespace OpenSim.Data.Null | ||
8 | { | ||
9 | /// <summary> | ||
10 | /// This class is completely null. | ||
11 | /// </summary> | ||
12 | public class NullInventoryData : IInventoryDataPlugin | ||
13 | { | ||
14 | public string Version { get { return "1.0.0.0"; } } | ||
15 | |||
16 | public void Initialise() | ||
17 | { | ||
18 | } | ||
19 | |||
20 | public void Dispose() | ||
21 | { | ||
22 | // Do nothing. | ||
23 | } | ||
24 | |||
25 | public string Name | ||
26 | { | ||
27 | get { return "Null Inventory Data Interface"; } | ||
28 | } | ||
29 | |||
30 | public void Initialise(string connect) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | |||
35 | /// <summary> | ||
36 | /// Returns all descendent folders of this folder. Does not return the parent folder itself. | ||
37 | /// </summary> | ||
38 | /// <param name="parentID">The folder to get subfolders for</param> | ||
39 | /// <returns>A list of inventory folders</returns> | ||
40 | public List<InventoryFolderBase> getFolderHierarchy(UUID parentID) | ||
41 | { | ||
42 | return new List<InventoryFolderBase>(); | ||
43 | } | ||
44 | |||
45 | /// <summary> | ||
46 | /// Returns a list of inventory items contained within the specified folder | ||
47 | /// </summary> | ||
48 | /// <param name="folderID">The UUID of the target folder</param> | ||
49 | /// <returns>A List of InventoryItemBase items</returns> | ||
50 | public List<InventoryItemBase> getInventoryInFolder(UUID folderID) | ||
51 | { | ||
52 | return new List<InventoryItemBase>(); | ||
53 | } | ||
54 | |||
55 | /// <summary> | ||
56 | /// Returns a list of the root folders within a users inventory | ||
57 | /// </summary> | ||
58 | /// <param name="user">The user whos inventory is to be searched</param> | ||
59 | /// <returns>A list of folder objects</returns> | ||
60 | public List<InventoryFolderBase> getUserRootFolders(UUID user) | ||
61 | { | ||
62 | return new List<InventoryFolderBase>(); | ||
63 | } | ||
64 | |||
65 | /// <summary> | ||
66 | /// Returns the users inventory root folder. | ||
67 | /// </summary> | ||
68 | /// <param name="user">The UUID of the user who is having inventory being returned</param> | ||
69 | /// <returns>Root inventory folder, null if no root inventory folder was found</returns> | ||
70 | public InventoryFolderBase getUserRootFolder(UUID user) | ||
71 | { | ||
72 | return null; | ||
73 | } | ||
74 | |||
75 | /// <summary> | ||
76 | /// Returns a list of inventory folders contained in the folder 'parentID' | ||
77 | /// </summary> | ||
78 | /// <param name="parentID">The folder to get subfolders for</param> | ||
79 | /// <returns>A list of inventory folders</returns> | ||
80 | public List<InventoryFolderBase> getInventoryFolders(UUID parentID) | ||
81 | { | ||
82 | return new List<InventoryFolderBase>(); | ||
83 | } | ||
84 | |||
85 | /// <summary> | ||
86 | /// Returns an inventory item by its UUID | ||
87 | /// </summary> | ||
88 | /// <param name="item">The UUID of the item to be returned</param> | ||
89 | /// <returns>A class containing item information</returns> | ||
90 | public InventoryItemBase getInventoryItem(UUID item) | ||
91 | { | ||
92 | return null; | ||
93 | } | ||
94 | |||
95 | /// <summary> | ||
96 | /// Returns a specified inventory folder by its UUID | ||
97 | /// </summary> | ||
98 | /// <param name="folder">The UUID of the folder to be returned</param> | ||
99 | /// <returns>A class containing folder information</returns> | ||
100 | public InventoryFolderBase getInventoryFolder(UUID folder) | ||
101 | { | ||
102 | return null; | ||
103 | } | ||
104 | |||
105 | /// <summary> | ||
106 | /// Creates a new inventory item based on item | ||
107 | /// </summary> | ||
108 | /// <param name="item">The item to be created</param> | ||
109 | public void addInventoryItem(InventoryItemBase item) | ||
110 | { | ||
111 | } | ||
112 | |||
113 | /// <summary> | ||
114 | /// Updates an inventory item with item (updates based on ID) | ||
115 | /// </summary> | ||
116 | /// <param name="item">The updated item</param> | ||
117 | public void updateInventoryItem(InventoryItemBase item) | ||
118 | { | ||
119 | } | ||
120 | |||
121 | /// <summary> | ||
122 | /// | ||
123 | /// </summary> | ||
124 | /// <param name="item"></param> | ||
125 | public void deleteInventoryItem(UUID item) | ||
126 | { | ||
127 | } | ||
128 | |||
129 | /// <summary> | ||
130 | /// | ||
131 | /// </summary> | ||
132 | /// <param name="item"></param> | ||
133 | public InventoryItemBase queryInventoryItem(UUID item) | ||
134 | { | ||
135 | return null; | ||
136 | } | ||
137 | |||
138 | /// <summary> | ||
139 | /// | ||
140 | /// </summary> | ||
141 | /// <param name="item"></param> | ||
142 | public InventoryFolderBase queryInventoryFolder(UUID folder) | ||
143 | { | ||
144 | return null; | ||
145 | } | ||
146 | |||
147 | /// <summary> | ||
148 | /// Adds a new folder specified by folder | ||
149 | /// </summary> | ||
150 | /// <param name="folder">The inventory folder</param> | ||
151 | public void addInventoryFolder(InventoryFolderBase folder) | ||
152 | { | ||
153 | } | ||
154 | |||
155 | /// <summary> | ||
156 | /// Updates a folder based on its ID with folder | ||
157 | /// </summary> | ||
158 | /// <param name="folder">The inventory folder</param> | ||
159 | public void updateInventoryFolder(InventoryFolderBase folder) | ||
160 | { | ||
161 | } | ||
162 | |||
163 | /// <summary> | ||
164 | /// Updates a folder based on its ID with folder | ||
165 | /// </summary> | ||
166 | /// <param name="folder">The inventory folder</param> | ||
167 | public void moveInventoryFolder(InventoryFolderBase folder) | ||
168 | { | ||
169 | } | ||
170 | |||
171 | /// <summary> | ||
172 | /// Deletes a folder. Thie will delete both the folder itself and its contents (items and descendent folders) | ||
173 | /// </summary> | ||
174 | /// <param name="folder">The id of the folder</param> | ||
175 | public void deleteInventoryFolder(UUID folder) | ||
176 | { | ||
177 | } | ||
178 | |||
179 | /// <summary> | ||
180 | /// Returns all activated gesture-items in the inventory of the specified avatar. | ||
181 | /// </summary> | ||
182 | /// <param name="avatarID"> | ||
183 | /// The <see cref="UUID"/> of the avatar | ||
184 | /// </param> | ||
185 | /// <returns> | ||
186 | /// The list of gestures (<see cref="InventoryItemBase"/>s) | ||
187 | /// </returns> | ||
188 | public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) | ||
189 | { | ||
190 | return new List<InventoryItemBase>(); | ||
191 | } | ||
192 | } | ||
193 | } | ||
diff --git a/OpenSim/Data/Null/NullUserAccountData.cs b/OpenSim/Data/Null/NullUserAccountData.cs index fc2c5d5..9eb94e6 100644 --- a/OpenSim/Data/Null/NullUserAccountData.cs +++ b/OpenSim/Data/Null/NullUserAccountData.cs | |||
@@ -135,5 +135,26 @@ namespace OpenSim.Data.Null | |||
135 | return result; | 135 | return result; |
136 | } | 136 | } |
137 | 137 | ||
138 | public bool Delete(string field, string val) | ||
139 | { | ||
140 | // Only delete by PrincipalID | ||
141 | if (field.Equals("PrincipalID")) | ||
142 | { | ||
143 | UUID uuid = UUID.Zero; | ||
144 | if (UUID.TryParse(val, out uuid) && m_DataByUUID.ContainsKey(uuid)) | ||
145 | { | ||
146 | UserAccountData account = m_DataByUUID[uuid]; | ||
147 | m_DataByUUID.Remove(uuid); | ||
148 | if (m_DataByName.ContainsKey(account.FirstName + " " + account.LastName)) | ||
149 | m_DataByName.Remove(account.FirstName + " " + account.LastName); | ||
150 | if (account.Data.ContainsKey("Email") && account.Data["Email"] != string.Empty && m_DataByEmail.ContainsKey(account.Data["Email"])) | ||
151 | m_DataByEmail.Remove(account.Data["Email"]); | ||
152 | |||
153 | return true; | ||
154 | } | ||
155 | } | ||
156 | |||
157 | return false; | ||
158 | } | ||
138 | } | 159 | } |
139 | } | 160 | } |
diff --git a/OpenSim/Data/SQLite/Resources/001_UserAccount.sql b/OpenSim/Data/SQLite/Resources/001_UserAccount.sql index f9bf24c..c38d9a7 100644 --- a/OpenSim/Data/SQLite/Resources/001_UserAccount.sql +++ b/OpenSim/Data/SQLite/Resources/001_UserAccount.sql | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | -- useraccounts table | 3 | -- useraccounts table |
4 | CREATE TABLE UserAccounts ( | 4 | CREATE TABLE UserAccounts ( |
5 | PrincipalID CHAR(36) NOT NULL, | 5 | PrincipalID CHAR(36) primary key, |
6 | ScopeID CHAR(36) NOT NULL, | 6 | ScopeID CHAR(36) NOT NULL, |
7 | FirstName VARCHAR(64) NOT NULL, | 7 | FirstName VARCHAR(64) NOT NULL, |
8 | LastName VARCHAR(64) NOT NULL, | 8 | LastName VARCHAR(64) NOT NULL, |
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index ace40e5..a032670 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -137,7 +137,7 @@ namespace OpenSim.Data.SQLite | |||
137 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 137 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
138 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 138 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
139 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 139 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
140 | 140 | ||
141 | cmd.ExecuteNonQuery(); | 141 | cmd.ExecuteNonQuery(); |
142 | } | 142 | } |
143 | } | 143 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs index 2c28375..aa10734 100644 --- a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs +++ b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs | |||
@@ -235,7 +235,7 @@ namespace OpenSim.Data.SQLite | |||
235 | if (System.Environment.TickCount - m_LastExpire > 30000) | 235 | if (System.Environment.TickCount - m_LastExpire > 30000) |
236 | DoExpire(); | 236 | DoExpire(); |
237 | 237 | ||
238 | SqliteCommand cmd = new SqliteCommand("update tokens set validity = datetime('now, 'localtime', '+" + lifetime.ToString() + | 238 | SqliteCommand cmd = new SqliteCommand("update tokens set validity = datetime('now', 'localtime', '+" + lifetime.ToString() + |
239 | " minutes') where UUID = '" + principalID.ToString() + "' and token = '" + token + "' and validity > datetime('now', 'localtime')"); | 239 | " minutes') where UUID = '" + principalID.ToString() + "' and token = '" + token + "' and validity > datetime('now', 'localtime')"); |
240 | 240 | ||
241 | if (ExecuteNonQuery(cmd, m_Connection) > 0) | 241 | if (ExecuteNonQuery(cmd, m_Connection) > 0) |
diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs index 50e8c23..67cf716 100644 --- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Data.SQLite | |||
66 | 66 | ||
67 | if (words.Length == 1) | 67 | if (words.Length == 1) |
68 | { | 68 | { |
69 | cmd.CommandText = String.Format("select * from {0} where ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')", | 69 | cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')", |
70 | m_Realm, scopeID.ToString(), words[0]); | 70 | m_Realm, scopeID.ToString(), words[0]); |
71 | } | 71 | } |
72 | else | 72 | else |