Example #1
0
        private static void InsertMissingLeaderboard(MySqlTransaction tran)
        {
            string lastValidPoll = DatabaseExtender.Cast<string>(tran.ExecuteScalar("SELECT data FROM squid_logs_stages_info WHERE is_valid = 1 ORDER BY start_date DESC LIMIT 1"));
            int newStages, newWeapons,
                newShoes, newClothes, newHead;
            StagesInfoRecord[] records = GetStagesInfo(lastValidPoll);
            StagesInfoRecord record = records[0];
            bool success = false;

            if (IsRecordValid(record))
            {
                success = Database.InsertLeaderboard(tran, record,
                    out newStages, out newWeapons, out newShoes, out newClothes, out newHead);
            }

            if (success)
            {
                Console.WriteLine("Inserted leaderboard for {0} to {1}.", record.datetime_term_begin, record.datetime_term_end);
            }
        }