2020-08-08 19:14:34 +02:00
|
|
|
using UnityEngine;
|
2020-08-10 01:57:33 +02:00
|
|
|
using NeonTea.Quakeball.Game;
|
2020-08-08 19:14:34 +02:00
|
|
|
using NeonTea.Quakeball.TeaNet.Packets;
|
|
|
|
|
|
|
|
namespace NeonTea.Quakeball.Networking.Packets {
|
|
|
|
|
|
|
|
public class SelfIdentPckt : Packet {
|
|
|
|
public ulong PlayerId;
|
2020-08-10 01:57:33 +02:00
|
|
|
public Team Team;
|
|
|
|
|
|
|
|
public SelfIdentPckt() { }
|
|
|
|
public SelfIdentPckt(ulong id, Team team) {
|
|
|
|
PlayerId = id;
|
|
|
|
Team = team;
|
|
|
|
}
|
2020-08-08 19:14:34 +02:00
|
|
|
|
|
|
|
public override void Read(ByteBuffer buffer) {
|
|
|
|
PlayerId = buffer.ReadULong();
|
2020-08-10 01:57:33 +02:00
|
|
|
Team = (Team)buffer.Read();
|
2020-08-08 19:14:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public override void Write(ByteBuffer buffer) {
|
|
|
|
buffer.Write(PlayerId);
|
2020-08-10 01:57:33 +02:00
|
|
|
buffer.Write((byte)Team);
|
2020-08-08 19:14:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public class NicknamePckt : Packet {
|
|
|
|
public ulong PlayerId;
|
|
|
|
public string Nick;
|
|
|
|
|
|
|
|
public NicknamePckt() { }
|
|
|
|
public NicknamePckt(string nick, ulong id = 0) {
|
|
|
|
Nick = nick;
|
|
|
|
PlayerId = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Read(ByteBuffer buffer) {
|
|
|
|
PlayerId = buffer.ReadULong();
|
|
|
|
Nick = buffer.ReadString();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Write(ByteBuffer buffer) {
|
|
|
|
buffer.Write(PlayerId);
|
|
|
|
buffer.Write(Nick);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|