bool InsertZoneEx(MySqlConnection connection, IInfoProvider2 dbq) { //HELPER VARIABLES IDataZoneInformationCollection zoneInformation = dbq.createDataZoneCollection(); MySqlCommand command = new MySqlCommand(_query_73, connection); try { command.Parameters.AddWithValue("CharId", zoneInformation.CharacterId); command.Parameters.AddWithValue("ZoneState", zoneInformation.ZoneInformation); return command.ExecuteNonQuery() > 0; } catch (Exception e) { Trace.Write(e.ToString(), "database"); return false; } }
//Third generation methods zone information bool LoadZoneEx(MySqlConnection connection, IInfoProvider2 dbq, bool continueOnError) { IDataZoneInformationCollection zoneInformation = dbq.createDataZoneCollection(); MySqlCommand command = new MySqlCommand(_query_71, connection); MySqlDataReader reader = null; command.Parameters.AddWithValue("CharId", zoneInformation.CharacterId); try { reader = command.ExecuteReader(CommandBehavior.SingleResult); while (reader.Read()) { if (reader.IsDBNull(0) == false) reader.GetBytes(0, 0, zoneInformation.ZoneInformation, 0, 255); return true; } __dbtracelog.WriteError("Database", "player zone-data of player with id {0} is missing", zoneInformation.CharacterId); return continueOnError; } catch (Exception e) { Trace.Write(e.ToString(), "database"); return false; } finally { if (reader != null) reader.Close(); } }