Example #1
0
        public override int GetHash()
        {
            var szSkin = "";

            if (SkinId < 10)
            {
                szSkin = "0" + SkinId;
            }
            else
            {
                szSkin = SkinId.ToString();
            }

            var hash = 0;
            var gobj = "[Character]";

            for (var i = 0; i < gobj.Length; i++)
            {
                hash = char.ToLower(gobj[i]) + 0x1003F * hash;
            }

            for (var i = 0; i < Model.Length; i++)
            {
                hash = char.ToLower(Model[i]) + 0x1003F * hash;
            }

            for (var i = 0; i < szSkin.Length; i++)
            {
                hash = char.ToLower(szSkin[i]) + 0x1003F * hash;
            }

            return(hash);
        }
Example #2
0
        private void SaveSettings()
        {
            string ExtendName = "";

            if (radioButton1.Checked == true)
            {
                ExtendName = "MP4";
            }
            if (radioButton2.Checked == true)
            {
                ExtendName = "MKV";
            }
            if (radioButton3.Checked == true)
            {
                ExtendName = "TS";
            }
            if (radioButton4.Checked == true)
            {
                ExtendName = "FLV";
            }

            XmlTextWriter xml = new XmlTextWriter(@"Tools\Settings.xml", Encoding.UTF8);

            xml.Formatting = Formatting.Indented;
            xml.WriteStartDocument();
            xml.WriteStartElement("Settings");

            xml.WriteStartElement("Skin"); xml.WriteCData(SkinId.ToString()); xml.WriteEndElement();
            xml.WriteStartElement("DownPath"); xml.WriteCData(textBox_DownloadPath.Text); xml.WriteEndElement();
            xml.WriteStartElement("ExtendName"); xml.WriteCData(ExtendName); xml.WriteEndElement();

            xml.WriteEndElement();
            xml.WriteEndDocument();
            xml.Flush();
            xml.Close();
        }