Na začátku hry se mapa na serveru synchronizuje s mapou u clienta. Rozšířen spritesheet monitoru o remote dveře. Přidána GlobalClassLib pro kód sdílený mezi clientem a serverem. Základ pro implementaci ovládání remote dveří.

This commit is contained in:
Perry 2026-02-14 14:35:29 +01:00
parent 8801a7c919
commit 7e6b3d724b
25 changed files with 374 additions and 67 deletions

View file

@ -0,0 +1,6 @@
namespace PacketLib;
public class MapInitPacket {
public int[] Connectors { get; set; } // triplets (tile1 id, tile2 id, type)
}

View file

@ -9,4 +9,5 @@ public static class NetDataWriterExtensions {
gevent.Deserialize(reader);
return gevent;
}
}

View file

@ -10,4 +10,8 @@
<PackageReference Include="LiteNetLib" Version="1.3.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GlobalClassLib\GlobalClassLib.csproj" />
</ItemGroup>
</Project>

View file

@ -1,3 +1,4 @@
using GlobalClassLib;
using LiteNetLib.Utils;
namespace PacketLib;
@ -5,7 +6,8 @@ namespace PacketLib;
public struct PlayerCommand : INetSerializable {
public static PlayerCommand SWITCH_CAM(int idx, int idy) => new(){ID = 0, Args = [idx, idy] };
public static PlayerCommand TOGGLE_MONITOR() => new(){ID = 1, Args = []};
public static PlayerCommand TOGGLE_DOOR_OFFICE(int doorId) => new(){ID = 2, Args = [doorId]};
public static PlayerCommand TOGGLE_DOOR_OFFICE(Direction direction) => new(){ID = 2, Args = [(int)direction]};
public static PlayerCommand TOGGLE_DOOR_REMOTE(int remoteDoorId) => new(){ID = 3, Args = [remoteDoorId]};
public int ID{ get; set; }
public bool Hideable => ID < 0;
public int[] Args{ get; private set; }