protected virtual void DeserializeAttributes(PersistanceReader ip) { this.m_Flags = (OptionFlag)ip.GetInt32("flags"); this.m_NotoQuery = (NotoQueryType)ip.GetInt32("notoQuery"); this.m_HouseLevel = Math.Min(Math.Max(1, ip.GetInt32("houseLevel")), 5); this.m_Flags |= OptionFlag.HotkeysEnabled; }
public CharData() { this.m_TextHue = 0x60; this.m_EmoteHue = 0x60; this.m_WhisperHue = 0x60; this.m_YellHue = 0x60; this.m_NotoQuery = NotoQueryType.On; this.m_AutoPickup = true; this.m_RegBag = -1; this.m_Stock = -1; this.m_DefaultRegs = 100; this.m_IncomingNames = true; this.m_RestrictCures = true; this.m_RestrictHeals = true; this.m_NotorietyHues = new int[] { 0x59, 0x3f, 0x517, 0x3b2, 0x90, 0x22, 0x35 }; this.m_Layout = new ArrayList(); this.m_Equip = new EquipManager(); this.m_Friends = new ArrayList(); this.m_AutoUse = new ArrayList(); }
public Options() { this.m_Flags = OptionFlag.Default; this.m_NotoQuery = NotoQueryType.On; this.m_HouseLevel = 1; }
private void LoadEntry(BinaryReader bin) { int num = bin.ReadInt32(); for (int i = 0; i < num; i++) { int num3 = bin.ReadInt32(); int count = bin.ReadInt32(); switch (num3) { case 0: this.m_TextHue = bin.ReadInt32(); break; case 1: this.m_EmoteHue = bin.ReadInt32(); break; case 2: this.m_WhisperHue = bin.ReadInt32(); break; case 3: this.m_YellHue = bin.ReadInt32(); break; case 4: this.m_Layout.Add(new GumpLayout(bin.ReadInt32(), bin.ReadInt32(), bin.ReadInt32(), bin.ReadInt32(), bin.ReadInt32(), bin.ReadInt32())); break; case 5: this.m_Equip.AutoEquip.Add(bin.ReadInt32(), bin.ReadInt32()); break; case 6: { Mobile mobile = World.WantMobile(bin.ReadInt32()); mobile.m_IsFriend = true; this.m_Friends.Add(mobile); break; } case 7: this.m_NotoQuery = (NotoQueryType) bin.ReadByte(); break; case 8: this.m_QueueTargets = bin.ReadBoolean(); break; case 9: this.m_Halos = bin.ReadBoolean(); break; case 10: { Item item = World.WantItem(bin.ReadInt32()); item.OverrideHue(0x22); this.m_AutoUse.Add(item); break; } case 11: this.m_AutoPickup = bin.ReadBoolean(); break; case 12: this.m_LootGold = bin.ReadBoolean(); break; case 13: this.m_Archery = bin.ReadBoolean(); break; case 14: this.m_RegBag = bin.ReadInt32(); break; case 15: this.m_Stock = bin.ReadInt32(); break; case 0x10: this.m_DefaultRegs = bin.ReadInt32(); break; case 0x11: this.m_Name = Encoding.ASCII.GetString(bin.ReadBytes(count)); break; case 0x12: this.m_Shard = Encoding.ASCII.GetString(bin.ReadBytes(count)); break; case 0x13: this.m_NotorietyHues[0] = bin.ReadInt32(); break; case 20: this.m_NotorietyHues[1] = bin.ReadInt32(); break; case 0x15: this.m_NotorietyHues[2] = bin.ReadInt32(); break; case 0x16: this.m_NotorietyHues[3] = bin.ReadInt32(); break; case 0x17: this.m_NotorietyHues[4] = bin.ReadInt32(); break; case 0x18: this.m_NotorietyHues[5] = bin.ReadInt32(); break; case 0x19: this.m_NotorietyHues[6] = bin.ReadInt32(); break; case 0x1a: this.m_IncomingNames = bin.ReadBoolean(); break; case 0x1b: this.m_RestrictCures = bin.ReadBoolean(); break; case 0x1c: this.m_RestrictHeals = bin.ReadBoolean(); break; default: bin.BaseStream.Seek((long) count, SeekOrigin.Current); break; } } }
public CharData(int Serial) { this.m_TextHue = 0x60; this.m_EmoteHue = 0x60; this.m_WhisperHue = 0x60; this.m_YellHue = 0x60; this.m_NotoQuery = NotoQueryType.On; this.m_AutoPickup = true; this.m_RegBag = -1; this.m_Stock = -1; this.m_DefaultRegs = 100; this.m_IncomingNames = true; this.m_RestrictCures = true; this.m_RestrictHeals = true; this.m_NotorietyHues = new int[] { 0x59, 0x3f, 0x517, 0x3b2, 0x90, 0x22, 0x35 }; this.m_Layout = new ArrayList(); this.m_Equip = new EquipManager(); this.m_Friends = new ArrayList(); this.m_AutoUse = new ArrayList(); this.m_Serial = Serial; string path = Engine.FileManager.BasePath("Data/Binary/Chardata.mul"); if (File.Exists(path)) { try { using (BinaryReader reader = new BinaryReader(File.OpenRead(path))) { int num = reader.ReadInt32(); for (int i = 0; i < num; i++) { int num3 = reader.ReadInt32(); int num4 = reader.ReadInt32(); if (num3 == Serial) { this.LoadEntry(reader); break; } reader.BaseStream.Seek((long) num4, SeekOrigin.Current); } reader.Close(); } } catch (Exception exception) { this.m_TextHue = 0x60; this.m_EmoteHue = 0x60; this.m_WhisperHue = 0x60; this.m_YellHue = 0x60; this.m_Equip.AutoEquip.Clear(); this.m_Layout.Clear(); this.m_Friends.Clear(); this.m_AutoUse.Clear(); Debug.Trace("Chardata.mul read failed."); Debug.Error(exception); if (MessageBox.Show("Failed to read 'Data/Binary/Chardata.mul', it may be corrupt. If the problem persists, delete the file.\nDelete the file now?", "Client", MessageBoxButtons.YesNo, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { try { File.Delete(path); } catch { MessageBox.Show("Failed to delete 'Data/Binary/Chardata.mul'.", "Client", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } } } }
public CharData(int Serial) { this.m_TextHue = 0x60; this.m_EmoteHue = 0x60; this.m_WhisperHue = 0x60; this.m_YellHue = 0x60; this.m_NotoQuery = NotoQueryType.On; this.m_AutoPickup = true; this.m_RegBag = -1; this.m_Stock = -1; this.m_DefaultRegs = 100; this.m_IncomingNames = true; this.m_RestrictCures = true; this.m_RestrictHeals = true; this.m_NotorietyHues = new int[] { 0x59, 0x3f, 0x517, 0x3b2, 0x90, 0x22, 0x35 }; this.m_Layout = new ArrayList(); this.m_Equip = new EquipManager(); this.m_Friends = new ArrayList(); this.m_AutoUse = new ArrayList(); this.m_Serial = Serial; string path = Engine.FileManager.BasePath("Data/Binary/Chardata.mul"); if (File.Exists(path)) { try { using (BinaryReader reader = new BinaryReader(File.OpenRead(path))) { int num = reader.ReadInt32(); for (int i = 0; i < num; i++) { int num3 = reader.ReadInt32(); int num4 = reader.ReadInt32(); if (num3 == Serial) { this.LoadEntry(reader); break; } reader.BaseStream.Seek((long)num4, SeekOrigin.Current); } reader.Close(); } } catch (Exception exception) { this.m_TextHue = 0x60; this.m_EmoteHue = 0x60; this.m_WhisperHue = 0x60; this.m_YellHue = 0x60; this.m_Equip.AutoEquip.Clear(); this.m_Layout.Clear(); this.m_Friends.Clear(); this.m_AutoUse.Clear(); Debug.Trace("Chardata.mul read failed."); Debug.Error(exception); if (MessageBox.Show("Failed to read 'Data/Binary/Chardata.mul', it may be corrupt. If the problem persists, delete the file.\nDelete the file now?", "Client", MessageBoxButtons.YesNo, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { try { File.Delete(path); } catch { MessageBox.Show("Failed to delete 'Data/Binary/Chardata.mul'.", "Client", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } } } }
private void LoadEntry(BinaryReader bin) { int num = bin.ReadInt32(); for (int i = 0; i < num; i++) { int num3 = bin.ReadInt32(); int count = bin.ReadInt32(); switch (num3) { case 0: this.m_TextHue = bin.ReadInt32(); break; case 1: this.m_EmoteHue = bin.ReadInt32(); break; case 2: this.m_WhisperHue = bin.ReadInt32(); break; case 3: this.m_YellHue = bin.ReadInt32(); break; case 4: this.m_Layout.Add(new GumpLayout(bin.ReadInt32(), bin.ReadInt32(), bin.ReadInt32(), bin.ReadInt32(), bin.ReadInt32(), bin.ReadInt32())); break; case 5: this.m_Equip.AutoEquip.Add(bin.ReadInt32(), bin.ReadInt32()); break; case 6: { Mobile mobile = World.WantMobile(bin.ReadInt32()); mobile.m_IsFriend = true; this.m_Friends.Add(mobile); break; } case 7: this.m_NotoQuery = (NotoQueryType)bin.ReadByte(); break; case 8: this.m_QueueTargets = bin.ReadBoolean(); break; case 9: this.m_Halos = bin.ReadBoolean(); break; case 10: { Item item = World.WantItem(bin.ReadInt32()); item.OverrideHue(0x22); this.m_AutoUse.Add(item); break; } case 11: this.m_AutoPickup = bin.ReadBoolean(); break; case 12: this.m_LootGold = bin.ReadBoolean(); break; case 13: this.m_Archery = bin.ReadBoolean(); break; case 14: this.m_RegBag = bin.ReadInt32(); break; case 15: this.m_Stock = bin.ReadInt32(); break; case 0x10: this.m_DefaultRegs = bin.ReadInt32(); break; case 0x11: this.m_Name = Encoding.ASCII.GetString(bin.ReadBytes(count)); break; case 0x12: this.m_Shard = Encoding.ASCII.GetString(bin.ReadBytes(count)); break; case 0x13: this.m_NotorietyHues[0] = bin.ReadInt32(); break; case 20: this.m_NotorietyHues[1] = bin.ReadInt32(); break; case 0x15: this.m_NotorietyHues[2] = bin.ReadInt32(); break; case 0x16: this.m_NotorietyHues[3] = bin.ReadInt32(); break; case 0x17: this.m_NotorietyHues[4] = bin.ReadInt32(); break; case 0x18: this.m_NotorietyHues[5] = bin.ReadInt32(); break; case 0x19: this.m_NotorietyHues[6] = bin.ReadInt32(); break; case 0x1a: this.m_IncomingNames = bin.ReadBoolean(); break; case 0x1b: this.m_RestrictCures = bin.ReadBoolean(); break; case 0x1c: this.m_RestrictHeals = bin.ReadBoolean(); break; default: bin.BaseStream.Seek((long)count, SeekOrigin.Current); break; } } }