예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (charname.Text == "")
            {
                return;
            }
            searchbtn.Enabled = false;
            profile           = Profile.RetriveProfile("na", charname.Text);
            if (profile == null)
            {
                statusImg.Image    = StatusImg.dne;
                detailsbtn.Visible = false;
            }
            else
            {
                check = BanCheck.RetriveBanRecords(profile);
                if (check == null || check.records.Count == 0)
                {
                    statusImg.Image = StatusImg.noban;
                }
                else
                {
                    bool blacklist = false;
                    bool warning   = false;
                    foreach (BanRecord record in check.records)
                    {
                        if (record.isBan())
                        {
                            blacklist = true;
                        }
                        else if (record.isWarning())
                        {
                            warning = true;
                        }
                    }
                    if (blacklist)
                    {
                        statusImg.Image = StatusImg.ban;
                    }
                    else if (warning)
                    {
                        statusImg.Image = StatusImg.reported;
                    }
                    else
                    {
                        statusImg.Image = StatusImg.noban;
                    }
                }

                detailsbtn.Visible = true;
            }
            resultPanel.Visible = true;
            searchbtn.Enabled   = true;
        }
예제 #2
0
        public static BanCheck RetriveBanRecords(Profile profile)
        {
            BanCheck result = new BanCheck();

            result.uid = MD5Helper.GetMd5Hash(profile.characterName);
            result.AddRecord(profile.region, result.uid);
            foreach (string playername in profile.altsName)
            {
                result.AddRecord(profile.region, MD5Helper.GetMd5Hash(playername));
            }
            if (Config.enableLocalCheck)
            {
                result.AddLocalRecord(profile.region, result.uid);
                foreach (string playername in profile.altsName)
                {
                    result.AddLocalRecord(profile.region, MD5Helper.GetMd5Hash(playername));
                }
            }
            return(result);
        }
예제 #3
0
        public Detail(Profile pf, BanCheck check)
        {
            InitializeComponent();
            this.pf       = pf;
            this.check    = check;
            charname.Text = pf.accountName + "[" + pf.characterName + "]";
            charinfo.Text = pf.pclass + "[" + pf.build + "] | Level" + pf.level + " · HongmoonLevel " + pf.hmlevel + " | " + pf.server + " | " + pf.guild;
            aplarge.Text  = apsmall.Text = pf.ap.ToString();
            hplarge.Text  = hpsmall.Text = pf.hp.ToString();
            altlist.Items.Clear();
            foreach (string alt in pf.altsName)
            {
                altlist.Items.Add(alt);
            }
            equipments.Items.Clear();
            if (pf.equipments.weapon == "")
            {
                equipments.Items.Add("Weapon\t: None");
            }
            else
            {
                equipments.Items.Add("Weapon\t: " + pf.equipments.weapon);
            }
            if (pf.equipments.ring == "")
            {
                equipments.Items.Add("Ring\t: None");
            }
            else
            {
                equipments.Items.Add("Ring\t: " + pf.equipments.ring);
            }
            if (pf.equipments.earing == "")
            {
                equipments.Items.Add("Earing\t: None");
            }
            else
            {
                equipments.Items.Add("Earing\t: " + pf.equipments.earing);
            }
            if (pf.equipments.bracelet == "")
            {
                equipments.Items.Add("Bracelet\t: None");
            }
            else
            {
                equipments.Items.Add("Bracelet\t: " + pf.equipments.bracelet);
            }
            if (pf.equipments.belt == "")
            {
                equipments.Items.Add("Belt\t: None");
            }
            else
            {
                equipments.Items.Add("Belt\t: " + pf.equipments.belt);
            }
            if (pf.equipments.pet == "")
            {
                equipments.Items.Add("Pet Aura\t: None");
            }
            else
            {
                equipments.Items.Add("Pet Aura\t: " + pf.equipments.pet);
            }
            if (pf.equipments.gloves == "")
            {
                equipments.Items.Add("Gloves\t: None");
            }
            else
            {
                equipments.Items.Add("Gloves\t: " + pf.equipments.gloves);
            }
            if (pf.equipments.soul == "")
            {
                equipments.Items.Add("Soul\t: None");
            }
            else
            {
                equipments.Items.Add("Soul\t: " + pf.equipments.soul);
            }
            if (pf.equipments.heart == "")
            {
                equipments.Items.Add("Heart\t: None");
            }
            else
            {
                equipments.Items.Add("Heart\t: " + pf.equipments.heart);
            }
            if (pf.equipments.talisman == "")
            {
                equipments.Items.Add("Talisman\t: None");
            }
            else
            {
                equipments.Items.Add("Talisman\t: " + pf.equipments.talisman);
            }
            if (pf.equipments.soulbadge == "")
            {
                equipments.Items.Add("SoulBadge: None");
            }
            else
            {
                equipments.Items.Add("SoulBadge: " + pf.equipments.soulbadge);
            }
            if (pf.equipments.mysticbadge == "")
            {
                equipments.Items.Add("MystBadge: None");
            }
            else
            {
                equipments.Items.Add("MystBadge: " + pf.equipments.mysticbadge);
            }
            img.ImageLocation = pf.img;

            bool blacklist = false;
            bool warning   = false;

            record.Items.Clear();
            foreach (BanRecord rec in check.records)
            {
                string[] row          = { rec.bancode, rec.reason, rec.url };
                var      listViewItem = new ListViewItem(row);
                record.Items.Add(listViewItem);
                if (rec.isBan())
                {
                    blacklist = true;
                }
                else if (rec.isWarning())
                {
                    warning = true;
                }
            }
            if (blacklist)
            {
                charname.ForeColor = Color.FromArgb(196, 19, 48);
            }
            else if (warning)
            {
                charname.ForeColor = Color.FromArgb(236, 135, 40);
            }
            reportImg        = new ButtonImageSet();
            reportImg.normal = DetailsWindowBtns.report_normal;
            reportImg.hover  = DetailsWindowBtns.report_hover;
            reportBtn.Image  = reportImg.normal;
        }