protected override void ReadXmlBase(XmlReader reader) { base.ReadXmlBase(reader); DesignByContract.Check.Assert(reader.LocalName == "subject", "Expected LocalName is 'subject', but it is " + reader.LocalName); this.subject = new PartySelf(); this.subject.ReadXml(reader); DesignByContract.Check.Assert(reader.LocalName == "is_queryable", "Expected LocalName is 'is_queryable', but it is " + reader.LocalName); this.isQueryable = reader.ReadElementContentAsBoolean("is_queryable", RmXmlSerializer.OpenEhrNamespace); //this.isQueryableSet = true; reader.MoveToContent(); DesignByContract.Check.Assert(reader.LocalName == "is_modifiable", "Expected LocalName is 'is_modifiable', but it is " + reader.LocalName); this.isModifiable = reader.ReadElementContentAsBoolean("is_modifiable", RmXmlSerializer.OpenEhrNamespace); //this.isModifiableSet = true; reader.MoveToContent(); if (reader.LocalName == "other_details") { string otherDetailsType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace); DesignByContract.Check.Assert(!string.IsNullOrEmpty(otherDetailsType), "otherDetailsType must not be null or empty."); this.otherDetails = Locatable.GetLocatableObjectByType(otherDetailsType) as ItemStructure; this.otherDetails.ReadXml(reader); } }
public static void Load() { Parallel.Invoke( () => { Items = new GameDataMap <ushort, ItemStructure>(ItemStructure.Load(XDocument.Parse(RawObjectsXML))); PluginUtils.Log("GameData", "Mapped {0} items.", Items.Map.Count); }, () => { Tiles = new GameDataMap <ushort, TileStructure>(TileStructure.Load(XDocument.Parse(RawTilesXML))); PluginUtils.Log("GameData", "Mapped {0} tiles.", Tiles.Map.Count); }, () => { Objects = new GameDataMap <ushort, ObjectStructure>(ObjectStructure.Load(XDocument.Parse(RawObjectsXML))); PluginUtils.Log("GameData", "Mapped {0} objects.", Objects.Map.Count); }, () => { Packets = new GameDataMap <byte, PacketStructure>(PacketStructure.Load(XDocument.Parse(RawPacketsXML))); PluginUtils.Log("GameData", "Mapped {0} packets.", Packets.Map.Count); }, () => { Servers = new GameDataMap <string, ServerStructure>(ServerStructure.Load(XDocument.Load("http://realmofthemadgodhrd.appspot.com/char/list"))); PluginUtils.Log("GameData", "Mapped {0} servers.", Servers.Map.Count); }); PluginUtils.Log("GameData", "Successfully loaded game data."); }
public void Open(byte newContainerIndex, Item container, ItemStructure strucc, bool childContainer = true) { var builder = new PacketBuilder(Packets.SendToClient.OpenContainer); builder.AddU8(newContainerIndex); // container index builder.AddU16(container.Id); // container look id? the one identifying the container builder.AddString(strucc.Name); builder.AddU8(strucc.ContainerSize); builder.AddU8((byte)(childContainer ? 1 : 0)); // 0 == root container, 1 == child container var inside = container.Inside; if (inside == null) { builder.AddU8(0); } else { builder.AddU8((byte) inside.Count); for (int i = 0; i < inside.Count; i++) { builder.AddItem(inside[i]); } } _player.OpenContainer(container); builder.Send(_player); }
public Action(DvText name, string archetypeNodeId, UidBasedId uid, Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit, CodePhrase language, CodePhrase encoding, PartyProxy subject, PartyProxy proider, Participation[] otherParticipations, ObjectRef workflowId, ItemStructure protocol, ObjectRef guidelineId, DvDateTime time, ItemStructure description, IsmTransition ismTransition, InstructionDetails instructionDetails) : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit, language, encoding, subject, proider, otherParticipations, workflowId, protocol, guidelineId) { Check.Require(time != null, "time must not be null"); Check.Require(description != null, "description must not be null"); Check.Require(ismTransition != null, "ismTransition must not be null"); this.time = time; this.description = description; if (this.description != null) { this.description.Parent = this; } this.ismTransition = ismTransition; if (this.ismTransition != null) { this.ismTransition.Parent = this; } this.instructionDetails = instructionDetails; if (this.instructionDetails != null) { this.instructionDetails.Parent = this; } SetAttributeDictionary(); CheckInvariants(); }
private void buttonRewOptItemAdd_Click(object sender, EventArgs e) { var itemId = short.Parse(textBoxRewOptItemId.Text); if (itemId <= 0) { logger.Error("ItemId must be greater than 0"); return; } var count = byte.Parse(textBoxRewOptItemCount.Text); if (count <= 0) { logger.Error("Count must be greater than 0"); return; } var itemStructure = new ItemStructure(itemId, count); if (listBoxRewOptItems.Items.Contains(itemStructure)) { logger.Error("ItemId already added"); return; } this.listBoxRewOptItems.Items.Add(itemStructure); }
public EventContext(DvDateTime startTime, DvDateTime endTime, DvCodedText setting, string location, PartyIdentified healthCareFacility, ItemStructure otherContext, Participation[] participations) : this() { Check.Require(startTime != null, "start_time must not be null"); Check.Require(setting != null, "setting must not be null"); this.startTime = startTime; this.endTime = endTime; this.setting = setting; this.location = location; this.healthCareFacility = healthCareFacility; this.otherContext = otherContext; if (this.otherContext != null) { this.otherContext.Parent = this; } if (participations != null) { this.participations = new OpenEhr.AssumedTypes.List <Participation>(participations); } SetAttributeDictionary(); this.CheckInvariants(); }
public void Remove(Item a) { int static_index_a = ItemStructure.GetIndex(a); int getA = Items.FindIndex(y => ItemStructure.GetIndex(y) == static_index_a); Items.Remove(Items[getA]); }
private static void NewMethod1(Player player, Item item, ItemStructure strucc) { var builder = new PacketBuilder(Packets.SendToClient.OpenContainer); builder.AddU8(0); // container index builder.AddU16(item.Id); // container look id? the one identifying the container builder.AddString(strucc.Name); builder.AddU8(strucc.ContainerSize); builder.AddU8(0); // root container, 1 == child container var inside = player.Equipment.Backpack.Inside; if (inside == null) { builder.AddU8(0); } else { builder.AddU8((byte)inside.Count); for (int i = 0; i < inside.Count; i++) { builder.AddItem(inside[i]); } } player.OpenContainer(player.Equipment.Backpack); builder.Send(player); }
protected Item(string name, ItemRarity rarity, string flavorText) { Name = name; this.rarity = rarity; FlavorText = flavorText; ItemStructure.Add(this); }
// Token: 0x0600049C RID: 1180 RVA: 0x000193D0 File Offset: 0x000175D0 private void UseAltWeapon(ItemStructure item, int time, Location position = null, byte useType = 1) { if (position == null) { position = this.client.Player.ClientPosition; } int num = (int)item._tYSs4Ly8XTHvXe9jwJ9dhQMMttd; num = ((num == 0) ? 500 : (num * 1000)); this._nextAltAttack = time + num; this._lastUseItem = time; UseItemPacket useItemPacket = (UseItemPacket)Packet.Create(PacketType.USEITEM); useItemPacket.SlotObject = new SlotObject { objectId = this.client.Player.ObjectId, SlotId = 1, ObjectType = this.client.Player.Inventory[1] }; useItemPacket.Time = time; useItemPacket.UseType = useType; useItemPacket.ItemUsePos = position; this.client.SendToServer(useItemPacket); if (Settings.Default.AutoAbilityNotifications) { this.client.SendToClient("AutoAbility activated!"); } }
public static void Load() { Parallel.Invoke( () => { Items = new GameDataMap <ushort, ItemStructure>(ItemStructure.Load(XDocument.Parse(RawObjectsXML))); PluginUtils.Log("GameData", "Mapped {0} items.", Items.Map.Count); }, () => { Tiles = new GameDataMap <ushort, TileStructure>(TileStructure.Load(XDocument.Parse(RawTilesXML))); PluginUtils.Log("GameData", "Mapped {0} tiles.", Tiles.Map.Count); }, () => { Objects = new GameDataMap <ushort, ObjectStructure>(ObjectStructure.Load(XDocument.Parse(RawObjectsXML))); PluginUtils.Log("GameData", "Mapped {0} objects.", Objects.Map.Count); }, () => { Packets = new GameDataMap <byte, PacketStructure>(PacketStructure.Load(XDocument.Parse(RawPacketsXML))); PluginUtils.Log("GameData", "Mapped {0} packets.", Packets.Map.Count); }, () => { const string CHAR_LIST_FILE = "char_list.xml"; XDocument charList = null; try { charList = XDocument.Load("http://realmofthemadgodhrd.appspot.com/char/list"); } catch (Exception) { } // If the char list doesn't contain an error if (charList != null && charList.Element("Error") == null) { // Make a backup of the char list charList.Save(CHAR_LIST_FILE); } // If the backup char list file exists else if (System.IO.File.Exists(CHAR_LIST_FILE)) { charList = XDocument.Load(CHAR_LIST_FILE); } // The retrieved char list contains an error and a backup char list doesn't exist else { PluginUtils.Log("GameData", "Error! Unable to retrieve server list."); return; } Servers = new GameDataMap <string, ServerStructure>(ServerStructure.Load(charList)); PluginUtils.Log("GameData", "Mapped {0} servers.", Servers.Map.Count); }); PluginUtils.Log("GameData", "Successfully loaded game data."); }
public ItemStructure ItemGen(int win_id) { ItemStructure item = new ItemStructure(); item.Name = ItemList[win_id].Name; item.Id = win_id; item.Sprite = ItemList[win_id].Sprite; item.ItemType = ItemList[win_id].ItemType; item.Description = ItemList[win_id].Description; return(item); }
public void Switch(Item a, Item b) { int static_index_a = ItemStructure.GetIndex(a); int static_index_b = ItemStructure.GetIndex(b); int getA = Items.FindIndex(y => ItemStructure.GetIndex(y) == static_index_a); int getB = Items.FindIndex(y => ItemStructure.GetIndex(y) == static_index_b); var _a_ = Items[getA]; Items[getA] = Items[getB]; Items[getB] = _a_; }
// Token: 0x0600049E RID: 1182 RVA: 0x000195BC File Offset: 0x000177BC private void Shoot(int Time) { if (this._isSafeMap) { return; } if (this.client.Player == null) { return; } int num = this.client.Player.Inventory[1]; if (num == -1) { return; } if (this.client.Player.isStunned()) { return; } if (this.client.Player.isPaused()) { return; } ItemStructure itemStructure = GameData.Items.ByID((ushort)num); if (itemStructure == null) { return; } if (itemStructure.NumProjectiles != 0) { return; } for (int i = 0; i < itemStructure.NumProjectiles; i++) { PlayerShootPacket projectile = (PlayerShootPacket)Packet.Create(PacketType.PLAYERSHOOT); projectile.Angle = 0f; projectile.Position = new Location(this.client.Player.ClientPosition.X + Math.Cos((double)projectile.Angle) * 0.3, this.client.Player.ClientPosition.Y + Math.Sin((double)projectile.Angle) * 0.3); projectile.Time = Time; projectile.BulletId = this.client.GetBulletId(); projectile.ContainerType = (short)itemStructure.ID; AllyShootPacket allyShootPacket = (AllyShootPacket)Packet.Create(PacketType.ALLYSHOOT); allyShootPacket.Angle = projectile.Angle; allyShootPacket.BulletId = projectile.BulletId; allyShootPacket.ContainerType = projectile.ContainerType; allyShootPacket.OwnerId = this.client.Player.ObjectId; this.client.SendToServer(projectile); this.client.SendToClient(allyShootPacket); } }
public AdminEntry(DvText name, string archetypeNodeId, Support.Identification.UidBasedId uid, Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit, CodePhrase language, CodePhrase encoding, PartyProxy subject, PartyProxy proider, Participation[] otherParticipations, ObjectRef workflowId, ItemStructure data) : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit, language, encoding, subject, proider, otherParticipations, workflowId) { Check.Require(data != null, "data must not be null"); this.data = data; this.data.Parent = this; SetAttributeDictionary(); this.CheckInvariants(); }
public InstructionDetails(LocatableRef instructionId, string activityId, ItemStructure wfDetails) : this() { Check.Require(instructionId != null, "instruction_id must not be null"); Check.Require(!string.IsNullOrEmpty(activityId), "activity_id must not be null or empty"); this.instructionId = instructionId; this.activityId = activityId; this.wfDetails = wfDetails; if (this.wfDetails != null) { this.wfDetails.Parent = this; } SetAttributeDictionary(); }
public Activity(DvText name, string archetypeNodeId, UidBasedId uid, Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit, ItemStructure description, DvParsable timing, string actionArchetypeId) : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit) { Check.Require(description != null, "description must not be null"); Check.Require(timing != null, "timing must not be null"); Check.Require(!string.IsNullOrEmpty(actionArchetypeId), "action_archetype_id must not be null or empty"); this.description = description; this.description.Parent = this; this.timing = timing; this.actionArchetypeId = actionArchetypeId; SetAttributeDictionary(); CheckInvariants(); }
public Evaluation(DvText name, string archetypeNodeId, UidBasedId uid, Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit, CodePhrase language, CodePhrase encoding, PartyProxy subject, PartyProxy proider, Participation[] otherParticipations, ObjectRef workflowId, ItemStructure protocol, ObjectRef guidelineId, ItemStructure data) : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit, language, encoding, subject, proider, otherParticipations, workflowId, protocol, guidelineId) { Check.Require(data != null, "data must not be null"); this.data = data; if (this.data != null) { this.data.Parent = this; } SetAttributeDictionary(); CheckInvariants(); }
public EhrStatus(ArchetypeId archetypeId, DvText name, ObjectVersionId uid, PartySelf subject, bool isQueryable, bool isModifiable, ItemStructure otherDetails) { if (uid != null) { this.Uid = uid; } this.subject = subject; this.isQueryable = isQueryable; this.isQueryableSet = true; this.isModifiable = isModifiable; this.isModifiableSet = true; this.otherDetails = otherDetails; base.SetBaseData(archetypeId.Value, name); }
// Token: 0x060004E5 RID: 1253 RVA: 0x0001C678 File Offset: 0x0001A878 public void UseItem(UseItemPacket useItem) { if (!Settings.Default.EnableFameTools) { return; } if (useItem.SlotObject.objectId != this.client.PlayerId) { return; } if (Settings.Default.FameBlockDrinking) { /*ItemStructure*/ ItemStructure itemStructure = GameData.Items.ByID((ushort)useItem.SlotObject.ObjectType); if (itemStructure != null) { if (itemStructure.Potion) { useItem.Send = false; } } } }
// Token: 0x060004AB RID: 1195 RVA: 0x0001A4B4 File Offset: 0x000186B4 private bool CheckLootTier(ushort itemId) { ItemStructure itemStructure = GameData.Items.ByID(itemId); if (itemStructure == null) { return(false); } if (Settings.Default.AutoLootHealingPotions && itemStructure.Name == "Health Potion" && (Settings.Default.AutoLootOverfillHP || client.Player.HealthpotCount < 6)) { return(true); } if (Settings.Default.AutoLootHealingPotions && itemStructure.Name == "Magic Potion" && (Settings.Default.AutoLootOverfillMP || this.client.Player.MagicpotCount < 6)) { return(true); } if (Settings.Default.AutoLootStatPotions && AutoLoot.statPotions.Contains(itemStructure.Name)) { return(true); } if (Settings.Default.AutoLootUTs && itemStructure.Tier == Tiers.UT) { if (itemStructure._nUppUQcAEeCO15B53eSIwjaZ8yK != 10) { if (itemStructure._nUppUQcAEeCO15B53eSIwjaZ8yK != 26) { return(true); } } } if (Settings.Default.AutoLootMarks && itemStructure.Name.Contains("Mark of ")) { return(true); } switch (itemStructure._nUppUQcAEeCO15B53eSIwjaZ8yK) { case 1: case 2: case 3: case 8: case 17: case 24: return((int)itemStructure.Tier >= Settings.Default.AutoLootWeaponTierThreshold); case 4: case 5: case 11: case 12: case 13: case 15: case 16: case 18: case 19: case 20: case 21: case 22: case 23: case 25: case 27: return((int)itemStructure.Tier >= Settings.Default.AutoLootAbilityTierThreshold); case 6: case 7: case 14: return((int)itemStructure.Tier >= Settings.Default.AutoLootArmorTierThreshold); case 9: return((int)itemStructure.Tier >= Settings.Default.AutoLootRingTierThreshold); } return(false); }
// Token: 0x0600052E RID: 1326 RVA: 0x0001F1D8 File Offset: 0x0001D3D8 internal void _fFWNtW4btW9NFPrxjFKOW6uqCMp(XElement item) { _66CXgP76qcRM5NMLzlNSbhfhXbG 66CXgP76qcRM5NMLzlNSbhfhXbG = new ItemStructure(item); this._Kndj0w1wpl2a6oPYP8TaQVSkPtR[66CXgP76qcRM5NMLzlNSbhfhXbG._X5iK7DxZXqEuFaG5vPlQc32oVuG] = 66CXgP76qcRM5NMLzlNSbhfhXbG;
public static void Load() { Parallel.Invoke( () => { try { Items = new GameDataMap <ushort, ItemStructure>(ItemStructure.Load(XDocument.Load("Objects.xml"))); PluginUtils.Log("GameData", "loaded items from file!"); } catch { Items = new GameDataMap <ushort, ItemStructure>(ItemStructure.Load(XDocument.Parse(RawObjectsXML))); } PluginUtils.Log("GameData", "Mapped {0} items.", Items.Map.Count); }, () => { try { Tiles = new GameDataMap <ushort, TileStructure>(TileStructure.Load(XDocument.Load("Tiles.xml"))); PluginUtils.Log("GameData", "loaded tiles from file!"); } catch { Tiles = new GameDataMap <ushort, TileStructure>(TileStructure.Load(XDocument.Parse(RawTilesXML))); } PluginUtils.Log("GameData", "Mapped {0} tiles.", Tiles.Map.Count); }, () => { try { Objects = new GameDataMap <ushort, ObjectStructure>(ObjectStructure.Load(XDocument.Load("Objects.xml"))); PluginUtils.Log("GameData", "loaded objects from file!"); } catch { Objects = new GameDataMap <ushort, ObjectStructure>(ObjectStructure.Load(XDocument.Parse(RawObjectsXML))); } PluginUtils.Log("GameData", "Mapped {0} objects.", Objects.Map.Count); }, () => { try { Packets = new GameDataMap <byte, PacketStructure>(PacketStructure.Load(XDocument.Load("Packets.xml"))); PluginUtils.Log("GameData", "loaded packets from file!"); } catch { Packets = new GameDataMap <byte, PacketStructure>(PacketStructure.Load(XDocument.Parse(RawPacketsXML))); } PluginUtils.Log("GameData", "Mapped {0} packets.", Packets.Map.Count); }, () => { const string CHAR_LIST_FILE = "char_list.xml"; XDocument charList = null; try { charList = XDocument.Load("http://realmofthemadgodhrd.appspot.com/char/list"); } catch (Exception) { } if (charList != null && charList.Element("Error") == null) { charList.Save(CHAR_LIST_FILE); } else if (System.IO.File.Exists(CHAR_LIST_FILE)) { charList = XDocument.Load(CHAR_LIST_FILE); } else { PluginUtils.Log("GameData", "Error! Unable to retrieve server list."); return; } Servers = new GameDataMap <string, ServerStructure>(ServerStructure.Load(charList)); PluginUtils.Log("GameData", "Mapped {0} servers.", Servers.Map.Count); }); PluginUtils.Log("GameData", "Successfully loaded game data."); }
public Address(string archetypeNodeId, DvText name, ItemStructure details) : base(archetypeNodeId, name, details) { }
protected Capability(string archetypeNodeId, DvText name, ItemStructure credentials) : base(archetypeNodeId, name) { Credentials = credentials; }
public Capability(string archetypeNodeId, DvText name, ItemStructure credentials) : base(archetypeNodeId, name, credentials) { }
public Instruction(DvText name, string archetypeNodeId, UidBasedId uid, Link[] links, Archetyped archetypeDetails, FeederAudit feederAudit, CodePhrase language, CodePhrase encoding, PartyProxy subject, PartyProxy proider, Participation[] otherParticipations, ObjectRef workflowId, ItemStructure protocol, ObjectRef guidelineId, DvText narrative, DvDateTime expiryTime, Activity[] activities, DvParsable wfDefinition) : base(name, archetypeNodeId, uid, links, archetypeDetails, feederAudit, language, encoding, subject, proider, otherParticipations, workflowId, protocol, guidelineId) { Check.Require(narrative != null, "narrative must not be null"); this.narrative = narrative; this.expiryTime = expiryTime; if (activities != null) { this.activities = RmFactory.LocatableList <Activity>(this, activities); } this.wfDefinition = wfDefinition; SetAttributeDictionary(); CheckInvariants(); }
protected Address(string archetypeNodeId, DvText name, ItemStructure details) : base(archetypeNodeId, name) { Details = details; }
public static void Load() { bool hadError = false; Parallel.Invoke( () => { try { Items = new GameDataMap <ushort, ItemStructure>(ItemStructure.Load(XDocument.Load("Objects.xml"))); PluginUtils.Log("GameData", "Mapped {0} items.", Items.Map.Count); } catch (Exception e) { hadError = true; PluginUtils.Log("GameData", "Error while reading Objects.xml file: {0}", e.Message); } }, () => { try { Tiles = new GameDataMap <ushort, TileStructure>(TileStructure.Load(XDocument.Load("Tiles.xml"))); PluginUtils.Log("GameData", "Mapped {0} tiles.", Tiles.Map.Count); } catch (Exception e) { hadError = true; PluginUtils.Log("GameData", "Error while reading Tiles.xml file: {0}", e.Message); } }, () => { try { Objects = new GameDataMap <ushort, ObjectStructure>(ObjectStructure.Load(XDocument.Load("Objects.xml"))); PluginUtils.Log("GameData", "Mapped {0} objects.", Objects.Map.Count); } catch (Exception e) { hadError = true; PluginUtils.Log("GameData", "Error while reading Objects.xml file: {0}", e.Message); } }, () => { try { Packets = new GameDataMap <byte, PacketStructure>(PacketStructure.Load(XDocument.Load("Packets.xml"))); PluginUtils.Log("GameData", "Mapped {0} packets.", Packets.Map.Count); } catch (Exception e) { hadError = true; PluginUtils.Log("GameData", "Error while reading Packets.xml file: {0}", e.Message); } }, () => { const string CHAR_LIST_FILE = "char_list.xml"; XDocument charList = null; try { charList = XDocument.Load("https://www.realmofthemadgod.com/char/list"); } catch (Exception e) { hadError = true; PluginUtils.Log("GameData", "Error while fetching /char/list: {0}", e.Message); } // If the char list doesn't contain an error if (charList != null && charList.Element("Error") == null) { // Make a backup of the char list charList.Save(CHAR_LIST_FILE); } // If the backup char list file exists else if (System.IO.File.Exists(CHAR_LIST_FILE)) { charList = XDocument.Load(CHAR_LIST_FILE); } // The retrieved char list contains an error and a backup char list doesn't exist else { PluginUtils.Log("GameData", "Cannot retrieve server list and no cache exists."); hadError = true; return; } Servers = new GameDataMap <string, ServerStructure>(ServerStructure.Load(charList)); PluginUtils.Log("GameData", "Mapped {0} servers.", Servers.Map.Count); }); if (hadError) { PluginUtils.Log("GameData", "One or more game data files could not be loaded."); } else { PluginUtils.Log("GameData", "Successfully loaded game data."); } }
public PartyIdentity(string archetypeNodeId, DvText name, ItemStructure details) : base(archetypeNodeId, name, details) { }