private static bool IsPlayerUpdateBlock(ObjectUpdateBlock u) { if (u.UpdateType == ObjectUpdateType.UPDATETYPE_CREATE_OBJECT) { return(((ObjectUpdateCreateObject1Block)u).CreationData.CreationObjectType == ObjectType.Player); } else if (u.UpdateType == ObjectUpdateType.UPDATETYPE_CREATE_OBJECT2) { return(((ObjectUpdateCreateObject2Block)u).CreationData.CreationObjectType == ObjectType.Player); } return(false); }
/// <inheritdoc /> public UpdateBlockCollection Convert(UpdateBlockCollection_Vanilla fromObject) { if (fromObject == null) { return(null); } //This is complicated. We need to transform the vanilla version to the wotlk version. ObjectUpdateBlock[] wotlkUpdateBlocks = new ObjectUpdateBlock[fromObject.Items.Count]; for (int i = 0; i < fromObject.Items.Count; i++) { wotlkUpdateBlocks[i] = ObjectBlockConverter.Convert(fromObject.Items.ElementAt(i)); } //TODO: When we are sure we won't have nulls anymore we should remove the where. return(new UpdateBlockCollection(wotlkUpdateBlocks .Where(b => b != null) .ToArray())); }
public override void Write(ObjectUpdateBlock value, Span <byte> buffer, ref int offset) { ObjectUpdateValuesObjectBlock_AutoGeneratedTemplateSerializerStrategy.Instance.InternalWrite(this, buffer, ref offset); }
public override void Write(ObjectUpdateBlock value, Span <byte> buffer, ref int offset) { ObjectUpdateCreateObject1Block_Serializer.Instance.InternalWrite(this, buffer, ref offset); }