/// <summary> /// Reads a value from the packet /// </summary> /// <returns>value</returns> public bool ReadBool() { bool res = ByteManipulator.ReadBoolean(Data, CurrentSeek); CurrentSeek += sizeof(bool); return(res); }
public void TestListBoolReadRedLight() { List <byte> arr = new List <byte>(sizeof(bool)); for (int i = 0; i < sizeof(bool); i++) { arr.Add(0); } ByteManipulator.Write(arr, 0, false); Assert.That(ByteManipulator.ReadBoolean(arr, 0), Is.Not.True); }
public void TestSendToAllOthersCorrectPayloadData3RedLight() { BytePacket p = new BytePacket(10); p.Write(750); p.Write((ushort)110); p.Write((sbyte)-5); p.Write(false); p.Write((short)short.MinValue); p.CurrentSeek = 0; transport.SendToAll(p, new VoicePacketInfo(), new List <ulong>() { 1 }); Assert.That(ByteManipulator.ReadBoolean(workflow.receivedData, 11), Is.Not.True); }
public void TestBoolReadRedLight() { byte[] arr = new byte[sizeof(bool)]; ByteManipulator.Write(arr, 0, false); Assert.That(ByteManipulator.ReadBoolean(arr, 0), Is.Not.True); }
private void ReceivePacketMuteMsgCommand(byte[] data, uint dataLength, CSteamID sender) { if (dataLength < sizeof(bool)) return; Workflow.ProcessIsMutedMessage(ByteManipulator.ReadBoolean(data, 0), sender.m_SteamID); }