Funkční komunikace mezi jedním clientem a serverem
This commit is contained in:
commit
3f235f6e04
44 changed files with 1030 additions and 0 deletions
29
PacketLib/PlayerState.cs
Normal file
29
PacketLib/PlayerState.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using LiteNetLib;
|
||||
using LiteNetLib.Utils;
|
||||
|
||||
namespace PacketLib;
|
||||
|
||||
public struct PlayerState : INetSerializable {
|
||||
public uint pid;
|
||||
public int camera;
|
||||
public bool monitorUp;
|
||||
|
||||
public void Serialize(NetDataWriter writer) {
|
||||
writer.Put(pid);
|
||||
writer.Put(camera);
|
||||
writer.Put(monitorUp);
|
||||
}
|
||||
|
||||
public void Deserialize(NetDataReader reader) {
|
||||
pid = reader.GetUInt();
|
||||
camera = reader.GetInt();
|
||||
monitorUp = reader.GetBool();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue