2022-05-29 18:16:32 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
using Lidgren.Network;
|
|
|
|
|
|
|
|
|
|
namespace RageCoop.Core
|
|
|
|
|
{
|
2022-07-01 14:39:43 +08:00
|
|
|
|
internal partial class Packets
|
2022-05-29 18:16:32 +08:00
|
|
|
|
{
|
2022-07-01 14:39:43 +08:00
|
|
|
|
internal class NozzleTransform : Packet
|
2022-05-29 18:16:32 +08:00
|
|
|
|
{
|
2022-08-06 10:43:24 +08:00
|
|
|
|
public override PacketType Type { get { return PacketType.NozzleTransform; } }
|
2022-05-29 18:16:32 +08:00
|
|
|
|
public int VehicleID { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool Hover { get; set; }
|
|
|
|
|
|
2022-08-06 10:43:24 +08:00
|
|
|
|
public override byte[] Serialize()
|
2022-05-29 18:16:32 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
List<byte> byteArray = new List<byte>();
|
|
|
|
|
|
|
|
|
|
byteArray.AddInt(VehicleID);
|
|
|
|
|
if (Hover) { byteArray.Add(1); }
|
|
|
|
|
|
2022-08-06 10:43:24 +08:00
|
|
|
|
return byteArray.ToArray();
|
2022-05-29 18:16:32 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-06 10:43:24 +08:00
|
|
|
|
public override void Deserialize(byte[] array)
|
2022-05-29 18:16:32 +08:00
|
|
|
|
{
|
|
|
|
|
#region NetIncomingMessageToPacket
|
|
|
|
|
BitReader reader = new BitReader(array);
|
|
|
|
|
VehicleID=reader.ReadInt();
|
|
|
|
|
Hover=reader.CanRead(1);
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|