void StartSortie(ApiInfo rpInfo)
{
r_ReturnReason = null;
var rSortie = SortieInfo.Current;
var rMap = rSortie.Map;
using (var rCommand = Connection.CreateCommand())
{
rCommand.CommandText =
"INSERT OR IGNORE INTO sortie_map(id, is_event_map) VALUES(@map_id, @is_event_map);" +
"INSERT INTO sortie(id, map, difficulty, map_hp) VALUES(@sortie_id, @map_id, @difficulty, @map_hp);";
rCommand.Parameters.AddWithValue("@map_id", rMap.ID);
rCommand.Parameters.AddWithValue("@sortie_id", rSortie.ID);
rCommand.Parameters.AddWithValue("@is_event_map", rMap.IsEventMap);
rCommand.Parameters.AddWithValue("@difficulty", rMap.Difficulty);
rCommand.Parameters.AddWithValue("@map_hp", rMap.HasGauge ? rMap.HP.Current : (int?)null);
if (rMap.HasGauge)
{
rCommand.CommandText += "INSERT OR IGNORE INTO sortie_map_hp(id, difficulty, hp) VALUES(@map_id, coalesce(@difficulty, 0), @map_max_hp);";
rCommand.Parameters.AddWithValue("@map_max_hp", rMap.HP.Maximum);
}
rCommand.ExecuteNonQuery();
}
InsertExplorationRecord(rSortie);
}
void InsertExplorationRecord(SortieInfo rpSortie)