feat: added LiteNetLib networking integration

This commit is contained in:
2025-08-05 19:27:47 +03:00
parent 6631cae7b0
commit 1644a751bb
20 changed files with 747 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
using LiteNetLib.Utils;
using Syntriax.Engine.Core;
namespace Syntriax.Engine.Systems.Network;
internal static class ColorRGBANetPacker
{
internal static void Write(NetDataWriter writer, ColorRGBA data)
{
writer.Put(data.R);
writer.Put(data.G);
writer.Put(data.B);
writer.Put(data.A);
}
internal static ColorRGBA Read(NetDataReader reader)
{
byte red = reader.GetByte();
byte green = reader.GetByte();
byte blue = reader.GetByte();
byte alpha = reader.GetByte();
return new ColorRGBA(red, green, blue, alpha);
}
}