Пример #1
0
        public static bool UpdateRaidAttendance(string toon, string server)
        {
            // parse and build upload logs
            MemoryStream part1 = FuParse.ParseRoster(toon, server);

            // I picked 10 because "empty" ones seem to have a length of 3, so yeah
            if (part1.Length < 10)
            {
                MessageBox.Show("Problem with the Guild Roster.");
                return(false);
            }
            else
            {
                MemoryStream part2 = FuParse.ParseAttendance(toon, server);
                if (part2.Length < 10)
                {
                    MessageBox.Show("Unable to locate or process your raid dump file.");
                    return(false);
                }
                else
                {
                    string     raidFilename = String.Format("raid_{0}_{1}_{2}.txt", server, toon, DateTime.Now.ToString("yyyyMMdd-hhmmss"));
                    string     raidPath     = Path.Combine(GetAppFolder(), LogFolder, raidFilename);
                    FileStream fs           = new FileStream(raidPath, FileMode.Append);
                    part1.CopyTo(fs);
                    new MemoryStream(Encoding.ASCII.GetBytes("FU-DEMILITER-THINGER")).CopyTo(fs);
                    part2.CopyTo(fs);
                    fs.Close();
                    return(true);
                }
            }
        }
Пример #2
0
        public static bool UpdateGuildRoster(string toon, string server)
        {
            MemoryStream rost = FuParse.ParseRoster(toon, server);

            if (rost.Length < 10)
            {
                MessageBox.Show("Guild Roster is Empty :(");
                return(false);
            }
            else
            {
                // parse and build upload logs
                string     guildFilename = String.Format("guild_{0}_{1}_{2}.txt", server, toon, DateTime.Now.ToString("yyyyMMdd-hhmmss"));
                string     guildPath     = Path.Combine(GetAppFolder(), LogFolder, guildFilename);
                FileStream fs            = new FileStream(guildPath, FileMode.Append);
                rost.CopyTo(fs);
                fs.Close();
                return(true);
            }
        }