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;
|
|
|
|
|
|
|
|
public override void Read(ByteBuffer buffer) {
|
|
|
|
float x = buffer.ReadFloat();
|
|
|
|
float y = buffer.ReadFloat();
|
|
|
|
float z = buffer.ReadFloat();
|
|
|
|
Location = new Vector3(x, y, z);
|
|
|
|
PlayerId = buffer.ReadULong();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Write(ByteBuffer buffer) {
|
|
|
|
buffer.Write(Location.x);
|
|
|
|
buffer.Write(Location.y);
|
|
|
|
buffer.Write(Location.z);
|
|
|
|
buffer.Write(PlayerId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|