2025-12-19 17:54:50 +01:00
|
|
|
|
using LiteNetLib;
|
|
|
|
|
|
using LiteNetLib.Utils;
|
|
|
|
|
|
|
|
|
|
|
|
namespace PacketLib;
|
|
|
|
|
|
|
|
|
|
|
|
public struct PlayerState : INetSerializable {
|
2026-01-25 11:16:54 +01:00
|
|
|
|
public int pid;
|
2025-12-19 17:54:50 +01:00
|
|
|
|
public int camera;
|
|
|
|
|
|
public bool monitorUp;
|
|
|
|
|
|
|
2026-01-25 11:16:54 +01:00
|
|
|
|
public bool[] doorStates;
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-12-19 17:54:50 +01:00
|
|
|
|
public void Serialize(NetDataWriter writer) {
|
|
|
|
|
|
writer.Put(pid);
|
|
|
|
|
|
writer.Put(camera);
|
|
|
|
|
|
writer.Put(monitorUp);
|
2026-01-25 11:16:54 +01:00
|
|
|
|
writer.PutArray(doorStates);
|
2025-12-19 17:54:50 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Deserialize(NetDataReader reader) {
|
2026-01-25 11:16:54 +01:00
|
|
|
|
pid = reader.GetInt();
|
2025-12-19 17:54:50 +01:00
|
|
|
|
camera = reader.GetInt();
|
|
|
|
|
|
monitorUp = reader.GetBool();
|
2026-01-25 11:16:54 +01:00
|
|
|
|
doorStates = reader.GetBoolArray();
|
2025-12-19 17:54:50 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|