aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs
diff options
context:
space:
mode:
authormingchen2007-06-26 17:50:27 +0000
committermingchen2007-06-26 17:50:27 +0000
commit8ff1d0968ff3c4173b036398359ef62a356ad2b2 (patch)
tree46e740c18866096e1c4f03e4a42cf7e0c0a4539c /OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs
parent* Updated demo filter to show more common usage (as well as embedding multipl... (diff)
downloadopensim-SC_OLD-8ff1d0968ff3c4173b036398359ef62a356ad2b2.zip
opensim-SC_OLD-8ff1d0968ff3c4173b036398359ef62a356ad2b2.tar.gz
opensim-SC_OLD-8ff1d0968ff3c4173b036398359ef62a356ad2b2.tar.bz2
opensim-SC_OLD-8ff1d0968ff3c4173b036398359ef62a356ad2b2.tar.xz
*Added support for reservations in OpenGridServices (mysql only for now)
*SQL file coming soon (as soon as I can figure out how to get the
Diffstat (limited to '')
-rw-r--r--OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs
index d9a517d..4d6cf63 100644
--- a/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs
+++ b/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLGridData.cs
@@ -252,6 +252,33 @@ namespace OpenGrid.Framework.Data.MySQL
252 252
253 return false; 253 return false;
254 } 254 }
255
256 public ReservationData GetReservationAtPoint(uint x, uint y)
257 {
258 try
259 {
260 lock (database)
261 {
262 Dictionary<string, string> param = new Dictionary<string, string>();
263 param["?x"] = x.ToString();
264 param["?y"] = y.ToString();
265 System.Data.IDbCommand result = database.Query("SELECT * FROM reservations WHERE resXMin <= ?x AND resXMax >= ?x AND resYMin <= ?y AND resYMax >= ?y", param);
266 System.Data.IDataReader reader = result.ExecuteReader();
267
268 ReservationData row = database.readReservationRow(reader);
269 reader.Close();
270 result.Dispose();
271
272 return row;
273 }
274 }
275 catch (Exception e)
276 {
277 database.Reconnect();
278 Console.WriteLine(e.ToString());
279 return null;
280 }
281 }
255 } 282 }
256 283
257 284