Esempio n. 1
0
        public static void Put(this LiteNetLib.Utils.NetDataWriter om, Quaternion q)
        {
            var pack = new BitWriter(32);

            pack.PutQuaternion(q);
            Debug.Assert(pack.ByteLength == 4);
            pack.WriteToPacket(om);
        }
Esempio n. 2
0
        public static void PutNormal(this LiteNetLib.Utils.NetDataWriter om, Vector3 n)
        {
            var pack = new BitWriter(32);

            pack.PutNormal(n);
            Debug.Assert(pack.ByteLength == 4);
            pack.WriteToPacket(om);
        }
Esempio n. 3
0
        public void WriteContents(NetDataWriter message)
        {
            message.Put(Tick);
            var writer = new BitWriter();

            if (Updates.Length > 255)
            {
                throw new Exception("Too many updates for net packet");
            }
            writer.PutUInt((uint)Updates.Length, 8);
            foreach (var p in Updates)
            {
                p.WriteTo(ref writer);
            }
            writer.WriteToPacket(message);
        }