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:
parent
8801a7c919
commit
7e6b3d724b
25 changed files with 374 additions and 67 deletions
6
PacketLib/MapInitPacket.cs
Normal file
6
PacketLib/MapInitPacket.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
namespace PacketLib;
|
||||
|
||||
public class MapInitPacket {
|
||||
public int[] Connectors { get; set; } // triplets (tile1 id, tile2 id, type)
|
||||
|
||||
}
|
||||
|
|
@ -9,4 +9,5 @@ public static class NetDataWriterExtensions {
|
|||
gevent.Deserialize(reader);
|
||||
return gevent;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -10,4 +10,8 @@
|
|||
<PackageReference Include="LiteNetLib" Version="1.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\GlobalClassLib\GlobalClassLib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue