public static int EncodeHeader(System.IO.Stream buffer, PacketTypes type, Flags1 flags1, Flags2 flags2, Encodings encoding, UInt16 serial_high_low, Guid object_id, Guid interface_id, Guid activity_id, UInt32 server_boot_time, UInt32 sequence_no, Operations op, UInt16 body_length, UInt16 fragment_no, out long body_length_position) { int ret = 0; ret += DCP.EncodeU8(buffer, 4); //RPCVersion ret += DCP.EncodeU8(buffer, (byte)type); ret += DCP.EncodeU8(buffer, (byte)flags1); ret += DCP.EncodeU8(buffer, (byte)flags2); ret += DCP.EncodeU16(buffer, (ushort)encoding); ret += DCP.EncodeU8(buffer, 0); //pad ret += DCP.EncodeU8(buffer, (byte)(serial_high_low >> 8)); ret += EncodeGuid(buffer, encoding, object_id); ret += EncodeGuid(buffer, encoding, interface_id); ret += EncodeGuid(buffer, encoding, activity_id); ret += EncodeU32(buffer, encoding, server_boot_time); ret += EncodeU32(buffer, encoding, 1); //interface version ret += EncodeU32(buffer, encoding, sequence_no); ret += EncodeU16(buffer, encoding, (ushort)op); ret += EncodeU16(buffer, encoding, 0xFFFF); //interface hint ret += EncodeU16(buffer, encoding, 0xFFFF); //activity hint body_length_position = buffer.Position; ret += EncodeU16(buffer, encoding, body_length); ret += EncodeU16(buffer, encoding, fragment_no); ret += DCP.EncodeU8(buffer, 0); //authentication protocol ret += DCP.EncodeU8(buffer, (byte)(serial_high_low & 0xFF)); return(ret); }
public void SetLeftTriggerState(DualSenseTriggerState state) { flags1 |= Flags1.LeftTrigger; fixed(byte *p = leftTriggerParams) { SetTriggerState(state, ref leftTriggerMode, p); } }
public void SetRightTriggerState(DualSenseTriggerState state) { flags1 |= Flags1.RightTrigger; fixed(byte *p = rightTriggerParams) { SetTriggerState(state, ref rightTriggerMode, p); } }
/// <summary> /// Constructor /// </summary> public FormatterOptions() { flags1 = Flags1.UppercaseHex | Flags1.SmallHexNumbersInDecimal | Flags1.AddLeadingZeroToHexNumbers | Flags1.BranchLeadingZeros | Flags1.SignedMemoryDisplacements | Flags1.ShowBranchSize | Flags1.UsePseudoOps | Flags1.MasmAddDsPrefix32 | Flags1.MasmSymbolDisplInBrackets | Flags1.MasmDisplInBrackets; flags2 = Flags2.None; }
public ConstructorParameterInfo(string propertyName, string propertyType, string expression, string description, Flags1 checkingFlags = Flags1.None, Action <CsProperty> propertyCreated = null) { PropertyName = propertyName; PropertyType = propertyType; Expression = expression ?? GetExpr(propertyName, propertyType); Description = description; CheckingFlags = checkingFlags; PropertyCreated = propertyCreated; }
public void ResetMotorSpeeds(bool resetImmediately = false) { if (resetImmediately) { flags1 &= ~(Flags1.MainMotors1 | Flags1.MainMotors2); } else { flags1 &= ~Flags1.MainMotors2; } }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Flags1", true, out subEle); subEle.Value = Flags1.ToString(); ele.TryPathTo("Flags2", true, out subEle); subEle.Value = Flags2.ToString(); WriteUnusedXML(ele, master); }
public static ArgChecking ConvertToArgChecking(this Flags1 flags) { var r = ArgChecking.None; if ((flags & Flags1.NotNull) != 0) { r |= ArgChecking.NotNull; } if ((flags & Flags1.NotEmpty) != 0) { r |= ArgChecking.NotEmpty; } if ((flags & Flags1.NotWhitespace) != 0) { r |= ArgChecking.NotWhitespace; } if ((flags & Flags1.TrimValue) != 0) { r |= ArgChecking.TrimValue; } return(r); }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("AnimationType", true, out subEle); subEle.Value = AnimationType.ToString(); ele.TryPathTo("AnimationMultiplier", true, out subEle); subEle.Value = AnimationMultiplier.ToString("G15"); ele.TryPathTo("Reach", true, out subEle); subEle.Value = Reach.ToString("G15"); ele.TryPathTo("Flags1", true, out subEle); subEle.Value = Flags1.ToString(); ele.TryPathTo("GripAnimation", true, out subEle); subEle.Value = GripAnimation.ToString(); ele.TryPathTo("AmmoUse", true, out subEle); subEle.Value = AmmoUse.ToString(); ele.TryPathTo("ReloadAnimation", true, out subEle); subEle.Value = ReloadAnimation.ToString(); ele.TryPathTo("MinSpread", true, out subEle); subEle.Value = MinSpread.ToString("G15"); ele.TryPathTo("Spread", true, out subEle); subEle.Value = Spread.ToString("G15"); ele.TryPathTo("Unknown", true, out subEle); subEle.Value = Unknown.ToHex(); ele.TryPathTo("SightFOV", true, out subEle); subEle.Value = SightFOV.ToString("G15"); ele.TryPathTo("Unknown2", true, out subEle); subEle.Value = Unknown2.ToString("G15"); ele.TryPathTo("Projectile", true, out subEle); Projectile.WriteXML(subEle, master); ele.TryPathTo("BaseVATSToHitChance", true, out subEle); subEle.Value = BaseVATSToHitChance.ToString(); ele.TryPathTo("AttackAnimation", true, out subEle); subEle.Value = AttackAnimation.ToString(); ele.TryPathTo("ProjectileCount", true, out subEle); subEle.Value = ProjectileCount.ToString(); ele.TryPathTo("EmbeddedWeaponActorValue", true, out subEle); subEle.Value = EmbeddedWeaponActorValue.ToString(); ele.TryPathTo("Range/Min", true, out subEle); subEle.Value = MinRange.ToString("G15"); ele.TryPathTo("Range/Max", true, out subEle); subEle.Value = MaxRange.ToString("G15"); ele.TryPathTo("LimbKillBehavior", true, out subEle); subEle.Value = LimbKillBehavior.ToString(); ele.TryPathTo("Flags2", true, out subEle); subEle.Value = Flags2.ToString(); ele.TryPathTo("AttackAnimationMultiplier", true, out subEle); subEle.Value = AttackAnimationMultiplier.ToString("G15"); ele.TryPathTo("FireRate", true, out subEle); subEle.Value = FireRate.ToString("G15"); ele.TryPathTo("ActionPointCost", true, out subEle); subEle.Value = ActionPointCost.ToString("G15"); ele.TryPathTo("Rumble/LeftMotorStrength", true, out subEle); subEle.Value = RumbleLeftMotorStrength.ToString("G15"); ele.TryPathTo("Rumble/RightMotorStrength", true, out subEle); subEle.Value = RumbleRightMotorStrength.ToString("G15"); ele.TryPathTo("Rumble/Duration", true, out subEle); subEle.Value = RumbleDuration.ToString("G15"); ele.TryPathTo("DamageToWeaponMult", true, out subEle); subEle.Value = DamageToWeaponMult.ToString("G15"); ele.TryPathTo("AttackShotsPerSecond", true, out subEle); subEle.Value = AttackShotsPerSecond.ToString("G15"); ele.TryPathTo("ReloadTime", true, out subEle); subEle.Value = ReloadTime.ToString("G15"); ele.TryPathTo("JamTime", true, out subEle); subEle.Value = JamTime.ToString("G15"); ele.TryPathTo("AimArc", true, out subEle); subEle.Value = AimArc.ToString("G15"); ele.TryPathTo("Skill", true, out subEle); subEle.Value = Skill.ToString(); ele.TryPathTo("Rumble/Pattern", true, out subEle); subEle.Value = RumblePattern.ToString(); ele.TryPathTo("Rumble/Wavelength", true, out subEle); subEle.Value = RumbleWavelength.ToString("G15"); ele.TryPathTo("LimbDamageMult", true, out subEle); subEle.Value = LimbDamageMult.ToString("G15"); ele.TryPathTo("ResistanceType", true, out subEle); subEle.Value = ResistanceType.ToString(); ele.TryPathTo("SightUsage", true, out subEle); subEle.Value = SightUsage.ToString("G15"); ele.TryPathTo("SemiAutomaticFireDelay/Min", true, out subEle); subEle.Value = SemiAutomaticFireDelayMin.ToString("G15"); ele.TryPathTo("SemiAutomaticFireDelay/Max", true, out subEle); subEle.Value = SemiAutomaticFireDelayMax.ToString("G15"); ele.TryPathTo("Unknown3", true, out subEle); subEle.Value = Unknown3.ToString("G15"); ele.TryPathTo("Mods/Mod1/Effect", true, out subEle); subEle.Value = Mod1Effect.ToString(); ele.TryPathTo("Mods/Mod2/Effect", true, out subEle); subEle.Value = Mod2Effect.ToString(); ele.TryPathTo("Mods/Mod3/Effect", true, out subEle); subEle.Value = Mod3Effect.ToString(); ele.TryPathTo("Mods/Mod1/ValueA", true, out subEle); subEle.Value = Mod1ValueA.ToString("G15"); ele.TryPathTo("Mods/Mod2/ValueA", true, out subEle); subEle.Value = Mod2ValueA.ToString("G15"); ele.TryPathTo("Mods/Mod3/ValueA", true, out subEle); subEle.Value = Mod3ValueA.ToString("G15"); ele.TryPathTo("PowerAttackAnimation", true, out subEle); subEle.Value = PowerAttackAnimation.ToString(); ele.TryPathTo("StrengthRequirement", true, out subEle); subEle.Value = StrengthRequirement.ToString(); ele.TryPathTo("Unknown4", true, out subEle); subEle.Value = Unknown4.ToString(); ele.TryPathTo("Mods/Mod1/ReloadAnimation", true, out subEle); subEle.Value = Mod1ReloadAnimation.ToString(); ele.TryPathTo("Unknown5", true, out subEle); subEle.Value = Unknown5.ToHex(); ele.TryPathTo("AmmoRegenRate", true, out subEle); subEle.Value = AmmoRegenRate.ToString("G15"); ele.TryPathTo("KillImpulse", true, out subEle); subEle.Value = KillImpulse.ToString("G15"); ele.TryPathTo("Mods/Mod1/ValueB", true, out subEle); subEle.Value = Mod1ValueB.ToString("G15"); ele.TryPathTo("Mods/Mod2/ValueB", true, out subEle); subEle.Value = Mod2ValueB.ToString("G15"); ele.TryPathTo("Mods/Mod3/ValueB", true, out subEle); subEle.Value = Mod3ValueB.ToString("G15"); ele.TryPathTo("ImpulseDistance", true, out subEle); subEle.Value = ImpulseDistance.ToString("G15"); ele.TryPathTo("SkillRequirement", true, out subEle); subEle.Value = SkillRequirement.ToString(); }
public void SetMotorSpeeds(float lowFreq, float highFreq) { flags1 |= Flags1.MainMotors1 | Flags1.MainMotors2; lowFrequencyMotorSpeed = (byte)Mathf.Clamp(lowFreq * 255, 0, 255); highFrequencyMotorSpeed = (byte)Mathf.Clamp(highFreq * 255, 0, 255); }
public static int DecodeHeader(System.IO.Stream buffer, out PacketTypes type, out Flags1 flags1, out Flags2 flags2, out Encodings encoding, out UInt16 serial_high_low, out Guid object_id, out Guid interface_id, out Guid activity_id, out UInt32 server_boot_time, out UInt32 sequence_no, out Operations op, out UInt16 body_length, out UInt16 fragment_no) { int ret = 0; byte tmp1; UInt16 tmp2; UInt32 tmp3; serial_high_low = 0; ret += DCP.DecodeU8(buffer, out tmp1); //RPCVersion if (tmp1 != 4) { throw new Exception("Wrong protocol"); } ret += DCP.DecodeU8(buffer, out tmp1); type = (PacketTypes)tmp1; ret += DCP.DecodeU8(buffer, out tmp1); flags1 = (Flags1)tmp1; ret += DCP.DecodeU8(buffer, out tmp1); flags2 = (Flags2)tmp1; ret += DCP.DecodeU16(buffer, out tmp2); encoding = (Encodings)tmp2; ret += DCP.DecodeU8(buffer, out tmp1); //pad ret += DCP.DecodeU8(buffer, out tmp1); serial_high_low |= (UInt16)(tmp1 << 8); ret += DecodeGuid(buffer, encoding, out object_id); ret += DecodeGuid(buffer, encoding, out interface_id); ret += DecodeGuid(buffer, encoding, out activity_id); ret += DecodeU32(buffer, encoding, out server_boot_time); ret += DecodeU32(buffer, encoding, out tmp3); //interface version if ((tmp3 & 0xFFFF) != 1) { throw new Exception("Wrong protocol version"); } ret += DecodeU32(buffer, encoding, out sequence_no); ret += DecodeU16(buffer, encoding, out tmp2); op = (Operations)tmp2; ret += DecodeU16(buffer, encoding, out tmp2); //interface hint ret += DecodeU16(buffer, encoding, out tmp2); //activity hint ret += DecodeU16(buffer, encoding, out body_length); ret += DecodeU16(buffer, encoding, out fragment_no); ret += DCP.DecodeU8(buffer, out tmp1); //authentication protocol ret += DCP.DecodeU8(buffer, out tmp1); serial_high_low |= tmp1; return(ret); }
public override string ToString() { return(IndexID.ToString() + ", " + IndexCount.ToString() + ", " + Flags1.ToString() + ", " + Flags2.ToString() + ", " + Flags3.ToString()); }
public override string ToString() { return(SectorID1.ToString() + ", " + SectorID2.ToString() + ", " + PolyID1.ToString() + ", " + PolyID2.ToString() + ", " + Flags1.ToString() + ", " + Flags2.ToString()); }
public override string ToString() { return ($"{int.Parse( Convert.ToString( RawValue, 2 ), CultureInfo.InvariantCulture ):0000 0000} [PublisherID Type: {PublisherIdType.ToString()}, {Flags1.ToString()}]"); }
public override int GetHashCode() { return(Flags1.GetHashCode()); }