39 lines
948 B
C#
39 lines
948 B
C#
|
using UnityEngine;
|
||
|
using NeonTea.Quakeball.TeaNet.Packets;
|
||
|
|
||
|
namespace NeonTea.Quakeball.Networking.Packets {
|
||
|
|
||
|
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);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|