2020-08-07 03:46:09 +02:00
|
|
|
using UnityEngine;
|
|
|
|
using NeonTea.Quakeball.TeaNet.Packets;
|
|
|
|
|
2020-08-07 20:20:13 +02:00
|
|
|
namespace NeonTea.Quakeball.Networking.Packets {
|
2020-08-07 03:46:09 +02:00
|
|
|
public class SpawnPckt : Packet {
|
|
|
|
|
|
|
|
public ulong PlayerId;
|
|
|
|
public Vector3 Location;
|
2020-08-08 08:50:37 +02:00
|
|
|
public bool IsInitial;
|
|
|
|
|
2020-08-08 08:57:59 +02:00
|
|
|
public SpawnPckt() { }
|
|
|
|
|
2020-08-08 08:50:37 +02:00
|
|
|
public SpawnPckt(Vector3 location, ulong id = 0, bool isinitial = true) {
|
|
|
|
PlayerId = id;
|
|
|
|
Location = location;
|
|
|
|
IsInitial = isinitial;
|
|
|
|
}
|
2020-08-07 03:46:09 +02:00
|
|
|
|
|
|
|
public override void Read(ByteBuffer buffer) {
|
2020-08-08 08:57:59 +02:00
|
|
|
Location = buffer.ReadVector3();
|
2020-08-07 03:46:09 +02:00
|
|
|
PlayerId = buffer.ReadULong();
|
2020-08-08 08:50:37 +02:00
|
|
|
IsInitial = buffer.ReadBool();
|
2020-08-07 03:46:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public override void Write(ByteBuffer buffer) {
|
2020-08-08 08:57:59 +02:00
|
|
|
buffer.Write(Location);
|
2020-08-07 03:46:09 +02:00
|
|
|
buffer.Write(PlayerId);
|
2020-08-08 08:50:37 +02:00
|
|
|
buffer.Write(IsInitial);
|
2020-08-07 03:46:09 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public class SelfIdentPckt : Packet {
|
|
|
|
|
|
|
|
public ulong PlayerId;
|
|
|
|
|
|
|
|
public override void Read(ByteBuffer buffer) {
|
|
|
|
PlayerId = buffer.ReadULong();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Write(ByteBuffer buffer) {
|
|
|
|
buffer.Write(PlayerId);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|