2026-02-14 14:35:29 +01:00
|
|
|
using GlobalClassLib;
|
2025-12-19 17:54:50 +01:00
|
|
|
using LiteNetLib.Utils;
|
|
|
|
|
|
|
|
|
|
namespace PacketLib;
|
|
|
|
|
|
|
|
|
|
public struct PlayerCommand : INetSerializable {
|
2026-02-21 18:42:44 +01:00
|
|
|
public static PlayerCommand SWITCH_CAM(int id) => new(){ID = 0, Args = [id] };
|
|
|
|
|
public static PlayerCommand SET_MONITOR(bool state) => new(){ID = 1, Args = [state ? 1 : 0]};
|
|
|
|
|
public static PlayerCommand SET_DOOR_OFFICE(Direction direction, bool state) => new(){ID = 2, Args = [(int)direction, state ? 1 : 0]};
|
|
|
|
|
public static PlayerCommand SET_DOOR_REMOTE((int, int) remoteDoorId, bool state) => new(){ID = 3, Args = [remoteDoorId.Item1, remoteDoorId.Item2, state ? 1 : 0]};
|
2025-12-19 17:54:50 +01:00
|
|
|
public int ID{ get; set; }
|
|
|
|
|
public bool Hideable => ID < 0;
|
|
|
|
|
public int[] Args{ get; private set; }
|
|
|
|
|
|
|
|
|
|
public void Serialize(NetDataWriter writer) {
|
|
|
|
|
writer.Put(ID);
|
|
|
|
|
writer.PutArray(Args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Deserialize(NetDataReader reader) {
|
|
|
|
|
ID = reader.GetInt();
|
|
|
|
|
Args = reader.GetIntArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|