/// <Safe>Yes</Safe> bool IDatabase.GetItemByAuctionId(uint id, out AuctionArgument item) { MySqlConnection connection = ConnectionPool.Request(); try { return(GetItemByAuctionId(connection, id, out item)); } catch (Exception) { Trace.TraceWarning("Unhandeled database error"); item = null; return(false); } finally { //Release resources ConnectionPool.Release(connection); } }
public bool GetItemByAuctionId(MySqlConnection connection, uint id, out AuctionArgument item) { MySqlCommand command = new MySqlCommand(); command.CommandText = _query_08; command.Connection = connection; command.Parameters.AddWithValue("AuctionId", id); MySqlDataReader reader = null; item = null; try { reader = command.ExecuteReader(CommandBehavior.SingleResult); while (reader.Read()) { item = new AuctionArgument(); item.name = reader.GetString(4); item.zeny = reader.GetUInt32(7); byte[] buffer = new byte[67]; reader.GetBytes(8, 0, buffer, 0, 67); Rag2Item.Deserialize(out item.item, buffer, 0); return(true); } } catch (MySqlException e) { __dbtracelog.WriteError("Database", e.Message); return(false); } finally { if (reader != null) { reader.Close(); } } return(false); }
public bool GetItemByAuctionId(uint id, out AuctionArgument item) { return InternalDatabaseProvider.GetItemByAuctionId(id, out item); }
/// <Safe>Yes</Safe> bool IDatabase.GetItemByAuctionId(uint id, out AuctionArgument item) { MySqlConnection connection = ConnectionPool.Request(); try { return GetItemByAuctionId(connection, id, out item); } catch (Exception) { Trace.TraceWarning("Unhandeled database error"); item = null; return false; } finally { //Release resources ConnectionPool.Release(connection); } }
public bool GetItemByAuctionId(MySqlConnection connection, uint id, out AuctionArgument item) { MySqlCommand command = new MySqlCommand(); command.CommandText = _query_08; command.Connection = connection; command.Parameters.AddWithValue("AuctionId", id); MySqlDataReader reader = null; item = null; try { reader = command.ExecuteReader(CommandBehavior.SingleResult); while (reader.Read()) { item = new AuctionArgument(); item.name = reader.GetString(4); item.zeny = reader.GetUInt32(7); byte[] buffer = new byte[67]; reader.GetBytes(8, 0, buffer, 0, 67); Rag2Item.Deserialize(out item.item, buffer, 0); return true; } } catch (MySqlException e) { __dbtracelog.WriteError("Database", e.Message); return false; } finally { if (reader != null) reader.Close(); } return false; }