aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/RestClient/RestClient.cs101
-rw-r--r--OpenSim/Framework/Data.MSSQL/MSSQLDataStore.cs13
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLDataStore.cs78
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteManager.cs134
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteUserData.cs27
5 files changed, 181 insertions, 172 deletions
diff --git a/OpenSim/Framework/Communications/RestClient/RestClient.cs b/OpenSim/Framework/Communications/RestClient/RestClient.cs
index 7212e5e..1178fed 100644
--- a/OpenSim/Framework/Communications/RestClient/RestClient.cs
+++ b/OpenSim/Framework/Communications/RestClient/RestClient.cs
@@ -195,15 +195,16 @@ namespace OpenSim.Framework.Communications
195 return s.Substring(s.Length - 1, 1) == "/"; 195 return s.Substring(s.Length - 1, 1) == "/";
196 } 196 }
197 197
198 /// <summary> 198// TODO: unused
199 /// return a slash or blank. A slash will be returned if the string does not contain one 199// /// <summary>
200 /// </summary> 200// /// return a slash or blank. A slash will be returned if the string does not contain one
201 /// <param name="s">stromg to be examined</param> 201// /// </summary>
202 /// <returns>slash '/' if not already present</returns> 202// /// <param name="s">stromg to be examined</param>
203 private string slash(string s) 203// /// <returns>slash '/' if not already present</returns>
204 { 204// private string slash(string s)
205 return isSlashed(s) ? String.Empty : "/"; 205// {
206 } 206// return isSlashed(s) ? String.Empty : "/";
207// }
207 208
208 /// <summary> 209 /// <summary>
209 /// Build a Uri based on the initial Url, path elements and parameters 210 /// Build a Uri based on the initial Url, path elements and parameters
@@ -278,46 +279,48 @@ namespace OpenSim.Framework.Communications
278 } 279 }
279 } 280 }
280 281
281 /// <summary> 282// TODO: unused
282 /// Async method, invoked when the initial response if received from the server 283// /// <summary>
283 /// </summary> 284// /// Async method, invoked when the initial response if received from the server
284 /// <param name="ar"></param> 285// /// </summary>
285 private void ResponseIsReadyDelegate(IAsyncResult ar) 286// /// <param name="ar"></param>
286 { 287// private void ResponseIsReadyDelegate(IAsyncResult ar)
287 try 288// {
288 { 289// try
289 // grab response 290// {
290 WebRequest wr = (WebRequest) ar.AsyncState; 291// // grab response
291 _response = (HttpWebResponse) wr.EndGetResponse(ar); 292// WebRequest wr = (WebRequest) ar.AsyncState;
292 293// _response = (HttpWebResponse) wr.EndGetResponse(ar);
293 // get response stream, and setup async reading 294
294 Stream s = _response.GetResponseStream(); 295// // get response stream, and setup async reading
295 IAsyncResult asynchronousResult = 296// Stream s = _response.GetResponseStream();
296 s.BeginRead(_readbuf, 0, BufferSize, new AsyncCallback(StreamIsReadyDelegate), s); 297// IAsyncResult asynchronousResult =
297 298// s.BeginRead(_readbuf, 0, BufferSize, new AsyncCallback(StreamIsReadyDelegate), s);
298 // TODO! Implement timeout, without killing the server 299
299 // wait until completed, or we timed out 300// // TODO! Implement timeout, without killing the server
300 // ThreadPool.RegisterWaitForSingleObject(asynchronousResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true); 301// // wait until completed, or we timed out
301 } 302// // ThreadPool.RegisterWaitForSingleObject(asynchronousResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true);
302 catch (Exception e) 303// }
303 { 304// catch (Exception e)
304 _allDone.Set(); 305// {
305 _asyncException = e; 306// _allDone.Set();
306 } 307// _asyncException = e;
307 } 308// }
308 309// }
309 // Abort the request if the timer fires. 310
310 private static void TimeoutCallback(object state, bool timedOut) 311// TODO: unused
311 { 312// // Abort the request if the timer fires.
312 if (timedOut) 313// private static void TimeoutCallback(object state, bool timedOut)
313 { 314// {
314 HttpWebRequest request = state as HttpWebRequest; 315// if (timedOut)
315 if (request != null) 316// {
316 { 317// HttpWebRequest request = state as HttpWebRequest;
317 request.Abort(); 318// if (request != null)
318 } 319// {
319 } 320// request.Abort();
320 } 321// }
322// }
323// }
321 324
322 #endregion Async communications with server 325 #endregion Async communications with server
323 326
diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLDataStore.cs b/OpenSim/Framework/Data.MSSQL/MSSQLDataStore.cs
index c86cfb6..d34abe3 100644
--- a/OpenSim/Framework/Data.MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Framework/Data.MSSQL/MSSQLDataStore.cs
@@ -1351,12 +1351,13 @@ namespace OpenSim.Framework.Data.MSSQL
1351 return param; 1351 return param;
1352 } 1352 }
1353 1353
1354 private SqlParameter createParamWithValue(string name, Type type, Object o) 1354// TODO: unused
1355 { 1355// private SqlParameter createParamWithValue(string name, Type type, Object o)
1356 SqlParameter param = createSqlParameter(name, type); 1356// {
1357 param.Value = o; 1357// SqlParameter param = createSqlParameter(name, type);
1358 return param; 1358// param.Value = o;
1359 } 1359// return param;
1360// }
1360 1361
1361 private void setupPrimCommands(SqlDataAdapter da, SqlConnection conn) 1362 private void setupPrimCommands(SqlDataAdapter da, SqlConnection conn)
1362 { 1363 {
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
index b1ab42fd..eaa7f14 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
@@ -478,38 +478,39 @@ namespace OpenSim.Framework.Data.MySQL
478 return landDataForRegion; 478 return landDataForRegion;
479 } 479 }
480 480
481 private void DisplayDataSet(DataSet ds, string title) 481// TODO: unused
482 { 482// private void DisplayDataSet(DataSet ds, string title)
483 Debug.WriteLine(title); 483// {
484 //--- Loop through the DataTables 484// Debug.WriteLine(title);
485 foreach (DataTable table in ds.Tables) 485// //--- Loop through the DataTables
486 { 486// foreach (DataTable table in ds.Tables)
487 Debug.WriteLine("*** DataTable: " + table.TableName + "***"); 487// {
488 //--- Loop through each DataTable's DataRows 488// Debug.WriteLine("*** DataTable: " + table.TableName + "***");
489 foreach (DataRow row in table.Rows) 489// //--- Loop through each DataTable's DataRows
490 { 490// foreach (DataRow row in table.Rows)
491 //--- Display the original values, if there are any. 491// {
492 if (row.HasVersion(DataRowVersion.Original)) 492// //--- Display the original values, if there are any.
493 { 493// if (row.HasVersion(DataRowVersion.Original))
494 Debug.Write("Original Row Values ===> "); 494// {
495 foreach (DataColumn column in table.Columns) 495// Debug.Write("Original Row Values ===> ");
496 Debug.Write(column.ColumnName + " = " + 496// foreach (DataColumn column in table.Columns)
497 row[column, DataRowVersion.Original] + ", "); 497// Debug.Write(column.ColumnName + " = " +
498 Debug.WriteLine(String.Empty); 498// row[column, DataRowVersion.Original] + ", ");
499 } 499// Debug.WriteLine(String.Empty);
500 //--- Display the current values, if there are any. 500// }
501 if (row.HasVersion(DataRowVersion.Current)) 501// //--- Display the current values, if there are any.
502 { 502// if (row.HasVersion(DataRowVersion.Current))
503 Debug.Write("Current Row Values ====> "); 503// {
504 foreach (DataColumn column in table.Columns) 504// Debug.Write("Current Row Values ====> ");
505 Debug.Write(column.ColumnName + " = " + 505// foreach (DataColumn column in table.Columns)
506 row[column, DataRowVersion.Current] + ", "); 506// Debug.Write(column.ColumnName + " = " +
507 Debug.WriteLine(String.Empty); 507// row[column, DataRowVersion.Current] + ", ");
508 } 508// Debug.WriteLine(String.Empty);
509 Debug.WriteLine(String.Empty); 509// }
510 } 510// Debug.WriteLine(String.Empty);
511 } 511// }
512 } 512// }
513// }
513 514
514 public void Commit() 515 public void Commit()
515 { 516 {
@@ -1397,12 +1398,13 @@ namespace OpenSim.Framework.Data.MySQL
1397 return param; 1398 return param;
1398 } 1399 }
1399 1400
1400 private MySqlParameter createParamWithValue(string name, Type type, Object o) 1401// TODO: unused
1401 { 1402// private MySqlParameter createParamWithValue(string name, Type type, Object o)
1402 MySqlParameter param = createMySqlParameter(name, type); 1403// {
1403 param.Value = o; 1404// MySqlParameter param = createMySqlParameter(name, type);
1404 return param; 1405// param.Value = o;
1405 } 1406// return param;
1407// }
1406 1408
1407 private void SetupPrimCommands(MySqlDataAdapter da, MySqlConnection conn) 1409 private void SetupPrimCommands(MySqlDataAdapter da, MySqlConnection conn)
1408 { 1410 {
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
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
index d65e8d5..0b2df9d 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
@@ -624,19 +624,20 @@ namespace OpenSim.Framework.Data.SQLite
624 return user; 624 return user;
625 } 625 }
626 626
627 private void fillFriendRow(DataRow row, LLUUID ownerID, LLUUID friendID, uint perms) 627// TODO: unused
628 { 628// private void fillFriendRow(DataRow row, LLUUID ownerID, LLUUID friendID, uint perms)
629 row["ownerID"] = ownerID.UUID.ToString(); 629// {
630 row["friendID"] = friendID.UUID.ToString(); 630// row["ownerID"] = ownerID.UUID.ToString();
631 row["friendPerms"] = perms; 631// row["friendID"] = friendID.UUID.ToString();
632 foreach (DataColumn col in ds.Tables["userfriends"].Columns) 632// row["friendPerms"] = perms;
633 { 633// foreach (DataColumn col in ds.Tables["userfriends"].Columns)
634 if (row[col] == null) 634// {
635 { 635// if (row[col] == null)
636 row[col] = String.Empty; 636// {
637 } 637// row[col] = String.Empty;
638 } 638// }
639 } 639// }
640// }
640 641
641 private void fillUserRow(DataRow row, UserProfileData user) 642 private void fillUserRow(DataRow row, UserProfileData user)
642 { 643 {