diff options
author | Diva Canto | 2010-11-21 17:19:24 -0800 |
---|---|---|
committer | Diva Canto | 2010-11-21 17:19:24 -0800 |
commit | c617d658dda92ad97de678d477a98c3df0659303 (patch) | |
tree | 9a86356af2fcf4ae4eab18b53dc7330bf3e26a86 /OpenSim/Framework | |
parent | Updated SQLiteLegacy/SQLiteSimulationData with the same. Is this crap still u... (diff) | |
download | opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.zip opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.tar.gz opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.tar.bz2 opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.tar.xz |
Added creator info across the board -- TaskInventoryItems and InventoryItems themselves. Tested. Seems to be working, main tests pass. Nothing done for IARs or HG transfers yet -- this only works for OARs for the time being.
New migration in inventory table in order to make CreatorID varchar(255).
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/InventoryItemBase.cs | 50 | ||||
-rw-r--r-- | OpenSim/Framework/TaskInventoryItem.cs | 56 |
2 files changed, 106 insertions, 0 deletions
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index aeb01e2..ce4fc38 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs | |||
@@ -117,6 +117,56 @@ namespace OpenSim.Framework | |||
117 | } | 117 | } |
118 | protected UUID m_creatorIdAsUuid = UUID.Zero; | 118 | protected UUID m_creatorIdAsUuid = UUID.Zero; |
119 | 119 | ||
120 | protected string m_creatorData; | ||
121 | public string CreatorData // = <profile url>;<name> | ||
122 | { | ||
123 | get { return m_creatorData; } | ||
124 | set { m_creatorData = value; } | ||
125 | } | ||
126 | |||
127 | /// <summary> | ||
128 | /// Used by the DB layer to retrieve / store the entire user identification. | ||
129 | /// The identification can either be a simple UUID or a string of the form | ||
130 | /// uuid[;profile_url[;name]] | ||
131 | /// </summary> | ||
132 | public string CreatorIdentification | ||
133 | { | ||
134 | get | ||
135 | { | ||
136 | if (m_creatorData != null && m_creatorData != string.Empty) | ||
137 | return m_creatorId + ';' + m_creatorData; | ||
138 | else | ||
139 | return m_creatorId; | ||
140 | } | ||
141 | set | ||
142 | { | ||
143 | if ((value == null) || (value != null && value == string.Empty)) | ||
144 | { | ||
145 | m_creatorData = string.Empty; | ||
146 | return; | ||
147 | } | ||
148 | |||
149 | if (!value.Contains(";")) // plain UUID | ||
150 | { | ||
151 | m_creatorId = value; | ||
152 | } | ||
153 | else // <uuid>[;<endpoint>[;name]] | ||
154 | { | ||
155 | string name = "Unknown User"; | ||
156 | string[] parts = value.Split(';'); | ||
157 | if (parts.Length >= 1) | ||
158 | m_creatorId = parts[0]; | ||
159 | if (parts.Length >= 2) | ||
160 | m_creatorData = parts[1]; | ||
161 | if (parts.Length >= 3) | ||
162 | name = parts[2]; | ||
163 | |||
164 | m_creatorData += ';' + name; | ||
165 | |||
166 | } | ||
167 | } | ||
168 | } | ||
169 | |||
120 | /// <value> | 170 | /// <value> |
121 | /// The description of the inventory item (must be less than 64 characters) | 171 | /// The description of the inventory item (must be less than 64 characters) |
122 | /// </value> | 172 | /// </value> |
diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index df5b936..30d775c 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs | |||
@@ -102,6 +102,7 @@ namespace OpenSim.Framework | |||
102 | private uint _baseMask = FULL_MASK_PERMISSIONS_GENERAL; | 102 | private uint _baseMask = FULL_MASK_PERMISSIONS_GENERAL; |
103 | private uint _creationDate = 0; | 103 | private uint _creationDate = 0; |
104 | private UUID _creatorID = UUID.Zero; | 104 | private UUID _creatorID = UUID.Zero; |
105 | private string _creatorData = String.Empty; | ||
105 | private string _description = String.Empty; | 106 | private string _description = String.Empty; |
106 | private uint _everyoneMask = FULL_MASK_PERMISSIONS_GENERAL; | 107 | private uint _everyoneMask = FULL_MASK_PERMISSIONS_GENERAL; |
107 | private uint _flags = 0; | 108 | private uint _flags = 0; |
@@ -160,6 +161,61 @@ namespace OpenSim.Framework | |||
160 | } | 161 | } |
161 | } | 162 | } |
162 | 163 | ||
164 | public string CreatorData // = <profile url>;<name> | ||
165 | { | ||
166 | get { return _creatorData; } | ||
167 | set { _creatorData = value; } | ||
168 | } | ||
169 | |||
170 | /// <summary> | ||
171 | /// Used by the DB layer to retrieve / store the entire user identification. | ||
172 | /// The identification can either be a simple UUID or a string of the form | ||
173 | /// uuid[;profile_url[;name]] | ||
174 | /// </summary> | ||
175 | public string CreatorIdentification | ||
176 | { | ||
177 | get | ||
178 | { | ||
179 | if (_creatorData != null && _creatorData != string.Empty) | ||
180 | return _creatorID.ToString() + ';' + _creatorData; | ||
181 | else | ||
182 | return _creatorID.ToString(); | ||
183 | } | ||
184 | set | ||
185 | { | ||
186 | if ((value == null) || (value != null && value == string.Empty)) | ||
187 | { | ||
188 | _creatorData = string.Empty; | ||
189 | return; | ||
190 | } | ||
191 | |||
192 | if (!value.Contains(";")) // plain UUID | ||
193 | { | ||
194 | UUID uuid = UUID.Zero; | ||
195 | UUID.TryParse(value, out uuid); | ||
196 | _creatorID = uuid; | ||
197 | } | ||
198 | else // <uuid>[;<endpoint>[;name]] | ||
199 | { | ||
200 | string name = "Unknown User"; | ||
201 | string[] parts = value.Split(';'); | ||
202 | if (parts.Length >= 1) | ||
203 | { | ||
204 | UUID uuid = UUID.Zero; | ||
205 | UUID.TryParse(parts[0], out uuid); | ||
206 | _creatorID = uuid; | ||
207 | } | ||
208 | if (parts.Length >= 2) | ||
209 | _creatorData = parts[1]; | ||
210 | if (parts.Length >= 3) | ||
211 | name = parts[2]; | ||
212 | |||
213 | _creatorData += ';' + name; | ||
214 | |||
215 | } | ||
216 | } | ||
217 | } | ||
218 | |||
163 | public string Description { | 219 | public string Description { |
164 | get { | 220 | get { |
165 | return _description; | 221 | return _description; |