diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteManager.cs | 134 |
1 files changed, 68 insertions, 66 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteManager.cs b/OpenSim/Framework/Data.SQLite/SQLiteManager.cs index 4dd89f5..bec0cd8 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteManager.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteManager.cs | |||
@@ -92,72 +92,74 @@ namespace OpenSim.Framework.Data.SQLite | |||
92 | return (IDbCommand) dbcommand; | 92 | return (IDbCommand) dbcommand; |
93 | } | 93 | } |
94 | 94 | ||
95 | private bool TestTables(SQLiteConnection conn) | 95 | // TODO: unused |
96 | { | 96 | // private bool TestTables(SQLiteConnection conn) |
97 | SQLiteCommand cmd = new SQLiteCommand("SELECT * FROM regions", conn); | 97 | // { |
98 | SQLiteDataAdapter pDa = new SQLiteDataAdapter(cmd); | 98 | // SQLiteCommand cmd = new SQLiteCommand("SELECT * FROM regions", conn); |
99 | DataSet tmpDS = new DataSet(); | 99 | // SQLiteDataAdapter pDa = new SQLiteDataAdapter(cmd); |
100 | try | 100 | // DataSet tmpDS = new DataSet(); |
101 | { | 101 | // try |
102 | pDa.Fill(tmpDS, "regions"); | 102 | // { |
103 | } | 103 | // pDa.Fill(tmpDS, "regions"); |
104 | catch (SqliteSyntaxException) | 104 | // } |
105 | { | 105 | // catch (SqliteSyntaxException) |
106 | m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating"); | 106 | // { |
107 | InitDB(conn); | 107 | // m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating"); |
108 | } | 108 | // InitDB(conn); |
109 | return true; | 109 | // } |
110 | } | 110 | // return true; |
111 | 111 | // } | |
112 | private DataTable createRegionsTable() | 112 | |
113 | { | 113 | // TODO: unused |
114 | DataTable regions = new DataTable("regions"); | 114 | // private DataTable createRegionsTable() |
115 | 115 | // { | |
116 | createCol(regions, "regionHandle", typeof (ulong)); | 116 | // DataTable regions = new DataTable("regions"); |
117 | createCol(regions, "regionName", typeof (String)); | 117 | |
118 | createCol(regions, "uuid", typeof (String)); | 118 | // createCol(regions, "regionHandle", typeof (ulong)); |
119 | 119 | // createCol(regions, "regionName", typeof (String)); | |
120 | createCol(regions, "regionRecvKey", typeof (String)); | 120 | // createCol(regions, "uuid", typeof (String)); |
121 | createCol(regions, "regionSecret", typeof (String)); | 121 | |
122 | createCol(regions, "regionSendKey", typeof (String)); | 122 | // createCol(regions, "regionRecvKey", typeof (String)); |
123 | 123 | // createCol(regions, "regionSecret", typeof (String)); | |
124 | createCol(regions, "regionDataURI", typeof (String)); | 124 | // createCol(regions, "regionSendKey", typeof (String)); |
125 | createCol(regions, "serverIP", typeof (String)); | 125 | |
126 | createCol(regions, "serverPort", typeof (String)); | 126 | // createCol(regions, "regionDataURI", typeof (String)); |
127 | createCol(regions, "serverURI", typeof (String)); | 127 | // createCol(regions, "serverIP", typeof (String)); |
128 | 128 | // createCol(regions, "serverPort", typeof (String)); | |
129 | 129 | // createCol(regions, "serverURI", typeof (String)); | |
130 | createCol(regions, "locX", typeof (uint)); | 130 | |
131 | createCol(regions, "locY", typeof (uint)); | 131 | |
132 | createCol(regions, "locZ", typeof (uint)); | 132 | // createCol(regions, "locX", typeof (uint)); |
133 | 133 | // createCol(regions, "locY", typeof (uint)); | |
134 | createCol(regions, "eastOverrideHandle", typeof (ulong)); | 134 | // createCol(regions, "locZ", typeof (uint)); |
135 | createCol(regions, "westOverrideHandle", typeof (ulong)); | 135 | |
136 | createCol(regions, "southOverrideHandle", typeof (ulong)); | 136 | // createCol(regions, "eastOverrideHandle", typeof (ulong)); |
137 | createCol(regions, "northOverrideHandle", typeof (ulong)); | 137 | // createCol(regions, "westOverrideHandle", typeof (ulong)); |
138 | 138 | // createCol(regions, "southOverrideHandle", typeof (ulong)); | |
139 | createCol(regions, "regionAssetURI", typeof (String)); | 139 | // createCol(regions, "northOverrideHandle", typeof (ulong)); |
140 | createCol(regions, "regionAssetRecvKey", typeof (String)); | 140 | |
141 | createCol(regions, "regionAssetSendKey", typeof (String)); | 141 | // createCol(regions, "regionAssetURI", typeof (String)); |
142 | 142 | // createCol(regions, "regionAssetRecvKey", typeof (String)); | |
143 | createCol(regions, "regionUserURI", typeof (String)); | 143 | // createCol(regions, "regionAssetSendKey", typeof (String)); |
144 | createCol(regions, "regionUserRecvKey", typeof (String)); | 144 | |
145 | createCol(regions, "regionUserSendKey", typeof (String)); | 145 | // createCol(regions, "regionUserURI", typeof (String)); |
146 | 146 | // createCol(regions, "regionUserRecvKey", typeof (String)); | |
147 | // Add in contraints | 147 | // createCol(regions, "regionUserSendKey", typeof (String)); |
148 | regions.PrimaryKey = new DataColumn[] {regions.Columns["UUID"]}; | 148 | |
149 | return regions; | 149 | // // Add in contraints |
150 | } | 150 | // regions.PrimaryKey = new DataColumn[] {regions.Columns["UUID"]}; |
151 | 151 | // return regions; | |
152 | private void InitDB(SQLiteConnection conn) | 152 | // } |
153 | { | 153 | |
154 | string createUsers = defineTable(createRegionsTable()); | 154 | // TODO: unused |
155 | SQLiteCommand pcmd = new SQLiteCommand(createUsers, conn); | 155 | // private void InitDB(SQLiteConnection conn) |
156 | conn.Open(); | 156 | // { |
157 | pcmd.ExecuteNonQuery(); | 157 | // string createUsers = defineTable(createRegionsTable()); |
158 | conn.Close(); | 158 | // SQLiteCommand pcmd = new SQLiteCommand(createUsers, conn); |
159 | } | 159 | // conn.Open(); |
160 | 160 | // pcmd.ExecuteNonQuery(); | |
161 | // conn.Close(); | ||
162 | // } | ||
161 | 163 | ||
162 | /// <summary> | 164 | /// <summary> |
163 | /// Reads a region row from a database reader | 165 | /// Reads a region row from a database reader |