diff options
author | Adam Frisby | 2008-05-01 16:23:53 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-01 16:23:53 +0000 |
commit | 01f31fd933bbaec246d2fef5756b7d83be7980e0 (patch) | |
tree | 45ce7727e83238bf492924bea3ff5f0b6c82acbc /OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs | |
parent | * In ur code. Making it static. (diff) | |
download | opensim-SC-01f31fd933bbaec246d2fef5756b7d83be7980e0.zip opensim-SC-01f31fd933bbaec246d2fef5756b7d83be7980e0.tar.gz opensim-SC-01f31fd933bbaec246d2fef5756b7d83be7980e0.tar.bz2 opensim-SC-01f31fd933bbaec246d2fef5756b7d83be7980e0.tar.xz |
* Breaking all the code, breaking all the code..!
* Made a bunch more members static, removed some dead code, general cleaning.
Diffstat (limited to 'OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs index c4a721e..39babd6 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs | |||
@@ -343,7 +343,7 @@ namespace OpenSim.DataStore.MSSQL | |||
343 | dt.Columns.Add(col); | 343 | dt.Columns.Add(col); |
344 | } | 344 | } |
345 | 345 | ||
346 | private DataTable createTerrainTable() | 346 | private static DataTable createTerrainTable() |
347 | { | 347 | { |
348 | DataTable terrain = new DataTable("terrain"); | 348 | DataTable terrain = new DataTable("terrain"); |
349 | 349 | ||
@@ -354,7 +354,7 @@ namespace OpenSim.DataStore.MSSQL | |||
354 | return terrain; | 354 | return terrain; |
355 | } | 355 | } |
356 | 356 | ||
357 | private DataTable createPrimTable() | 357 | private static DataTable createPrimTable() |
358 | { | 358 | { |
359 | DataTable prims = new DataTable("prims"); | 359 | DataTable prims = new DataTable("prims"); |
360 | 360 | ||
@@ -418,7 +418,7 @@ namespace OpenSim.DataStore.MSSQL | |||
418 | return prims; | 418 | return prims; |
419 | } | 419 | } |
420 | 420 | ||
421 | private DataTable createShapeTable() | 421 | private static DataTable createShapeTable() |
422 | { | 422 | { |
423 | DataTable shapes = new DataTable("primshapes"); | 423 | DataTable shapes = new DataTable("primshapes"); |
424 | createCol(shapes, "UUID", typeof (String)); | 424 | createCol(shapes, "UUID", typeof (String)); |
@@ -619,7 +619,7 @@ namespace OpenSim.DataStore.MSSQL | |||
619 | } | 619 | } |
620 | } | 620 | } |
621 | 621 | ||
622 | private PrimitiveBaseShape buildShape(DataRow row) | 622 | private static PrimitiveBaseShape buildShape(DataRow row) |
623 | { | 623 | { |
624 | PrimitiveBaseShape s = new PrimitiveBaseShape(); | 624 | PrimitiveBaseShape s = new PrimitiveBaseShape(); |
625 | s.Scale = new LLVector3( | 625 | s.Scale = new LLVector3( |
@@ -675,7 +675,7 @@ namespace OpenSim.DataStore.MSSQL | |||
675 | return s; | 675 | return s; |
676 | } | 676 | } |
677 | 677 | ||
678 | private void fillShapeRow(DataRow row, SceneObjectPart prim) | 678 | private static void fillShapeRow(DataRow row, SceneObjectPart prim) |
679 | { | 679 | { |
680 | PrimitiveBaseShape s = prim.Shape; | 680 | PrimitiveBaseShape s = prim.Shape; |
681 | row["UUID"] = prim.UUID; | 681 | row["UUID"] = prim.UUID; |
@@ -770,7 +770,7 @@ namespace OpenSim.DataStore.MSSQL | |||
770 | * | 770 | * |
771 | **********************************************************************/ | 771 | **********************************************************************/ |
772 | 772 | ||
773 | private SqlCommand createInsertCommand(string table, DataTable dt) | 773 | private static SqlCommand createInsertCommand(string table, DataTable dt) |
774 | { | 774 | { |
775 | /** | 775 | /** |
776 | * This is subtle enough to deserve some commentary. | 776 | * This is subtle enough to deserve some commentary. |
@@ -804,7 +804,7 @@ namespace OpenSim.DataStore.MSSQL | |||
804 | return cmd; | 804 | return cmd; |
805 | } | 805 | } |
806 | 806 | ||
807 | private SqlCommand createUpdateCommand(string table, string pk, DataTable dt) | 807 | private static SqlCommand createUpdateCommand(string table, string pk, DataTable dt) |
808 | { | 808 | { |
809 | string sql = "update " + table + " set "; | 809 | string sql = "update " + table + " set "; |
810 | string subsql = String.Empty; | 810 | string subsql = String.Empty; |
@@ -831,7 +831,7 @@ namespace OpenSim.DataStore.MSSQL | |||
831 | } | 831 | } |
832 | 832 | ||
833 | 833 | ||
834 | private string defineTable(DataTable dt) | 834 | private static string defineTable(DataTable dt) |
835 | { | 835 | { |
836 | string sql = "create table " + dt.TableName + "("; | 836 | string sql = "create table " + dt.TableName + "("; |
837 | string subsql = String.Empty; | 837 | string subsql = String.Empty; |
@@ -854,7 +854,7 @@ namespace OpenSim.DataStore.MSSQL | |||
854 | return sql; | 854 | return sql; |
855 | } | 855 | } |
856 | 856 | ||
857 | private void fillTerrainRow(DataRow row, LLUUID regionUUID, int rev, double[,] val) | 857 | private static void fillTerrainRow(DataRow row, LLUUID regionUUID, int rev, double[,] val) |
858 | { | 858 | { |
859 | row["RegionUUID"] = regionUUID; | 859 | row["RegionUUID"] = regionUUID; |
860 | row["Revision"] = rev; | 860 | row["Revision"] = rev; |
@@ -890,7 +890,7 @@ namespace OpenSim.DataStore.MSSQL | |||
890 | /// for us. | 890 | /// for us. |
891 | ///</summary> | 891 | ///</summary> |
892 | ///<returns>a built Sql parameter</returns> | 892 | ///<returns>a built Sql parameter</returns> |
893 | private SqlParameter createSqlParameter(string name, Type type) | 893 | private static SqlParameter createSqlParameter(string name, Type type) |
894 | { | 894 | { |
895 | SqlParameter param = new SqlParameter(); | 895 | SqlParameter param = new SqlParameter(); |
896 | param.ParameterName = "@" + name; | 896 | param.ParameterName = "@" + name; |
@@ -934,7 +934,7 @@ namespace OpenSim.DataStore.MSSQL | |||
934 | da.InsertCommand.Connection = conn; | 934 | da.InsertCommand.Connection = conn; |
935 | } | 935 | } |
936 | 936 | ||
937 | private void InitDB(SqlConnection conn) | 937 | private static void InitDB(SqlConnection conn) |
938 | { | 938 | { |
939 | string createPrims = defineTable(createPrimTable()); | 939 | string createPrims = defineTable(createPrimTable()); |
940 | string createShapes = defineTable(createShapeTable()); | 940 | string createShapes = defineTable(createShapeTable()); |
@@ -977,7 +977,7 @@ namespace OpenSim.DataStore.MSSQL | |||
977 | conn.Close(); | 977 | conn.Close(); |
978 | } | 978 | } |
979 | 979 | ||
980 | private bool TestTables(SqlConnection conn) | 980 | private static bool TestTables(SqlConnection conn) |
981 | { | 981 | { |
982 | SqlCommand primSelectCmd = new SqlCommand(primSelect, conn); | 982 | SqlCommand primSelectCmd = new SqlCommand(primSelect, conn); |
983 | SqlDataAdapter pDa = new SqlDataAdapter(primSelectCmd); | 983 | SqlDataAdapter pDa = new SqlDataAdapter(primSelectCmd); |
@@ -1046,7 +1046,7 @@ namespace OpenSim.DataStore.MSSQL | |||
1046 | * | 1046 | * |
1047 | **********************************************************************/ | 1047 | **********************************************************************/ |
1048 | 1048 | ||
1049 | private DbType dbtypeFromType(Type type) | 1049 | private static DbType dbtypeFromType(Type type) |
1050 | { | 1050 | { |
1051 | if (type == typeof (String)) | 1051 | if (type == typeof (String)) |
1052 | { | 1052 | { |
@@ -1072,7 +1072,7 @@ namespace OpenSim.DataStore.MSSQL | |||
1072 | 1072 | ||
1073 | // this is something we'll need to implement for each db | 1073 | // this is something we'll need to implement for each db |
1074 | // slightly differently. | 1074 | // slightly differently. |
1075 | private string SqlType(Type type) | 1075 | private static string SqlType(Type type) |
1076 | { | 1076 | { |
1077 | if (type == typeof (String)) | 1077 | if (type == typeof (String)) |
1078 | { | 1078 | { |