aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Data.SQLite/SQLiteGridData.cs')
-rw-r--r--OpenSim/Framework/Data.SQLite/SQLiteGridData.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
index 6487ba7..4d42f19 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs
@@ -112,6 +112,38 @@ namespace OpenSim.Framework.Data.SQLite
112 } 112 }
113 113
114 /// <summary> 114 /// <summary>
115 /// Returns a sim profile from it's Region name string
116 /// </summary>
117 /// <param name="uuid">The region name search query</param>
118 /// <returns>The sim profile</returns>
119 public RegionProfileData GetProfileByString(string regionName)
120 {
121 if (regionName.Length > 2)
122 {
123
124 Dictionary<string, string> param = new Dictionary<string, string>();
125 // Add % because this is a like query.
126 param["?regionName"] = regionName + "%";
127 // Only returns one record or no record.
128 IDbCommand result = database.Query("SELECT * FROM regions WHERE regionName like ?regionName LIMIT 1", param);
129 IDataReader reader = result.ExecuteReader();
130
131 RegionProfileData row = database.getRow(reader);
132 reader.Close();
133 result.Dispose();
134
135 return row;
136
137 }
138 else
139 {
140 //m_log.Error("[DATABASE]: Searched for a Region Name shorter then 3 characters");
141 return null;
142 }
143 }
144
145
146 /// <summary>
115 /// Returns a sim profile from it's UUID 147 /// Returns a sim profile from it's UUID
116 /// </summary> 148 /// </summary>
117 /// <param name="uuid">The region UUID</param> 149 /// <param name="uuid">The region UUID</param>