2025-12-19 17:54:50 +01:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
|
using LiteNetLib.Utils;
|
|
|
|
|
|
|
|
|
|
namespace PacketLib;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
public struct GameEvent : INetSerializable{
|
|
|
|
|
public static GameEvent PLAYER_JOIN(int pid) => new(){ID = 0, Args = [pid] };
|
|
|
|
|
public static GameEvent PLAYER_LEAVE(int pid) => new(){ID = 1, Args = [pid] };
|
2026-02-21 18:42:44 +01:00
|
|
|
public static GameEvent SWITCH_CAM(int pid, int id) => new(){ID = 2, Args = [pid, id] };
|
2025-12-19 17:54:50 +01:00
|
|
|
public static GameEvent TOGGLE_MONITOR(int pid, bool state) => new(){ID = 3, Args = [pid, state ? 1 : 0]};
|
2026-01-25 11:16:54 +01:00
|
|
|
public static GameEvent TOGGLE_DOOR_OFFICE(int pid, int doorId, bool state) => new(){ID = 4, Args = [pid, doorId, state ? 1 : 0]};
|
2026-02-21 18:42:44 +01:00
|
|
|
public static GameEvent TOGGLE_DOOR_REMOTE(int pid, (int, int) doorId, bool state) => new(){ID = 5, Args = [pid, doorId.Item1, doorId.Item2, state ? 1 : 0]};
|
|
|
|
|
|
2026-01-25 11:16:54 +01:00
|
|
|
|
|
|
|
|
|
2025-12-19 17:54:50 +01:00
|
|
|
|
|
|
|
|
public static GameEvent ENEMY_MOVEMENT(int enemyId, int camId) => new(){ID = -1, Args = [enemyId, camId]};
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|