aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLDataStore.cs
diff options
context:
space:
mode:
authorJeff Ames2008-06-26 01:12:28 +0000
committerJeff Ames2008-06-26 01:12:28 +0000
commit8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68 (patch)
tree2891fe56398b57e5e9a78fffea9f01c171594bf8 /OpenSim/Data/MySQL/MySQLDataStore.cs
parentSeparate POS classes into mutiple files. (diff)
downloadopensim-SC_OLD-8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68.zip
opensim-SC_OLD-8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68.tar.gz
opensim-SC_OLD-8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68.tar.bz2
opensim-SC_OLD-8a0a0f9bb563f2cb7ec823587e13e3f4483d3a68.tar.xz
Add patch from bug #1596 - adds Doxygen documentation in OpenSim.Data.MySQL files. Thanks kerunix_Flan!
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLDataStore.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLDataStore.cs68
1 files changed, 65 insertions, 3 deletions
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();