2022-09-08 12:41:56 -07:00
|
|
|
|
using GTA.Math;
|
2022-05-22 15:55:26 +08:00
|
|
|
|
using Lidgren.Network;
|
|
|
|
|
|
|
|
|
|
namespace RageCoop.Core
|
|
|
|
|
{
|
2022-07-01 14:39:43 +08:00
|
|
|
|
internal partial class Packets
|
2022-05-22 15:55:26 +08:00
|
|
|
|
{
|
2022-07-01 14:39:43 +08:00
|
|
|
|
internal class BulletShot : Packet
|
2022-05-22 15:55:26 +08:00
|
|
|
|
{
|
2022-09-08 12:41:56 -07:00
|
|
|
|
public override PacketType Type => PacketType.BulletShot;
|
2022-05-22 15:55:26 +08:00
|
|
|
|
public int OwnerID { get; set; }
|
|
|
|
|
|
|
|
|
|
public uint WeaponHash { get; set; }
|
2022-12-04 19:34:54 +08:00
|
|
|
|
|
2022-05-30 14:32:38 +08:00
|
|
|
|
public Vector3 EndPosition { get; set; }
|
2022-05-22 15:55:26 +08:00
|
|
|
|
|
2022-09-08 12:37:06 -07:00
|
|
|
|
protected override void Serialize(NetOutgoingMessage m)
|
2022-05-22 15:55:26 +08:00
|
|
|
|
{
|
|
|
|
|
// Write OwnerID
|
2022-09-08 12:37:06 -07:00
|
|
|
|
m.Write(OwnerID);
|
2022-05-22 15:55:26 +08:00
|
|
|
|
|
|
|
|
|
// Write weapon hash
|
2022-09-08 12:37:06 -07:00
|
|
|
|
m.Write(WeaponHash);
|
2022-05-22 15:55:26 +08:00
|
|
|
|
|
|
|
|
|
// Write EndPosition
|
2022-09-08 12:37:06 -07:00
|
|
|
|
m.Write(EndPosition);
|
2022-05-22 15:55:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-08 12:37:06 -07:00
|
|
|
|
public override void Deserialize(NetIncomingMessage m)
|
2022-05-22 15:55:26 +08:00
|
|
|
|
{
|
|
|
|
|
#region NetIncomingMessageToPacket
|
2022-09-08 12:37:06 -07:00
|
|
|
|
|
2022-05-22 15:55:26 +08:00
|
|
|
|
// Read OwnerID
|
2022-09-08 12:41:56 -07:00
|
|
|
|
OwnerID = m.ReadInt32();
|
2022-05-22 15:55:26 +08:00
|
|
|
|
|
2022-12-04 19:34:54 +08:00
|
|
|
|
// Read WeaponHash
|
2022-09-08 12:41:56 -07:00
|
|
|
|
WeaponHash = m.ReadUInt32();
|
2022-05-22 15:55:26 +08:00
|
|
|
|
|
|
|
|
|
// Read EndPosition
|
2022-09-08 12:41:56 -07:00
|
|
|
|
EndPosition = m.ReadVector3();
|
2022-10-23 19:02:39 +08:00
|
|
|
|
|
2022-05-22 15:55:26 +08:00
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-23 19:02:39 +08:00
|
|
|
|
}
|