aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLDataStore.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-05-01 16:03:53 +0000
committerAdam Frisby2008-05-01 16:03:53 +0000
commit523190377861292dfecdaddebe1204301a0c7912 (patch)
treec003fa3c03389fc2d701d6797557c693a4eb29fc /OpenSim/Data/MySQL/MySQLDataStore.cs
parentAdd basic OS X support to LaunchSLClient (diff)
downloadopensim-SC_OLD-523190377861292dfecdaddebe1204301a0c7912.zip
opensim-SC_OLD-523190377861292dfecdaddebe1204301a0c7912.tar.gz
opensim-SC_OLD-523190377861292dfecdaddebe1204301a0c7912.tar.bz2
opensim-SC_OLD-523190377861292dfecdaddebe1204301a0c7912.tar.xz
* In ur code. Making it static.
* Converted a bunch of functions to static functions.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLDataStore.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLDataStore.cs44
1 files changed, 22 insertions, 22 deletions
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs
index 33981de..c3fe332 100644
--- a/OpenSim/Data/MySQL/MySQLDataStore.cs
+++ b/OpenSim/Data/MySQL/MySQLDataStore.cs
@@ -627,24 +627,24 @@ namespace OpenSim.Data.MySQL
627 * 627 *
628 **********************************************************************/ 628 **********************************************************************/
629 629
630 private DataColumn createCol(DataTable dt, string name, Type type) 630 private static DataColumn createCol(DataTable dt, string name, Type type)
631 { 631 {
632 DataColumn col = new DataColumn(name, type); 632 DataColumn col = new DataColumn(name, type);
633 dt.Columns.Add(col); 633 dt.Columns.Add(col);
634 return col; 634 return col;
635 } 635 }
636 636
637 private DataTable createTerrainTable() 637 private static DataTable createTerrainTable()
638 { 638 {
639 DataTable terrain = new DataTable("terrain"); 639 DataTable terrain = new DataTable("terrain");
640 640
641 createCol(terrain, "RegionUUID", typeof (String)); 641 createCol(terrain, "RegionUUID", typeof (String));
642 createCol(terrain, "Revision", typeof (Int32)); 642 createCol(terrain, "Revision", typeof (Int32));
643 DataColumn heightField = createCol(terrain, "Heightfield", typeof (Byte[])); 643 createCol(terrain, "Heightfield", typeof (Byte[]));
644 return terrain; 644 return terrain;
645 } 645 }
646 646
647 private DataTable createPrimTable() 647 private static DataTable createPrimTable()
648 { 648 {
649 DataTable prims = new DataTable("prims"); 649 DataTable prims = new DataTable("prims");
650 650
@@ -708,7 +708,7 @@ namespace OpenSim.Data.MySQL
708 return prims; 708 return prims;
709 } 709 }
710 710
711 private DataTable createLandTable() 711 private static DataTable createLandTable()
712 { 712 {
713 DataTable land = new DataTable("land"); 713 DataTable land = new DataTable("land");
714 createCol(land, "UUID", typeof (String)); 714 createCol(land, "UUID", typeof (String));
@@ -752,7 +752,7 @@ namespace OpenSim.Data.MySQL
752 return land; 752 return land;
753 } 753 }
754 754
755 private DataTable createLandAccessListTable() 755 private static DataTable createLandAccessListTable()
756 { 756 {
757 DataTable landaccess = new DataTable("landaccesslist"); 757 DataTable landaccess = new DataTable("landaccesslist");
758 createCol(landaccess, "LandUUID", typeof (String)); 758 createCol(landaccess, "LandUUID", typeof (String));
@@ -762,7 +762,7 @@ namespace OpenSim.Data.MySQL
762 return landaccess; 762 return landaccess;
763 } 763 }
764 764
765 private DataTable createShapeTable() 765 private static DataTable createShapeTable()
766 { 766 {
767 DataTable shapes = new DataTable("primshapes"); 767 DataTable shapes = new DataTable("primshapes");
768 createCol(shapes, "UUID", typeof (String)); 768 createCol(shapes, "UUID", typeof (String));
@@ -802,7 +802,7 @@ namespace OpenSim.Data.MySQL
802 return shapes; 802 return shapes;
803 } 803 }
804 804
805 private DataTable createItemsTable() 805 private static DataTable createItemsTable()
806 { 806 {
807 DataTable items = new DataTable("primitems"); 807 DataTable items = new DataTable("primitems");
808 808
@@ -937,7 +937,7 @@ namespace OpenSim.Data.MySQL
937 /// </summary> 937 /// </summary>
938 /// <param name="row"></param> 938 /// <param name="row"></param>
939 /// <returns></returns> 939 /// <returns></returns>
940 private TaskInventoryItem buildItem(DataRow row) 940 private static TaskInventoryItem buildItem(DataRow row)
941 { 941 {
942 TaskInventoryItem taskItem = new TaskInventoryItem(); 942 TaskInventoryItem taskItem = new TaskInventoryItem();
943 943
@@ -966,7 +966,7 @@ namespace OpenSim.Data.MySQL
966 return taskItem; 966 return taskItem;
967 } 967 }
968 968
969 private LandData buildLandData(DataRow row) 969 private static LandData buildLandData(DataRow row)
970 { 970 {
971 LandData newData = new LandData(); 971 LandData newData = new LandData();
972 972
@@ -1018,7 +1018,7 @@ namespace OpenSim.Data.MySQL
1018 return newData; 1018 return newData;
1019 } 1019 }
1020 1020
1021 private ParcelManager.ParcelAccessEntry buildLandAccessData(DataRow row) 1021 private static ParcelManager.ParcelAccessEntry buildLandAccessData(DataRow row)
1022 { 1022 {
1023 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); 1023 ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
1024 entry.AgentID = new LLUUID((string) row["AccessUUID"]); 1024 entry.AgentID = new LLUUID((string) row["AccessUUID"]);
@@ -1027,7 +1027,7 @@ namespace OpenSim.Data.MySQL
1027 return entry; 1027 return entry;
1028 } 1028 }
1029 1029
1030 private Array serializeTerrain(double[,] val) 1030 private static Array serializeTerrain(double[,] val)
1031 { 1031 {
1032 MemoryStream str = new MemoryStream(65536*sizeof (double)); 1032 MemoryStream str = new MemoryStream(65536*sizeof (double));
1033 BinaryWriter bw = new BinaryWriter(str); 1033 BinaryWriter bw = new BinaryWriter(str);
@@ -1116,7 +1116,7 @@ namespace OpenSim.Data.MySQL
1116 } 1116 }
1117 } 1117 }
1118 1118
1119 private void fillItemRow(DataRow row, TaskInventoryItem taskItem) 1119 private static void fillItemRow(DataRow row, TaskInventoryItem taskItem)
1120 { 1120 {
1121 row["itemID"] = taskItem.ItemID; 1121 row["itemID"] = taskItem.ItemID;
1122 row["primID"] = taskItem.ParentPartID; 1122 row["primID"] = taskItem.ParentPartID;
@@ -1140,7 +1140,7 @@ namespace OpenSim.Data.MySQL
1140 row["groupPermissions"] = taskItem.GroupMask; 1140 row["groupPermissions"] = taskItem.GroupMask;
1141 } 1141 }
1142 1142
1143 private void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) 1143 private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID)
1144 { 1144 {
1145 row["UUID"] = Util.ToRawUuidString(land.globalID); 1145 row["UUID"] = Util.ToRawUuidString(land.globalID);
1146 row["RegionUUID"] = Util.ToRawUuidString(regionUUID); 1146 row["RegionUUID"] = Util.ToRawUuidString(regionUUID);
@@ -1179,7 +1179,7 @@ namespace OpenSim.Data.MySQL
1179 row["AuthBuyerID"] = land.authBuyerID; 1179 row["AuthBuyerID"] = land.authBuyerID;
1180 } 1180 }
1181 1181
1182 private void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, LLUUID parcelID) 1182 private static void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, LLUUID parcelID)
1183 { 1183 {
1184 row["LandUUID"] = Util.ToRawUuidString(parcelID); 1184 row["LandUUID"] = Util.ToRawUuidString(parcelID);
1185 row["AccessUUID"] = Util.ToRawUuidString(entry.AgentID); 1185 row["AccessUUID"] = Util.ToRawUuidString(entry.AgentID);
@@ -1364,7 +1364,7 @@ namespace OpenSim.Data.MySQL
1364 * 1364 *
1365 **********************************************************************/ 1365 **********************************************************************/
1366 1366
1367 private MySqlCommand createInsertCommand(string table, DataTable dt) 1367 private static MySqlCommand createInsertCommand(string table, DataTable dt)
1368 { 1368 {
1369 /** 1369 /**
1370 * This is subtle enough to deserve some commentary. 1370 * This is subtle enough to deserve some commentary.
@@ -1399,7 +1399,7 @@ namespace OpenSim.Data.MySQL
1399 return cmd; 1399 return cmd;
1400 } 1400 }
1401 1401
1402 private MySqlCommand createUpdateCommand(string table, string pk, DataTable dt) 1402 private static MySqlCommand createUpdateCommand(string table, string pk, DataTable dt)
1403 { 1403 {
1404 string sql = "update " + table + " set "; 1404 string sql = "update " + table + " set ";
1405 string subsql = String.Empty; 1405 string subsql = String.Empty;
@@ -1426,7 +1426,7 @@ namespace OpenSim.Data.MySQL
1426 return cmd; 1426 return cmd;
1427 } 1427 }
1428 1428
1429 private string defineTable(DataTable dt) 1429 private static string defineTable(DataTable dt)
1430 { 1430 {
1431 string sql = "create table " + dt.TableName + "("; 1431 string sql = "create table " + dt.TableName + "(";
1432 string subsql = String.Empty; 1432 string subsql = String.Empty;
@@ -1471,7 +1471,7 @@ namespace OpenSim.Data.MySQL
1471 /// for us. 1471 /// for us.
1472 ///</summary> 1472 ///</summary>
1473 ///<returns>a built MySql parameter</returns> 1473 ///<returns>a built MySql parameter</returns>
1474 private MySqlParameter createMySqlParameter(string name, Type type) 1474 private static MySqlParameter createMySqlParameter(string name, Type type)
1475 { 1475 {
1476 MySqlParameter param = new MySqlParameter(); 1476 MySqlParameter param = new MySqlParameter();
1477 param.ParameterName = "?" + name; 1477 param.ParameterName = "?" + name;
@@ -1546,7 +1546,7 @@ namespace OpenSim.Data.MySQL
1546 da.DeleteCommand = delete; 1546 da.DeleteCommand = delete;
1547 } 1547 }
1548 1548
1549 private void InitDB(MySqlConnection conn) 1549 private static void InitDB(MySqlConnection conn)
1550 { 1550 {
1551 string createPrims = defineTable(createPrimTable()); 1551 string createPrims = defineTable(createPrimTable());
1552 string createShapes = defineTable(createShapeTable()); 1552 string createShapes = defineTable(createShapeTable());
@@ -1734,7 +1734,7 @@ namespace OpenSim.Data.MySQL
1734 * 1734 *
1735 **********************************************************************/ 1735 **********************************************************************/
1736 1736
1737 private DbType dbtypeFromType(Type type) 1737 private static DbType dbtypeFromType(Type type)
1738 { 1738 {
1739 if (type == typeof (String)) 1739 if (type == typeof (String))
1740 { 1740 {
@@ -1768,7 +1768,7 @@ namespace OpenSim.Data.MySQL
1768 1768
1769 // this is something we'll need to implement for each db 1769 // this is something we'll need to implement for each db
1770 // slightly differently. 1770 // slightly differently.
1771 private string MySqlType(Type type) 1771 private static string MySqlType(Type type)
1772 { 1772 {
1773 if (type == typeof (String)) 1773 if (type == typeof (String))
1774 { 1774 {