Funkční komunikace mezi jedním clientem a serverem
This commit is contained in:
commit
3f235f6e04
44 changed files with 1030 additions and 0 deletions
23
PacketLib/PlayerCommand.cs
Normal file
23
PacketLib/PlayerCommand.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using LiteNetLib.Utils;
|
||||
|
||||
namespace PacketLib;
|
||||
|
||||
public struct PlayerCommand : INetSerializable {
|
||||
public static PlayerCommand SWITCH_CAM(int camId) => new(){ID = 0, Args = [camId] };
|
||||
public static PlayerCommand TOGGLE_MONITOR() => new(){ID = 1, Args = []};
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue