diff options
author | Jeff Ames | 2008-06-26 01:12:28 +0000 |
---|---|---|
committer | Jeff Ames | 2008-06-26 01:12:28 +0000 |
commit | 8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68 (patch) | |
tree | 2891fe56398b57e5e9a78fffea9f01c171594bf8 /OpenSim/Data | |
parent | Separate POS classes into mutiple files. (diff) | |
download | opensim-SC-8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68.zip opensim-SC-8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68.tar.gz opensim-SC-8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68.tar.bz2 opensim-SC-8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68.tar.xz |
Add patch from bug #1596 - adds Doxygen documentation in OpenSim.Data.MySQL files. Thanks kerunix_Flan!
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 37 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLDataStore.cs | 68 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLGridData.cs | 24 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLInventoryData.cs | 31 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLLogData.cs | 5 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLManager.cs | 34 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserData.cs | 42 |
7 files changed, 224 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 3cda5b8..a29e11b 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -44,6 +44,13 @@ namespace OpenSim.Data.MySQL | |||
44 | 44 | ||
45 | #region IPlugin Members | 45 | #region IPlugin Members |
46 | 46 | ||
47 | /// <summary> | ||
48 | /// Initialises Asset interface | ||
49 | /// Loads and initialises the MySQL storage plugin | ||
50 | /// Warns and uses the obsolete mysql_connection.ini if connect string is empty. | ||
51 | /// Check for migration | ||
52 | /// </summary> | ||
53 | /// <param name="connect">connect string.</param> | ||
47 | override public void Initialise(string connect) | 54 | override public void Initialise(string connect) |
48 | { | 55 | { |
49 | // TODO: This will let you pass in the connect string in | 56 | // TODO: This will let you pass in the connect string in |
@@ -70,6 +77,11 @@ namespace OpenSim.Data.MySQL | |||
70 | m.Update(); | 77 | m.Update(); |
71 | } | 78 | } |
72 | 79 | ||
80 | /// <summary> | ||
81 | /// uses the obsolete mysql_connection.ini | ||
82 | /// </summary> | ||
83 | /// <param name="connect">connect string.</param> | ||
84 | /// <remarks>Probably deprecated and shouldn't be used</remarks> | ||
73 | override public void Initialise() | 85 | override public void Initialise() |
74 | { | 86 | { |
75 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); | 87 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
@@ -116,6 +128,11 @@ namespace OpenSim.Data.MySQL | |||
116 | m.Version = 1; | 128 | m.Version = 1; |
117 | } | 129 | } |
118 | 130 | ||
131 | /// <summary> | ||
132 | /// | ||
133 | /// </summary> | ||
134 | /// <param name="assetID"></param> | ||
135 | /// <returns></returns> | ||
119 | override public AssetBase FetchAsset(LLUUID assetID) | 136 | override public AssetBase FetchAsset(LLUUID assetID) |
120 | { | 137 | { |
121 | AssetBase asset = null; | 138 | AssetBase asset = null; |
@@ -157,6 +174,10 @@ namespace OpenSim.Data.MySQL | |||
157 | return asset; | 174 | return asset; |
158 | } | 175 | } |
159 | 176 | ||
177 | /// <summary> | ||
178 | /// | ||
179 | /// </summary> | ||
180 | /// <param name="asset"></param> | ||
160 | override public void CreateAsset(AssetBase asset) | 181 | override public void CreateAsset(AssetBase asset) |
161 | { | 182 | { |
162 | lock (_dbConnection) | 183 | lock (_dbConnection) |
@@ -202,11 +223,20 @@ namespace OpenSim.Data.MySQL | |||
202 | } | 223 | } |
203 | } | 224 | } |
204 | 225 | ||
226 | /// <summary> | ||
227 | /// | ||
228 | /// </summary> | ||
229 | /// <param name="asset"></param> | ||
205 | override public void UpdateAsset(AssetBase asset) | 230 | override public void UpdateAsset(AssetBase asset) |
206 | { | 231 | { |
207 | CreateAsset(asset); | 232 | CreateAsset(asset); |
208 | } | 233 | } |
209 | 234 | ||
235 | /// <summary> | ||
236 | /// | ||
237 | /// </summary> | ||
238 | /// <param name="uuid"></param> | ||
239 | /// <returns></returns> | ||
210 | override public bool ExistsAsset(LLUUID uuid) | 240 | override public bool ExistsAsset(LLUUID uuid) |
211 | { | 241 | { |
212 | bool assetExists = false; | 242 | bool assetExists = false; |
@@ -254,12 +284,17 @@ namespace OpenSim.Data.MySQL | |||
254 | 284 | ||
255 | #endregion | 285 | #endregion |
256 | 286 | ||
257 | 287 | /// <summary> | |
288 | /// database provider version | ||
289 | /// </summary> | ||
258 | override public string Version | 290 | override public string Version |
259 | { | 291 | { |
260 | get { return _dbConnection.getVersion(); } | 292 | get { return _dbConnection.getVersion(); } |
261 | } | 293 | } |
262 | 294 | ||
295 | /// <summary> | ||
296 | /// The name of this DB provider | ||
297 | /// </summary> | ||
263 | override public string Name | 298 | override public string Name |
264 | { | 299 | { |
265 | get { return "MySQL Asset storage engine"; } | 300 | get { return "MySQL Asset storage engine"; } |
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs index d3e7a90..def875f 100644 --- a/OpenSim/Data/MySQL/MySQLDataStore.cs +++ b/OpenSim/Data/MySQL/MySQLDataStore.cs | |||
@@ -85,7 +85,11 @@ namespace OpenSim.Data.MySQL | |||
85 | * | 85 | * |
86 | **********************************************************************/ | 86 | **********************************************************************/ |
87 | 87 | ||
88 | // see IRegionDataStore | 88 | /// <summary> |
89 | /// see IRegionDataStore | ||
90 | /// </summary> | ||
91 | /// <param name="connectionstring"></param> | ||
92 | /// <param name="persistPrimInventories"></param> | ||
89 | public void Initialise(string connectionstring, bool persistPrimInventories) | 93 | public void Initialise(string connectionstring, bool persistPrimInventories) |
90 | { | 94 | { |
91 | m_dataSet = new DataSet(); | 95 | m_dataSet = new DataSet(); |
@@ -221,7 +225,7 @@ namespace OpenSim.Data.MySQL | |||
221 | /// <summary> | 225 | /// <summary> |
222 | /// Execute a SQL statement stored in a resource, as a string | 226 | /// Execute a SQL statement stored in a resource, as a string |
223 | /// </summary> | 227 | /// </summary> |
224 | /// <param name="name"></param> | 228 | /// <param name="name">the ressource name</param> |
225 | public void ExecuteResourceSql(string name, MySqlConnection dbcon) | 229 | public void ExecuteResourceSql(string name, MySqlConnection dbcon) |
226 | { | 230 | { |
227 | MySqlCommand cmd = new MySqlCommand(getResourceString(name), dbcon); | 231 | MySqlCommand cmd = new MySqlCommand(getResourceString(name), dbcon); |
@@ -255,6 +259,10 @@ namespace OpenSim.Data.MySQL | |||
255 | throw new Exception(string.Format("Resource '{0}' was not found", name)); | 259 | throw new Exception(string.Format("Resource '{0}' was not found", name)); |
256 | } | 260 | } |
257 | 261 | ||
262 | /// <summary> | ||
263 | /// </summary> | ||
264 | /// <param name="oldVersion"></param> | ||
265 | /// <param name="dbconn"></param> | ||
258 | private void UpgradeLandTable(string oldVersion, MySqlConnection dbconn) | 266 | private void UpgradeLandTable(string oldVersion, MySqlConnection dbconn) |
259 | { | 267 | { |
260 | // null as the version, indicates that the table didn't exist | 268 | // null as the version, indicates that the table didn't exist |
@@ -268,6 +276,12 @@ namespace OpenSim.Data.MySQL | |||
268 | ExecuteResourceSql("UpgradeLandTableToVersion2.sql", dbconn); | 276 | ExecuteResourceSql("UpgradeLandTableToVersion2.sql", dbconn); |
269 | } | 277 | } |
270 | } | 278 | } |
279 | |||
280 | /// <summary> | ||
281 | /// Adds an object into region storage | ||
282 | /// </summary> | ||
283 | /// <param name="obj"></param> | ||
284 | /// <param name="regionUUID"></param> | ||
271 | public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) | 285 | public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) |
272 | { | 286 | { |
273 | lock (m_dataSet) | 287 | lock (m_dataSet) |
@@ -290,6 +304,11 @@ namespace OpenSim.Data.MySQL | |||
290 | } | 304 | } |
291 | } | 305 | } |
292 | 306 | ||
307 | /// <summary> | ||
308 | /// removes an object from region storage | ||
309 | /// </summary> | ||
310 | /// <param name="obj"></param> | ||
311 | /// <param name="regionUUID"></param> | ||
293 | public void RemoveObject(LLUUID obj, LLUUID regionUUID) | 312 | public void RemoveObject(LLUUID obj, LLUUID regionUUID) |
294 | { | 313 | { |
295 | m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID); | 314 | m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID); |
@@ -327,6 +346,7 @@ namespace OpenSim.Data.MySQL | |||
327 | /// Remove all persisted items of the given prim. | 346 | /// Remove all persisted items of the given prim. |
328 | /// The caller must acquire the necessrary synchronization locks and commit or rollback changes. | 347 | /// The caller must acquire the necessrary synchronization locks and commit or rollback changes. |
329 | /// </summary> | 348 | /// </summary> |
349 | /// <param name="uuid">the Item UUID</param> | ||
330 | private void RemoveItems(LLUUID uuid) | 350 | private void RemoveItems(LLUUID uuid) |
331 | { | 351 | { |
332 | String sql = String.Format("primID = '{0}'", uuid); | 352 | String sql = String.Format("primID = '{0}'", uuid); |
@@ -341,6 +361,7 @@ namespace OpenSim.Data.MySQL | |||
341 | /// <summary> | 361 | /// <summary> |
342 | /// Load persisted objects from region storage. | 362 | /// Load persisted objects from region storage. |
343 | /// </summary> | 363 | /// </summary> |
364 | /// <param name="regionUUID">the Region UUID</param> | ||
344 | public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID) | 365 | public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID) |
345 | { | 366 | { |
346 | Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>(); | 367 | Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>(); |
@@ -460,6 +481,11 @@ namespace OpenSim.Data.MySQL | |||
460 | } | 481 | } |
461 | } | 482 | } |
462 | 483 | ||
484 | /// <summary> | ||
485 | /// Store a terrain revision in region storage | ||
486 | /// </summary> | ||
487 | /// <param name="ter">terrain data</param> | ||
488 | /// <param name="regionID">region UUID</param> | ||
463 | public void StoreTerrain(double[,] ter, LLUUID regionID) | 489 | public void StoreTerrain(double[,] ter, LLUUID regionID) |
464 | { | 490 | { |
465 | int revision = 1; | 491 | int revision = 1; |
@@ -483,6 +509,11 @@ namespace OpenSim.Data.MySQL | |||
483 | } | 509 | } |
484 | } | 510 | } |
485 | 511 | ||
512 | /// <summary> | ||
513 | /// Load the latest terrain revision from region storage | ||
514 | /// </summary> | ||
515 | /// <param name="regionID">the region UUID</param> | ||
516 | /// <returns></returns> | ||
486 | public double[,] LoadTerrain(LLUUID regionID) | 517 | public double[,] LoadTerrain(LLUUID regionID) |
487 | { | 518 | { |
488 | double[,] terret = new double[256,256]; | 519 | double[,] terret = new double[256,256]; |
@@ -531,6 +562,11 @@ namespace OpenSim.Data.MySQL | |||
531 | return terret; | 562 | return terret; |
532 | } | 563 | } |
533 | 564 | ||
565 | /// <summary> | ||
566 | /// delete from land where UUID=globalID | ||
567 | /// delete from landaccesslist where LandUUID=globalID | ||
568 | /// </summary> | ||
569 | /// <param name="globalID"></param> | ||
534 | public void RemoveLandObject(LLUUID globalID) | 570 | public void RemoveLandObject(LLUUID globalID) |
535 | { | 571 | { |
536 | lock (m_dataSet) | 572 | lock (m_dataSet) |
@@ -551,6 +587,9 @@ namespace OpenSim.Data.MySQL | |||
551 | } | 587 | } |
552 | } | 588 | } |
553 | 589 | ||
590 | /// <summary> | ||
591 | /// </summary> | ||
592 | /// <param name="parcel"></param> | ||
554 | public void StoreLandObject(ILandObject parcel) | 593 | public void StoreLandObject(ILandObject parcel) |
555 | { | 594 | { |
556 | lock (m_dataSet) | 595 | lock (m_dataSet) |
@@ -589,6 +628,11 @@ namespace OpenSim.Data.MySQL | |||
589 | } | 628 | } |
590 | } | 629 | } |
591 | 630 | ||
631 | /// <summary> | ||
632 | /// | ||
633 | /// </summary> | ||
634 | /// <param name="regionUUID"></param> | ||
635 | /// <returns></returns> | ||
592 | public List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID) | 636 | public List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID) |
593 | { | 637 | { |
594 | List<RegionBanListItem> regionbanlist = new List<RegionBanListItem>(); | 638 | List<RegionBanListItem> regionbanlist = new List<RegionBanListItem>(); |
@@ -615,6 +659,10 @@ namespace OpenSim.Data.MySQL | |||
615 | } | 659 | } |
616 | } | 660 | } |
617 | 661 | ||
662 | /// <summary> | ||
663 | /// | ||
664 | /// </summary> | ||
665 | /// <param name="item"></param> | ||
618 | public void AddToRegionBanlist(RegionBanListItem item) | 666 | public void AddToRegionBanlist(RegionBanListItem item) |
619 | { | 667 | { |
620 | lock (m_dataSet) | 668 | lock (m_dataSet) |
@@ -635,6 +683,10 @@ namespace OpenSim.Data.MySQL | |||
635 | } | 683 | } |
636 | } | 684 | } |
637 | 685 | ||
686 | /// <summary> | ||
687 | /// | ||
688 | /// </summary> | ||
689 | /// <param name="item"></param> | ||
638 | public void RemoveFromRegionBanlist(RegionBanListItem item) | 690 | public void RemoveFromRegionBanlist(RegionBanListItem item) |
639 | { | 691 | { |
640 | lock (m_dataSet) | 692 | lock (m_dataSet) |
@@ -669,6 +721,11 @@ namespace OpenSim.Data.MySQL | |||
669 | 721 | ||
670 | } | 722 | } |
671 | 723 | ||
724 | /// <summary> | ||
725 | /// | ||
726 | /// </summary> | ||
727 | /// <param name="regionUUID"></param> | ||
728 | /// <returns></returns> | ||
672 | public List<LandData> LoadLandObjects(LLUUID regionUUID) | 729 | public List<LandData> LoadLandObjects(LLUUID regionUUID) |
673 | { | 730 | { |
674 | List<LandData> landDataForRegion = new List<LandData>(); | 731 | List<LandData> landDataForRegion = new List<LandData>(); |
@@ -694,6 +751,9 @@ namespace OpenSim.Data.MySQL | |||
694 | return landDataForRegion; | 751 | return landDataForRegion; |
695 | } | 752 | } |
696 | 753 | ||
754 | /// <summary> | ||
755 | /// | ||
756 | /// </summary> | ||
697 | public void Commit() | 757 | public void Commit() |
698 | { | 758 | { |
699 | if (m_connection.State != ConnectionState.Open) | 759 | if (m_connection.State != ConnectionState.Open) |
@@ -722,7 +782,9 @@ namespace OpenSim.Data.MySQL | |||
722 | } | 782 | } |
723 | } | 783 | } |
724 | 784 | ||
725 | 785 | /// <summary> | |
786 | /// | ||
787 | /// </summary> | ||
726 | public void Shutdown() | 788 | public void Shutdown() |
727 | { | 789 | { |
728 | Commit(); | 790 | Commit(); |
diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs index e5940e2..394dbbd 100644 --- a/OpenSim/Data/MySQL/MySQLGridData.cs +++ b/OpenSim/Data/MySQL/MySQLGridData.cs | |||
@@ -49,8 +49,12 @@ namespace OpenSim.Data.MySQL | |||
49 | private MySQLManager database; | 49 | private MySQLManager database; |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Initialises the Grid Interface | 52 | /// Initialises Grid interface |
53 | /// Loads and initialises the MySQL storage plugin | ||
54 | /// Warns and uses the obsolete mysql_connection.ini if connect string is empty. | ||
55 | /// Check for migration | ||
53 | /// </summary> | 56 | /// </summary> |
57 | /// <param name="connect">connect string.</param> | ||
54 | override public void Initialise(string connect) | 58 | override public void Initialise(string connect) |
55 | { | 59 | { |
56 | if (connect != String.Empty) | 60 | if (connect != String.Empty) |
@@ -166,7 +170,7 @@ namespace OpenSim.Data.MySQL | |||
166 | /// <param name="ymin">Minimum Y coordinate</param> | 170 | /// <param name="ymin">Minimum Y coordinate</param> |
167 | /// <param name="xmax">Maximum X coordinate</param> | 171 | /// <param name="xmax">Maximum X coordinate</param> |
168 | /// <param name="ymax">Maximum Y coordinate</param> | 172 | /// <param name="ymax">Maximum Y coordinate</param> |
169 | /// <returns></returns> | 173 | /// <returns>Array of sim profiles</returns> |
170 | override public RegionProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax) | 174 | override public RegionProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax) |
171 | { | 175 | { |
172 | try | 176 | try |
@@ -332,15 +336,21 @@ namespace OpenSim.Data.MySQL | |||
332 | } | 336 | } |
333 | } | 337 | } |
334 | 338 | ||
339 | /// <summary> | ||
340 | /// Update a sim profile | ||
341 | /// </summary> | ||
342 | /// <param name="profile">The profile to update</param> | ||
343 | /// <returns>Sucessful?</returns> | ||
344 | /// <remarks>Same as AddProfile</remarks> | ||
335 | override public DataResponse UpdateProfile(RegionProfileData profile) | 345 | override public DataResponse UpdateProfile(RegionProfileData profile) |
336 | { | 346 | { |
337 | return AddProfile(profile); | 347 | return AddProfile(profile); |
338 | } | 348 | } |
339 | 349 | ||
340 | /// <summary> | 350 | /// <summary> |
341 | /// Deletes a profile from the database | 351 | /// Deletes a sim profile from the database |
342 | /// </summary> | 352 | /// </summary> |
343 | /// <param name="profile">The profile to delete</param> | 353 | /// <param name="uuid">the sim UUID</param> |
344 | /// <returns>Successful?</returns> | 354 | /// <returns>Successful?</returns> |
345 | //public DataResponse DeleteProfile(RegionProfileData profile) | 355 | //public DataResponse DeleteProfile(RegionProfileData profile) |
346 | public DataResponse DeleteProfile(string uuid) | 356 | public DataResponse DeleteProfile(string uuid) |
@@ -397,6 +407,12 @@ namespace OpenSim.Data.MySQL | |||
397 | return false; | 407 | return false; |
398 | } | 408 | } |
399 | 409 | ||
410 | /// <summary> | ||
411 | /// Adds a location reservation | ||
412 | /// </summary> | ||
413 | /// <param name="x"></param> | ||
414 | /// <param name="y"></param> | ||
415 | /// <returns></returns> | ||
400 | override public ReservationData GetReservationAtPoint(uint x, uint y) | 416 | override public ReservationData GetReservationAtPoint(uint x, uint y) |
401 | { | 417 | { |
402 | try | 418 | try |
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index de0826f..2d93df3 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -48,6 +48,13 @@ namespace OpenSim.Data.MySQL | |||
48 | /// </summary> | 48 | /// </summary> |
49 | private MySQLManager database; | 49 | private MySQLManager database; |
50 | 50 | ||
51 | /// <summary> | ||
52 | /// Initialises User interface | ||
53 | /// Loads and initialises the MySQL storage plugin | ||
54 | /// warns and uses the obsolete mysql_connection.ini if connect string is empty. | ||
55 | /// Check for migration | ||
56 | /// </summary> | ||
57 | /// <param name="connect">connect string.</param> | ||
51 | public void Initialise(string connect) | 58 | public void Initialise(string connect) |
52 | { | 59 | { |
53 | if (connect != String.Empty) | 60 | if (connect != String.Empty) |
@@ -162,6 +169,7 @@ namespace OpenSim.Data.MySQL | |||
162 | /// <summary> | 169 | /// <summary> |
163 | /// Closes this DB provider | 170 | /// Closes this DB provider |
164 | /// </summary> | 171 | /// </summary> |
172 | /// <remarks>do nothing</remarks> | ||
165 | public void Close() | 173 | public void Close() |
166 | { | 174 | { |
167 | // Do nothing. | 175 | // Do nothing. |
@@ -250,7 +258,12 @@ namespace OpenSim.Data.MySQL | |||
250 | } | 258 | } |
251 | } | 259 | } |
252 | 260 | ||
253 | // see InventoryItemBase.getUserRootFolder | 261 | |
262 | /// <summary> | ||
263 | /// see InventoryItemBase.getUserRootFolder | ||
264 | /// </summary> | ||
265 | /// <param name="user"></param> | ||
266 | /// <returns></returns> | ||
254 | public InventoryFolderBase getUserRootFolder(LLUUID user) | 267 | public InventoryFolderBase getUserRootFolder(LLUUID user) |
255 | { | 268 | { |
256 | try | 269 | try |
@@ -595,6 +608,7 @@ namespace OpenSim.Data.MySQL | |||
595 | addInventoryFolder(folder); | 608 | addInventoryFolder(folder); |
596 | } | 609 | } |
597 | 610 | ||
611 | /// <summary> | ||
598 | /// Creates a new inventory folder | 612 | /// Creates a new inventory folder |
599 | /// </summary> | 613 | /// </summary> |
600 | /// <param name="folder">Folder to create</param> | 614 | /// <param name="folder">Folder to create</param> |
@@ -633,7 +647,12 @@ namespace OpenSim.Data.MySQL | |||
633 | folders.Add(f); | 647 | folders.Add(f); |
634 | } | 648 | } |
635 | 649 | ||
636 | // See IInventoryData | 650 | |
651 | /// <summary> | ||
652 | /// See IInventoryData | ||
653 | /// </summary> | ||
654 | /// <param name="parentID"></param> | ||
655 | /// <returns></returns> | ||
637 | public List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID) | 656 | public List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID) |
638 | { | 657 | { |
639 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | 658 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); |
@@ -645,6 +664,10 @@ namespace OpenSim.Data.MySQL | |||
645 | return folders; | 664 | return folders; |
646 | } | 665 | } |
647 | 666 | ||
667 | /// <summary> | ||
668 | /// Delete a folder from database | ||
669 | /// </summary> | ||
670 | /// <param name="folderID">the folder UUID</param> | ||
648 | protected void deleteOneFolder(LLUUID folderID) | 671 | protected void deleteOneFolder(LLUUID folderID) |
649 | { | 672 | { |
650 | try | 673 | try |
@@ -665,6 +688,10 @@ namespace OpenSim.Data.MySQL | |||
665 | } | 688 | } |
666 | } | 689 | } |
667 | 690 | ||
691 | /// <summary> | ||
692 | /// Delete all item in a folder | ||
693 | /// </summary> | ||
694 | /// <param name="folderID">the folder UUID</param> | ||
668 | protected void deleteItemsInFolder(LLUUID folderID) | 695 | protected void deleteItemsInFolder(LLUUID folderID) |
669 | { | 696 | { |
670 | try | 697 | try |
diff --git a/OpenSim/Data/MySQL/MySQLLogData.cs b/OpenSim/Data/MySQL/MySQLLogData.cs index 2ca5bb2..fee7f2f 100644 --- a/OpenSim/Data/MySQL/MySQLLogData.cs +++ b/OpenSim/Data/MySQL/MySQLLogData.cs | |||
@@ -44,7 +44,9 @@ namespace OpenSim.Data.MySQL | |||
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Artificial constructor called when the plugin is loaded | 46 | /// Artificial constructor called when the plugin is loaded |
47 | /// Uses the obsolete mysql_connection.ini if connect string is empty. | ||
47 | /// </summary> | 48 | /// </summary> |
49 | /// <param name="connect">connect string</param> | ||
48 | public void Initialise(string connect) | 50 | public void Initialise(string connect) |
49 | { | 51 | { |
50 | if (connect != String.Empty) | 52 | if (connect != String.Empty) |
@@ -79,6 +81,8 @@ namespace OpenSim.Data.MySQL | |||
79 | 81 | ||
80 | } | 82 | } |
81 | 83 | ||
84 | /// <summary></summary> | ||
85 | /// <param name="m"></param> | ||
82 | private void TestTables(Migration m) | 86 | private void TestTables(Migration m) |
83 | { | 87 | { |
84 | // under migrations, bail | 88 | // under migrations, bail |
@@ -132,6 +136,7 @@ namespace OpenSim.Data.MySQL | |||
132 | /// <summary> | 136 | /// <summary> |
133 | /// Closes the database provider | 137 | /// Closes the database provider |
134 | /// </summary> | 138 | /// </summary> |
139 | /// <remarks>do nothing</remarks> | ||
135 | public void Close() | 140 | public void Close() |
136 | { | 141 | { |
137 | // Do nothing. | 142 | // Do nothing. |
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 4b11739..7c3ed28 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs | |||
@@ -62,6 +62,7 @@ namespace OpenSim.Data.MySQL | |||
62 | /// <param name="username">The username logging into the database</param> | 62 | /// <param name="username">The username logging into the database</param> |
63 | /// <param name="password">The password for the user logging in</param> | 63 | /// <param name="password">The password for the user logging in</param> |
64 | /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param> | 64 | /// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param> |
65 | /// <param name="port">The MySQL server port</param> | ||
65 | public MySQLManager(string hostname, string database, string username, string password, string cpooling, | 66 | public MySQLManager(string hostname, string database, string username, string password, string cpooling, |
66 | string port) | 67 | string port) |
67 | { | 68 | { |
@@ -71,11 +72,19 @@ namespace OpenSim.Data.MySQL | |||
71 | Initialise(s); | 72 | Initialise(s); |
72 | } | 73 | } |
73 | 74 | ||
75 | /// <summary> | ||
76 | /// Initialises and creates a new MySQL connection and maintains it. | ||
77 | /// </summary> | ||
78 | /// <param name="connect">connectionString</param> | ||
74 | public MySQLManager(String connect) | 79 | public MySQLManager(String connect) |
75 | { | 80 | { |
76 | Initialise(connect); | 81 | Initialise(connect); |
77 | } | 82 | } |
78 | 83 | ||
84 | /// <summary> | ||
85 | /// Initialises and creates a new MySQL connection and maintains it. | ||
86 | /// </summary> | ||
87 | /// <param name="connect">connectionString</param> | ||
79 | public void Initialise(String connect) | 88 | public void Initialise(String connect) |
80 | { | 89 | { |
81 | try | 90 | try |
@@ -103,6 +112,7 @@ namespace OpenSim.Data.MySQL | |||
103 | /// <summary> | 112 | /// <summary> |
104 | /// Get the connection being used | 113 | /// Get the connection being used |
105 | /// </summary> | 114 | /// </summary> |
115 | /// <returns>MySqlConnection Object</returns> | ||
106 | public MySqlConnection Connection | 116 | public MySqlConnection Connection |
107 | { | 117 | { |
108 | get { return dbcon; } | 118 | get { return dbcon; } |
@@ -184,13 +194,17 @@ namespace OpenSim.Data.MySQL | |||
184 | /// <summary> | 194 | /// <summary> |
185 | /// Execute a SQL statement stored in a resource, as a string | 195 | /// Execute a SQL statement stored in a resource, as a string |
186 | /// </summary> | 196 | /// </summary> |
187 | /// <param name="name"></param> | 197 | /// <param name="name">name of embedded resource</param> |
188 | public void ExecuteResourceSql(string name) | 198 | public void ExecuteResourceSql(string name) |
189 | { | 199 | { |
190 | MySqlCommand cmd = new MySqlCommand(getResourceString(name), dbcon); | 200 | MySqlCommand cmd = new MySqlCommand(getResourceString(name), dbcon); |
191 | cmd.ExecuteNonQuery(); | 201 | cmd.ExecuteNonQuery(); |
192 | } | 202 | } |
193 | 203 | ||
204 | /// <summary> | ||
205 | /// Execute a MySqlCommand | ||
206 | /// </summary> | ||
207 | /// <param name="sql">sql string to execute</param> | ||
194 | public void ExecuteSql(string sql) | 208 | public void ExecuteSql(string sql) |
195 | { | 209 | { |
196 | MySqlCommand cmd = new MySqlCommand(sql, dbcon); | 210 | MySqlCommand cmd = new MySqlCommand(sql, dbcon); |
@@ -536,6 +550,11 @@ namespace OpenSim.Data.MySQL | |||
536 | return retval; | 550 | return retval; |
537 | } | 551 | } |
538 | 552 | ||
553 | /// <summary> | ||
554 | /// Reads an avatar appearence from an active data reader | ||
555 | /// </summary> | ||
556 | /// <param name="reader">An active database reader</param> | ||
557 | /// <returns>An avatar appearence</returns> | ||
539 | public AvatarAppearance readAppearanceRow(IDataReader reader) | 558 | public AvatarAppearance readAppearanceRow(IDataReader reader) |
540 | { | 559 | { |
541 | AvatarAppearance appearance = null; | 560 | AvatarAppearance appearance = null; |
@@ -647,6 +666,7 @@ namespace OpenSim.Data.MySQL | |||
647 | /// <param name="firstText">Firstlife text</param> | 666 | /// <param name="firstText">Firstlife text</param> |
648 | /// <param name="profileImage">UUID for profile image</param> | 667 | /// <param name="profileImage">UUID for profile image</param> |
649 | /// <param name="firstImage">UUID for firstlife image</param> | 668 | /// <param name="firstImage">UUID for firstlife image</param> |
669 | /// <param name="webLoginKey">Ignored</param> | ||
650 | /// <returns>Success?</returns> | 670 | /// <returns>Success?</returns> |
651 | public bool insertUserRow(LLUUID uuid, string username, string lastname, string passwordHash, | 671 | public bool insertUserRow(LLUUID uuid, string username, string lastname, string passwordHash, |
652 | string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, | 672 | string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, |
@@ -718,7 +738,7 @@ namespace OpenSim.Data.MySQL | |||
718 | } | 738 | } |
719 | 739 | ||
720 | /// <summary> | 740 | /// <summary> |
721 | /// Creates a new user and inserts it into the database | 741 | /// Update user data into the database where User ID = uuid |
722 | /// </summary> | 742 | /// </summary> |
723 | /// <param name="uuid">User ID</param> | 743 | /// <param name="uuid">User ID</param> |
724 | /// <param name="username">First part of the login</param> | 744 | /// <param name="username">First part of the login</param> |
@@ -742,6 +762,7 @@ namespace OpenSim.Data.MySQL | |||
742 | /// <param name="firstText">Firstlife text</param> | 762 | /// <param name="firstText">Firstlife text</param> |
743 | /// <param name="profileImage">UUID for profile image</param> | 763 | /// <param name="profileImage">UUID for profile image</param> |
744 | /// <param name="firstImage">UUID for firstlife image</param> | 764 | /// <param name="firstImage">UUID for firstlife image</param> |
765 | /// <param name="webLoginKey">UUID for weblogin Key</param> | ||
745 | /// <returns>Success?</returns> | 766 | /// <returns>Success?</returns> |
746 | public bool updateUserRow(LLUUID uuid, string username, string lastname, string passwordHash, | 767 | public bool updateUserRow(LLUUID uuid, string username, string lastname, string passwordHash, |
747 | string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, | 768 | string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, |
@@ -810,7 +831,7 @@ namespace OpenSim.Data.MySQL | |||
810 | /// <summary> | 831 | /// <summary> |
811 | /// Inserts a new region into the database | 832 | /// Inserts a new region into the database |
812 | /// </summary> | 833 | /// </summary> |
813 | /// <param name="profile">The region to insert</param> | 834 | /// <param name="regiondata">The region to insert</param> |
814 | /// <returns>Success?</returns> | 835 | /// <returns>Success?</returns> |
815 | public bool insertRegion(RegionProfileData regiondata) | 836 | public bool insertRegion(RegionProfileData regiondata) |
816 | { | 837 | { |
@@ -914,7 +935,7 @@ namespace OpenSim.Data.MySQL | |||
914 | /// <summary> | 935 | /// <summary> |
915 | /// Delete a region from the database | 936 | /// Delete a region from the database |
916 | /// </summary> | 937 | /// </summary> |
917 | /// <param name="profile">The region to insert</param> | 938 | /// <param name="uuid">The region to delete</param> |
918 | /// <returns>Success?</returns> | 939 | /// <returns>Success?</returns> |
919 | //public bool deleteRegion(RegionProfileData regiondata) | 940 | //public bool deleteRegion(RegionProfileData regiondata) |
920 | public bool deleteRegion(string uuid) | 941 | public bool deleteRegion(string uuid) |
@@ -995,6 +1016,11 @@ namespace OpenSim.Data.MySQL | |||
995 | return returnval; | 1016 | return returnval; |
996 | } | 1017 | } |
997 | 1018 | ||
1019 | /// <summary> | ||
1020 | /// Create (or replace if existing) an avatar appearence | ||
1021 | /// </summary> | ||
1022 | /// <param name="appearance"></param> | ||
1023 | /// <returns>Succes?</returns> | ||
998 | public bool insertAppearanceRow(AvatarAppearance appearance) | 1024 | public bool insertAppearanceRow(AvatarAppearance appearance) |
999 | { | 1025 | { |
1000 | string sql = String.Empty; | 1026 | string sql = String.Empty; |
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index 05874f8..11d9c26 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs | |||
@@ -56,8 +56,12 @@ namespace OpenSim.Data.MySQL | |||
56 | private string m_connectString; | 56 | private string m_connectString; |
57 | 57 | ||
58 | /// <summary> | 58 | /// <summary> |
59 | /// Initialise User Interface | ||
59 | /// Loads and initialises the MySQL storage plugin | 60 | /// Loads and initialises the MySQL storage plugin |
61 | /// Warns and uses the obsolete mysql_connection.ini if connect string is empty. | ||
62 | /// Checks for migration | ||
60 | /// </summary> | 63 | /// </summary> |
64 | /// <param name="connect">connect string.</param> | ||
61 | override public void Initialise(string connect) | 65 | override public void Initialise(string connect) |
62 | { | 66 | { |
63 | if (connect == String.Empty) { | 67 | if (connect == String.Empty) { |
@@ -494,7 +498,11 @@ namespace OpenSim.Data.MySQL | |||
494 | return returnlist; | 498 | return returnlist; |
495 | } | 499 | } |
496 | 500 | ||
497 | // see IUserData | 501 | /// <summary> |
502 | /// See IUserData | ||
503 | /// </summary> | ||
504 | /// <param name="uuid">User UUID</param> | ||
505 | /// <returns>User profile data</returns> | ||
498 | override public UserProfileData GetUserByUUID(LLUUID uuid) | 506 | override public UserProfileData GetUserByUUID(LLUUID uuid) |
499 | { | 507 | { |
500 | try | 508 | try |
@@ -526,7 +534,7 @@ namespace OpenSim.Data.MySQL | |||
526 | /// <summary> | 534 | /// <summary> |
527 | /// Returns a user session searching by name | 535 | /// Returns a user session searching by name |
528 | /// </summary> | 536 | /// </summary> |
529 | /// <param name="name">The account name</param> | 537 | /// <param name="name">The account name : "Username Lastname"</param> |
530 | /// <returns>The users session</returns> | 538 | /// <returns>The users session</returns> |
531 | override public UserAgentData GetAgentByName(string name) | 539 | override public UserAgentData GetAgentByName(string name) |
532 | { | 540 | { |
@@ -545,6 +553,11 @@ namespace OpenSim.Data.MySQL | |||
545 | return GetAgentByUUID(profile.ID); | 553 | return GetAgentByUUID(profile.ID); |
546 | } | 554 | } |
547 | 555 | ||
556 | /// <summary> | ||
557 | /// </summary> | ||
558 | /// <param name="AgentID"></param> | ||
559 | /// <param name="WebLoginKey"></param> | ||
560 | /// <remarks>is it still used ?</remarks> | ||
548 | override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) | 561 | override public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) |
549 | { | 562 | { |
550 | Dictionary<string, string> param = new Dictionary<string, string>(); | 563 | Dictionary<string, string> param = new Dictionary<string, string>(); |
@@ -694,9 +707,11 @@ namespace OpenSim.Data.MySQL | |||
694 | return false; | 707 | return false; |
695 | } | 708 | } |
696 | 709 | ||
710 | /// <summary> | ||
697 | /// Appearance | 711 | /// Appearance |
698 | /// TODO: stubs for now to get us to a compiling state gently | 712 | /// TODO: stubs for now to get us to a compiling state gently |
699 | // override | 713 | /// override |
714 | /// </summary> | ||
700 | override public AvatarAppearance GetUserAppearance(LLUUID user) | 715 | override public AvatarAppearance GetUserAppearance(LLUUID user) |
701 | { | 716 | { |
702 | try { | 717 | try { |
@@ -723,6 +738,12 @@ namespace OpenSim.Data.MySQL | |||
723 | return null; | 738 | return null; |
724 | } | 739 | } |
725 | } | 740 | } |
741 | |||
742 | /// <summary> | ||
743 | /// Updates an avatar appearence | ||
744 | /// </summary> | ||
745 | /// <param name="user">The user UUID</param> | ||
746 | /// <param name="appearance">The avatar appearance</param> | ||
726 | // override | 747 | // override |
727 | override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) | 748 | override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) |
728 | { | 749 | { |
@@ -741,16 +762,31 @@ namespace OpenSim.Data.MySQL | |||
741 | } | 762 | } |
742 | } | 763 | } |
743 | 764 | ||
765 | /// <summary> | ||
766 | /// Adds an attachment item to a user | ||
767 | /// </summary> | ||
768 | /// <param name="user">the user UUID</param> | ||
769 | /// <param name="item">the item UUID</param> | ||
744 | override public void AddAttachment(LLUUID user, LLUUID item) | 770 | override public void AddAttachment(LLUUID user, LLUUID item) |
745 | { | 771 | { |
746 | return; | 772 | return; |
747 | } | 773 | } |
748 | 774 | ||
775 | /// <summary> | ||
776 | /// Removes an attachment from a user | ||
777 | /// </summary> | ||
778 | /// <param name="user">the user UUID</param> | ||
779 | /// <param name="item">the item UUID</param> | ||
749 | override public void RemoveAttachment(LLUUID user, LLUUID item) | 780 | override public void RemoveAttachment(LLUUID user, LLUUID item) |
750 | { | 781 | { |
751 | return; | 782 | return; |
752 | } | 783 | } |
753 | 784 | ||
785 | /// <summary> | ||
786 | /// Get the list of item attached to a user | ||
787 | /// </summary> | ||
788 | /// <param name="user">the user UUID</param> | ||
789 | /// <returns>UUID list of attached item</returns> | ||
754 | override public List<LLUUID> GetAttachments(LLUUID user) | 790 | override public List<LLUUID> GetAttachments(LLUUID user) |
755 | { | 791 | { |
756 | return new List<LLUUID>(); | 792 | return new List<LLUUID>(); |