diff options
author | Adam Frisby | 2008-05-01 16:03:53 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-01 16:03:53 +0000 |
commit | 523190377861292dfecdaddebe1204301a0c7912 (patch) | |
tree | c003fa3c03389fc2d701d6797557c693a4eb29fc /OpenSim/Data/SQLite | |
parent | Add basic OS X support to LaunchSLClient (diff) | |
download | opensim-SC-523190377861292dfecdaddebe1204301a0c7912.zip opensim-SC-523190377861292dfecdaddebe1204301a0c7912.tar.gz opensim-SC-523190377861292dfecdaddebe1204301a0c7912.tar.bz2 opensim-SC-523190377861292dfecdaddebe1204301a0c7912.tar.xz |
* In ur code. Making it static.
* Converted a bunch of functions to static functions.
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAssetData.cs | 10 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 14 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteRegionData.cs | 34 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteUserData.cs | 2 |
4 files changed, 30 insertions, 30 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index db4848a..fa5d5e2 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -135,7 +135,7 @@ namespace OpenSim.Data.SQLite | |||
135 | 135 | ||
136 | } | 136 | } |
137 | 137 | ||
138 | private void LogAssetLoad(AssetBase asset) | 138 | private static void LogAssetLoad(AssetBase asset) |
139 | { | 139 | { |
140 | string temporary = asset.Temporary ? "Temporary" : "Stored"; | 140 | string temporary = asset.Temporary ? "Temporary" : "Stored"; |
141 | string local = asset.Local ? "Local" : "Remote"; | 141 | string local = asset.Local ? "Local" : "Remote"; |
@@ -197,7 +197,7 @@ namespace OpenSim.Data.SQLite | |||
197 | * | 197 | * |
198 | **********************************************************************/ | 198 | **********************************************************************/ |
199 | 199 | ||
200 | private DataTable createAssetsTable() | 200 | private static DataTable createAssetsTable() |
201 | { | 201 | { |
202 | DataTable assets = new DataTable("assets"); | 202 | DataTable assets = new DataTable("assets"); |
203 | 203 | ||
@@ -222,7 +222,7 @@ namespace OpenSim.Data.SQLite | |||
222 | * | 222 | * |
223 | **********************************************************************/ | 223 | **********************************************************************/ |
224 | 224 | ||
225 | private AssetBase buildAsset(IDataReader row) | 225 | private static AssetBase buildAsset(IDataReader row) |
226 | { | 226 | { |
227 | // TODO: this doesn't work yet because something more | 227 | // TODO: this doesn't work yet because something more |
228 | // interesting has to be done to actually get these values | 228 | // interesting has to be done to actually get these values |
@@ -250,14 +250,14 @@ namespace OpenSim.Data.SQLite | |||
250 | * | 250 | * |
251 | **********************************************************************/ | 251 | **********************************************************************/ |
252 | 252 | ||
253 | private void InitDB(SqliteConnection conn) | 253 | private static void InitDB(SqliteConnection conn) |
254 | { | 254 | { |
255 | string createAssets = SQLiteUtil.defineTable(createAssetsTable()); | 255 | string createAssets = SQLiteUtil.defineTable(createAssetsTable()); |
256 | SqliteCommand pcmd = new SqliteCommand(createAssets, conn); | 256 | SqliteCommand pcmd = new SqliteCommand(createAssets, conn); |
257 | pcmd.ExecuteNonQuery(); | 257 | pcmd.ExecuteNonQuery(); |
258 | } | 258 | } |
259 | 259 | ||
260 | private bool TestTables(SqliteConnection conn) | 260 | private static bool TestTables(SqliteConnection conn) |
261 | { | 261 | { |
262 | SqliteCommand cmd = new SqliteCommand(assetSelect, conn); | 262 | SqliteCommand cmd = new SqliteCommand(assetSelect, conn); |
263 | SqliteDataAdapter pDa = new SqliteDataAdapter(cmd); | 263 | SqliteDataAdapter pDa = new SqliteDataAdapter(cmd); |
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index 4b28795..40978da 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs | |||
@@ -124,7 +124,7 @@ namespace OpenSim.Data.SQLite | |||
124 | return item; | 124 | return item; |
125 | } | 125 | } |
126 | 126 | ||
127 | private void fillItemRow(DataRow row, InventoryItemBase item) | 127 | private static void fillItemRow(DataRow row, InventoryItemBase item) |
128 | { | 128 | { |
129 | row["UUID"] = Util.ToRawUuidString(item.ID); | 129 | row["UUID"] = Util.ToRawUuidString(item.ID); |
130 | row["assetID"] = Util.ToRawUuidString(item.AssetID); | 130 | row["assetID"] = Util.ToRawUuidString(item.AssetID); |
@@ -576,7 +576,7 @@ namespace OpenSim.Data.SQLite | |||
576 | return inv; | 576 | return inv; |
577 | } | 577 | } |
578 | 578 | ||
579 | private DataTable createInventoryFoldersTable() | 579 | private static DataTable createInventoryFoldersTable() |
580 | { | 580 | { |
581 | DataTable fol = new DataTable("inventoryfolders"); | 581 | DataTable fol = new DataTable("inventoryfolders"); |
582 | 582 | ||
@@ -625,7 +625,7 @@ namespace OpenSim.Data.SQLite | |||
625 | } | 625 | } |
626 | } | 626 | } |
627 | 627 | ||
628 | private InventoryFolderBase buildFolder(DataRow row) | 628 | private static InventoryFolderBase buildFolder(DataRow row) |
629 | { | 629 | { |
630 | InventoryFolderBase folder = new InventoryFolderBase(); | 630 | InventoryFolderBase folder = new InventoryFolderBase(); |
631 | folder.ID = new LLUUID((string) row["UUID"]); | 631 | folder.ID = new LLUUID((string) row["UUID"]); |
@@ -637,7 +637,7 @@ namespace OpenSim.Data.SQLite | |||
637 | return folder; | 637 | return folder; |
638 | } | 638 | } |
639 | 639 | ||
640 | private void fillFolderRow(DataRow row, InventoryFolderBase folder) | 640 | private static void fillFolderRow(DataRow row, InventoryFolderBase folder) |
641 | { | 641 | { |
642 | row["UUID"] = Util.ToRawUuidString(folder.ID); | 642 | row["UUID"] = Util.ToRawUuidString(folder.ID); |
643 | row["name"] = folder.Name; | 643 | row["name"] = folder.Name; |
@@ -647,7 +647,7 @@ namespace OpenSim.Data.SQLite | |||
647 | row["version"] = folder.Version; | 647 | row["version"] = folder.Version; |
648 | } | 648 | } |
649 | 649 | ||
650 | private void moveFolderRow(DataRow row, InventoryFolderBase folder) | 650 | private static void moveFolderRow(DataRow row, InventoryFolderBase folder) |
651 | { | 651 | { |
652 | row["UUID"] = Util.ToRawUuidString(folder.ID); | 652 | row["UUID"] = Util.ToRawUuidString(folder.ID); |
653 | row["parentID"] = Util.ToRawUuidString(folder.ParentID); | 653 | row["parentID"] = Util.ToRawUuidString(folder.ParentID); |
@@ -659,7 +659,7 @@ namespace OpenSim.Data.SQLite | |||
659 | * | 659 | * |
660 | **********************************************************************/ | 660 | **********************************************************************/ |
661 | 661 | ||
662 | private void InitDB(SqliteConnection conn) | 662 | private static void InitDB(SqliteConnection conn) |
663 | { | 663 | { |
664 | string createInventoryItems = defineTable(createInventoryItemsTable()); | 664 | string createInventoryItems = defineTable(createInventoryItemsTable()); |
665 | string createInventoryFolders = defineTable(createInventoryFoldersTable()); | 665 | string createInventoryFolders = defineTable(createInventoryFoldersTable()); |
@@ -671,7 +671,7 @@ namespace OpenSim.Data.SQLite | |||
671 | scmd.ExecuteNonQuery(); | 671 | scmd.ExecuteNonQuery(); |
672 | } | 672 | } |
673 | 673 | ||
674 | private bool TestTables(SqliteConnection conn) | 674 | private static bool TestTables(SqliteConnection conn) |
675 | { | 675 | { |
676 | SqliteCommand invItemsSelectCmd = new SqliteCommand(invItemsSelect, conn); | 676 | SqliteCommand invItemsSelectCmd = new SqliteCommand(invItemsSelect, conn); |
677 | SqliteDataAdapter pDa = new SqliteDataAdapter(invItemsSelectCmd); | 677 | SqliteDataAdapter pDa = new SqliteDataAdapter(invItemsSelectCmd); |
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index ea12a48..9a610a4 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -572,13 +572,13 @@ namespace OpenSim.Data.SQLite | |||
572 | * | 572 | * |
573 | **********************************************************************/ | 573 | **********************************************************************/ |
574 | 574 | ||
575 | private void createCol(DataTable dt, string name, Type type) | 575 | private static void createCol(DataTable dt, string name, Type type) |
576 | { | 576 | { |
577 | DataColumn col = new DataColumn(name, type); | 577 | DataColumn col = new DataColumn(name, type); |
578 | dt.Columns.Add(col); | 578 | dt.Columns.Add(col); |
579 | } | 579 | } |
580 | 580 | ||
581 | private DataTable createTerrainTable() | 581 | private static DataTable createTerrainTable() |
582 | { | 582 | { |
583 | DataTable terrain = new DataTable("terrain"); | 583 | DataTable terrain = new DataTable("terrain"); |
584 | 584 | ||
@@ -589,7 +589,7 @@ namespace OpenSim.Data.SQLite | |||
589 | return terrain; | 589 | return terrain; |
590 | } | 590 | } |
591 | 591 | ||
592 | private DataTable createPrimTable() | 592 | private static DataTable createPrimTable() |
593 | { | 593 | { |
594 | DataTable prims = new DataTable("prims"); | 594 | DataTable prims = new DataTable("prims"); |
595 | 595 | ||
@@ -653,7 +653,7 @@ namespace OpenSim.Data.SQLite | |||
653 | return prims; | 653 | return prims; |
654 | } | 654 | } |
655 | 655 | ||
656 | private DataTable createShapeTable() | 656 | private static DataTable createShapeTable() |
657 | { | 657 | { |
658 | DataTable shapes = new DataTable("primshapes"); | 658 | DataTable shapes = new DataTable("primshapes"); |
659 | createCol(shapes, "UUID", typeof (String)); | 659 | createCol(shapes, "UUID", typeof (String)); |
@@ -695,7 +695,7 @@ namespace OpenSim.Data.SQLite | |||
695 | return shapes; | 695 | return shapes; |
696 | } | 696 | } |
697 | 697 | ||
698 | private DataTable createItemsTable() | 698 | private static DataTable createItemsTable() |
699 | { | 699 | { |
700 | DataTable items = new DataTable("primitems"); | 700 | DataTable items = new DataTable("primitems"); |
701 | 701 | ||
@@ -727,7 +727,7 @@ namespace OpenSim.Data.SQLite | |||
727 | return items; | 727 | return items; |
728 | } | 728 | } |
729 | 729 | ||
730 | private DataTable createLandTable() | 730 | private static DataTable createLandTable() |
731 | { | 731 | { |
732 | DataTable land = new DataTable("land"); | 732 | DataTable land = new DataTable("land"); |
733 | createCol(land, "UUID", typeof (String)); | 733 | createCol(land, "UUID", typeof (String)); |
@@ -771,7 +771,7 @@ namespace OpenSim.Data.SQLite | |||
771 | return land; | 771 | return land; |
772 | } | 772 | } |
773 | 773 | ||
774 | private DataTable createLandAccessListTable() | 774 | private static DataTable createLandAccessListTable() |
775 | { | 775 | { |
776 | DataTable landaccess = new DataTable("landaccesslist"); | 776 | DataTable landaccess = new DataTable("landaccesslist"); |
777 | createCol(landaccess, "LandUUID", typeof (String)); | 777 | createCol(landaccess, "LandUUID", typeof (String)); |
@@ -901,7 +901,7 @@ namespace OpenSim.Data.SQLite | |||
901 | /// </summary> | 901 | /// </summary> |
902 | /// <param name="row"></param> | 902 | /// <param name="row"></param> |
903 | /// <returns></returns> | 903 | /// <returns></returns> |
904 | private TaskInventoryItem buildItem(DataRow row) | 904 | private static TaskInventoryItem buildItem(DataRow row) |
905 | { | 905 | { |
906 | TaskInventoryItem taskItem = new TaskInventoryItem(); | 906 | TaskInventoryItem taskItem = new TaskInventoryItem(); |
907 | 907 | ||
@@ -1008,7 +1008,7 @@ namespace OpenSim.Data.SQLite | |||
1008 | return newData; | 1008 | return newData; |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | private ParcelManager.ParcelAccessEntry buildLandAccessData(DataRow row) | 1011 | private static ParcelManager.ParcelAccessEntry buildLandAccessData(DataRow row) |
1012 | { | 1012 | { |
1013 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 1013 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); |
1014 | entry.AgentID = new LLUUID((string) row["AccessUUID"]); | 1014 | entry.AgentID = new LLUUID((string) row["AccessUUID"]); |
@@ -1017,7 +1017,7 @@ namespace OpenSim.Data.SQLite | |||
1017 | return entry; | 1017 | return entry; |
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | private Array serializeTerrain(double[,] val) | 1020 | private static Array serializeTerrain(double[,] val) |
1021 | { | 1021 | { |
1022 | MemoryStream str = new MemoryStream(65536*sizeof (double)); | 1022 | MemoryStream str = new MemoryStream(65536*sizeof (double)); |
1023 | BinaryWriter bw = new BinaryWriter(str); | 1023 | BinaryWriter bw = new BinaryWriter(str); |
@@ -1046,7 +1046,7 @@ namespace OpenSim.Data.SQLite | |||
1046 | // row["Heightfield"] = str.ToArray(); | 1046 | // row["Heightfield"] = str.ToArray(); |
1047 | // } | 1047 | // } |
1048 | 1048 | ||
1049 | private void fillPrimRow(DataRow row, SceneObjectPart prim, LLUUID sceneGroupID, LLUUID regionUUID) | 1049 | private static void fillPrimRow(DataRow row, SceneObjectPart prim, LLUUID sceneGroupID, LLUUID regionUUID) |
1050 | { | 1050 | { |
1051 | row["UUID"] = Util.ToRawUuidString(prim.UUID); | 1051 | row["UUID"] = Util.ToRawUuidString(prim.UUID); |
1052 | row["RegionUUID"] = Util.ToRawUuidString(regionUUID); | 1052 | row["RegionUUID"] = Util.ToRawUuidString(regionUUID); |
@@ -1106,7 +1106,7 @@ namespace OpenSim.Data.SQLite | |||
1106 | row["SitTargetOrientZ"] = sitTargetOrient.Z; | 1106 | row["SitTargetOrientZ"] = sitTargetOrient.Z; |
1107 | } | 1107 | } |
1108 | 1108 | ||
1109 | private void fillItemRow(DataRow row, TaskInventoryItem taskItem) | 1109 | private static void fillItemRow(DataRow row, TaskInventoryItem taskItem) |
1110 | { | 1110 | { |
1111 | row["itemID"] = taskItem.ItemID; | 1111 | row["itemID"] = taskItem.ItemID; |
1112 | row["primID"] = taskItem.ParentPartID; | 1112 | row["primID"] = taskItem.ParentPartID; |
@@ -1130,7 +1130,7 @@ namespace OpenSim.Data.SQLite | |||
1130 | row["groupPermissions"] = taskItem.GroupMask; | 1130 | row["groupPermissions"] = taskItem.GroupMask; |
1131 | } | 1131 | } |
1132 | 1132 | ||
1133 | private void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) | 1133 | private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) |
1134 | { | 1134 | { |
1135 | row["UUID"] = Util.ToRawUuidString(land.globalID); | 1135 | row["UUID"] = Util.ToRawUuidString(land.globalID); |
1136 | row["RegionUUID"] = Util.ToRawUuidString(regionUUID); | 1136 | row["RegionUUID"] = Util.ToRawUuidString(regionUUID); |
@@ -1169,7 +1169,7 @@ namespace OpenSim.Data.SQLite | |||
1169 | row["AuthbuyerID"] = Util.ToRawUuidString(land.authBuyerID); | 1169 | row["AuthbuyerID"] = Util.ToRawUuidString(land.authBuyerID); |
1170 | } | 1170 | } |
1171 | 1171 | ||
1172 | private void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, LLUUID parcelID) | 1172 | private static void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, LLUUID parcelID) |
1173 | { | 1173 | { |
1174 | row["LandUUID"] = Util.ToRawUuidString(parcelID); | 1174 | row["LandUUID"] = Util.ToRawUuidString(parcelID); |
1175 | row["AccessUUID"] = Util.ToRawUuidString(entry.AgentID); | 1175 | row["AccessUUID"] = Util.ToRawUuidString(entry.AgentID); |
@@ -1242,7 +1242,7 @@ namespace OpenSim.Data.SQLite | |||
1242 | return s; | 1242 | return s; |
1243 | } | 1243 | } |
1244 | 1244 | ||
1245 | private void fillShapeRow(DataRow row, SceneObjectPart prim) | 1245 | private static void fillShapeRow(DataRow row, SceneObjectPart prim) |
1246 | { | 1246 | { |
1247 | PrimitiveBaseShape s = prim.Shape; | 1247 | PrimitiveBaseShape s = prim.Shape; |
1248 | row["UUID"] = Util.ToRawUuidString(prim.UUID); | 1248 | row["UUID"] = Util.ToRawUuidString(prim.UUID); |
@@ -1713,7 +1713,7 @@ namespace OpenSim.Data.SQLite | |||
1713 | * | 1713 | * |
1714 | **********************************************************************/ | 1714 | **********************************************************************/ |
1715 | 1715 | ||
1716 | private DbType dbtypeFromType(Type type) | 1716 | private static DbType dbtypeFromType(Type type) |
1717 | { | 1717 | { |
1718 | if (type == typeof (String)) | 1718 | if (type == typeof (String)) |
1719 | { | 1719 | { |
@@ -1747,7 +1747,7 @@ namespace OpenSim.Data.SQLite | |||
1747 | 1747 | ||
1748 | // this is something we'll need to implement for each db | 1748 | // this is something we'll need to implement for each db |
1749 | // slightly differently. | 1749 | // slightly differently. |
1750 | private string sqliteType(Type type) | 1750 | private static string sqliteType(Type type) |
1751 | { | 1751 | { |
1752 | if (type == typeof (String)) | 1752 | if (type == typeof (String)) |
1753 | { | 1753 | { |
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index ec90f34..7f017b7 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs | |||
@@ -752,7 +752,7 @@ namespace OpenSim.Data.SQLite | |||
752 | 752 | ||
753 | } | 753 | } |
754 | 754 | ||
755 | private void InitDB(SqliteConnection conn) | 755 | private static void InitDB(SqliteConnection conn) |
756 | { | 756 | { |
757 | string createUsers = SQLiteUtil.defineTable(createUsersTable()); | 757 | string createUsers = SQLiteUtil.defineTable(createUsersTable()); |
758 | string createFriends = SQLiteUtil.defineTable(createUserFriendsTable()); | 758 | string createFriends = SQLiteUtil.defineTable(createUserFriendsTable()); |