Power - spotřebovává se když jsou zavřené dveře. Hráči mohou zavírat pouze dveře na svojí polovině mapy. Oprava bugu v MovementOpportunity, který způsoboval zpožďování intervalu.

This commit is contained in:
Perry 2026-03-12 22:33:35 +01:00
parent 7656707177
commit 25a62af483
22 changed files with 240 additions and 59 deletions

View file

@ -3,7 +3,7 @@ using LiteNetLib.Utils;
namespace PacketLib;
public struct PlayerState : INetSerializable { // TODO: separate mutable and immutable data
public struct PlayerState : INetSerializable { // TODO: make a constructor
public int pid;
public int camera;
public bool monitorUp;
@ -12,6 +12,9 @@ public struct PlayerState : INetSerializable { // TODO: separate mutable and imm
public bool[] doorStates;
public int[] neighbouringTiles; // the indexes should correspond in both arrays
public int power;
public bool poweredOut;
public void Serialize(NetDataWriter writer) {
writer.Put(pid);
writer.Put(camera);
@ -19,6 +22,8 @@ public struct PlayerState : INetSerializable { // TODO: separate mutable and imm
writer.PutArray(doorStates);
writer.Put(officeTileId);
writer.PutArray(neighbouringTiles);
writer.Put(power);
writer.Put(poweredOut);
}
public void Deserialize(NetDataReader reader) {
@ -28,6 +33,8 @@ public struct PlayerState : INetSerializable { // TODO: separate mutable and imm
doorStates = reader.GetBoolArray();
officeTileId = reader.GetInt();
neighbouringTiles = reader.GetIntArray();
power = reader.GetInt();
poweredOut = reader.GetBool();
}
}