aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MySQL
diff options
context:
space:
mode:
authorAdam Frisby2008-01-15 02:09:55 +0000
committerAdam Frisby2008-01-15 02:09:55 +0000
commitb25f9f322cdbcde7fd8c043137bf07992e5ef318 (patch)
tree7c1a5115b2849dfe388b825dd271271d347f9574 /OpenSim/Framework/Data.MySQL
parentSet svn:eol-style. (diff)
downloadopensim-SC-b25f9f322cdbcde7fd8c043137bf07992e5ef318.zip
opensim-SC-b25f9f322cdbcde7fd8c043137bf07992e5ef318.tar.gz
opensim-SC-b25f9f322cdbcde7fd8c043137bf07992e5ef318.tar.bz2
opensim-SC-b25f9f322cdbcde7fd8c043137bf07992e5ef318.tar.xz
* Mother of all commits:
* Cleaned up copyright notices in AssemblyInfo.cs's * Added Copyright headers to a bunch of files missing them * Replaced several common string instances with a static constant to prevent reallocation of the same strings thousands of times. "" -> String.Empty is the first such candidate.
Diffstat (limited to 'OpenSim/Framework/Data.MySQL')
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLDataStore.cs10
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLGridData.cs6
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLManager.cs12
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLUserData.cs6
-rw-r--r--OpenSim/Framework/Data.MySQL/Properties/AssemblyInfo.cs30
5 files changed, 46 insertions, 18 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
index 8055448..26985b3 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLDataStore.cs
@@ -485,7 +485,7 @@ namespace OpenSim.Framework.Data.MySQL
485 foreach (DataColumn column in table.Columns) 485 foreach (DataColumn column in table.Columns)
486 Debug.Write(column.ColumnName + " = " + 486 Debug.Write(column.ColumnName + " = " +
487 row[column, DataRowVersion.Original] + ", "); 487 row[column, DataRowVersion.Original] + ", ");
488 Debug.WriteLine(""); 488 Debug.WriteLine(String.Empty);
489 } 489 }
490 //--- Display the current values, if there are any. 490 //--- Display the current values, if there are any.
491 if (row.HasVersion(DataRowVersion.Current)) 491 if (row.HasVersion(DataRowVersion.Current))
@@ -494,9 +494,9 @@ namespace OpenSim.Framework.Data.MySQL
494 foreach (DataColumn column in table.Columns) 494 foreach (DataColumn column in table.Columns)
495 Debug.Write(column.ColumnName + " = " + 495 Debug.Write(column.ColumnName + " = " +
496 row[column, DataRowVersion.Current] + ", "); 496 row[column, DataRowVersion.Current] + ", ");
497 Debug.WriteLine(""); 497 Debug.WriteLine(String.Empty);
498 } 498 }
499 Debug.WriteLine(""); 499 Debug.WriteLine(String.Empty);
500 } 500 }
501 } 501 }
502 } 502 }
@@ -1313,7 +1313,7 @@ namespace OpenSim.Framework.Data.MySQL
1313 private MySqlCommand createUpdateCommand(string table, string pk, DataTable dt) 1313 private MySqlCommand createUpdateCommand(string table, string pk, DataTable dt)
1314 { 1314 {
1315 string sql = "update " + table + " set "; 1315 string sql = "update " + table + " set ";
1316 string subsql = ""; 1316 string subsql = String.Empty;
1317 foreach (DataColumn col in dt.Columns) 1317 foreach (DataColumn col in dt.Columns)
1318 { 1318 {
1319 if (subsql.Length > 0) 1319 if (subsql.Length > 0)
@@ -1341,7 +1341,7 @@ namespace OpenSim.Framework.Data.MySQL
1341 private string defineTable(DataTable dt) 1341 private string defineTable(DataTable dt)
1342 { 1342 {
1343 string sql = "create table " + dt.TableName + "("; 1343 string sql = "create table " + dt.TableName + "(";
1344 string subsql = ""; 1344 string subsql = String.Empty;
1345 foreach (DataColumn col in dt.Columns) 1345 foreach (DataColumn col in dt.Columns)
1346 { 1346 {
1347 if (subsql.Length > 0) 1347 if (subsql.Length > 0)
diff --git a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
index 7cfac12..c8c4ab0 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
@@ -219,8 +219,8 @@ namespace OpenSim.Framework.Data.MySQL
219 if (querysplit.Length == 2) 219 if (querysplit.Length == 2)
220 { 220 {
221 Dictionary<string, string> param = new Dictionary<string, string>(); 221 Dictionary<string, string> param = new Dictionary<string, string>();
222 param["?first"] = objAlphaNumericPattern.Replace(querysplit[0], "") + "%"; 222 param["?first"] = objAlphaNumericPattern.Replace(querysplit[0], String.Empty) + "%";
223 param["?second"] = objAlphaNumericPattern.Replace(querysplit[1], "") + "%"; 223 param["?second"] = objAlphaNumericPattern.Replace(querysplit[1], String.Empty) + "%";
224 try 224 try
225 { 225 {
226 lock (database) 226 lock (database)
@@ -258,7 +258,7 @@ namespace OpenSim.Framework.Data.MySQL
258 lock (database) 258 lock (database)
259 { 259 {
260 Dictionary<string, string> param = new Dictionary<string, string>(); 260 Dictionary<string, string> param = new Dictionary<string, string>();
261 param["?first"] = objAlphaNumericPattern.Replace(querysplit[0], "") + "%"; 261 param["?first"] = objAlphaNumericPattern.Replace(querysplit[0], System.String.Empty) + "%";
262 262
263 IDbCommand result = 263 IDbCommand result =
264 database.Query( 264 database.Query(
diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
index 7645df3..15ccf5f 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
@@ -323,7 +323,7 @@ namespace OpenSim.Framework.Data.MySQL
323 323
324 // World Map Addition 324 // World Map Addition
325 string tempRegionMap = reader["regionMapTexture"].ToString(); 325 string tempRegionMap = reader["regionMapTexture"].ToString();
326 if (tempRegionMap != "") 326 if (tempRegionMap != String.Empty)
327 { 327 {
328 retval.regionMapTextureID = new LLUUID(tempRegionMap); 328 retval.regionMapTextureID = new LLUUID(tempRegionMap);
329 } 329 }
@@ -572,12 +572,12 @@ namespace OpenSim.Framework.Data.MySQL
572 parameters["?homeLookAtZ"] = homeLookAtZ.ToString(); 572 parameters["?homeLookAtZ"] = homeLookAtZ.ToString();
573 parameters["?created"] = created.ToString(); 573 parameters["?created"] = created.ToString();
574 parameters["?lastLogin"] = lastlogin.ToString(); 574 parameters["?lastLogin"] = lastlogin.ToString();
575 parameters["?userInventoryURI"] = ""; 575 parameters["?userInventoryURI"] = String.Empty;
576 parameters["?userAssetURI"] = ""; 576 parameters["?userAssetURI"] = String.Empty;
577 parameters["?profileCanDoMask"] = "0"; 577 parameters["?profileCanDoMask"] = "0";
578 parameters["?profileWantDoMask"] = "0"; 578 parameters["?profileWantDoMask"] = "0";
579 parameters["?profileAboutText"] = ""; 579 parameters["?profileAboutText"] = String.Empty;
580 parameters["?profileFirstText"] = ""; 580 parameters["?profileFirstText"] = String.Empty;
581 parameters["?profileImage"] = LLUUID.Zero.ToString(); 581 parameters["?profileImage"] = LLUUID.Zero.ToString();
582 parameters["?profileFirstImage"] = LLUUID.Zero.ToString(); 582 parameters["?profileFirstImage"] = LLUUID.Zero.ToString();
583 parameters["?webLoginKey"] = LLUUID.Random().ToString(); 583 parameters["?webLoginKey"] = LLUUID.Random().ToString();
@@ -612,7 +612,7 @@ namespace OpenSim.Framework.Data.MySQL
612 { 612 {
613 bool GRID_ONLY_UPDATE_NECESSARY_DATA = false; 613 bool GRID_ONLY_UPDATE_NECESSARY_DATA = false;
614 614
615 string sql = ""; 615 string sql = String.Empty;
616 if (GRID_ONLY_UPDATE_NECESSARY_DATA) 616 if (GRID_ONLY_UPDATE_NECESSARY_DATA)
617 { 617 {
618 sql += "INSERT INTO "; 618 sql += "INSERT INTO ";
diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
index 76ad551..f637db6 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
@@ -347,8 +347,8 @@ namespace OpenSim.Framework.Data.MySQL
347 if (querysplit.Length == 2) 347 if (querysplit.Length == 2)
348 { 348 {
349 Dictionary<string, string> param = new Dictionary<string, string>(); 349 Dictionary<string, string> param = new Dictionary<string, string>();
350 param["?first"] = objAlphaNumericPattern.Replace(querysplit[0], "") + "%"; 350 param["?first"] = objAlphaNumericPattern.Replace(querysplit[0], String.Empty) + "%";
351 param["?second"] = objAlphaNumericPattern.Replace(querysplit[1], "") + "%"; 351 param["?second"] = objAlphaNumericPattern.Replace(querysplit[1], String.Empty) + "%";
352 try 352 try
353 { 353 {
354 lock (database) 354 lock (database)
@@ -386,7 +386,7 @@ namespace OpenSim.Framework.Data.MySQL
386 lock (database) 386 lock (database)
387 { 387 {
388 Dictionary<string, string> param = new Dictionary<string, string>(); 388 Dictionary<string, string> param = new Dictionary<string, string>();
389 param["?first"] = objAlphaNumericPattern.Replace(querysplit[0], "") + "%"; 389 param["?first"] = objAlphaNumericPattern.Replace(querysplit[0], String.Empty) + "%";
390 390
391 IDbCommand result = 391 IDbCommand result =
392 database.Query( 392 database.Query(
diff --git a/OpenSim/Framework/Data.MySQL/Properties/AssemblyInfo.cs b/OpenSim/Framework/Data.MySQL/Properties/AssemblyInfo.cs
index 7024bfa..b33d319 100644
--- a/OpenSim/Framework/Data.MySQL/Properties/AssemblyInfo.cs
+++ b/OpenSim/Framework/Data.MySQL/Properties/AssemblyInfo.cs
@@ -1,3 +1,31 @@
1/*
2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28
1using System.Reflection; 29using System.Reflection;
2using System.Runtime.InteropServices; 30using System.Runtime.InteropServices;
3 31
@@ -10,7 +38,7 @@ using System.Runtime.InteropServices;
10[assembly : AssemblyConfiguration("")] 38[assembly : AssemblyConfiguration("")]
11[assembly : AssemblyCompany("")] 39[assembly : AssemblyCompany("")]
12[assembly : AssemblyProduct("OpenSim.Framework.Data.MySQL")] 40[assembly : AssemblyProduct("OpenSim.Framework.Data.MySQL")]
13[assembly : AssemblyCopyright("Copyright © 2007")] 41[assembly : AssemblyCopyright("Copyright © OpenSimulator.org Developers 2007-2008")]
14[assembly : AssemblyTrademark("")] 42[assembly : AssemblyTrademark("")]
15[assembly : AssemblyCulture("")] 43[assembly : AssemblyCulture("")]
16 44