Esempio n. 1
0
        public NetworkState ReadPacket(PacketByteBuf packet, NetworkState state, NetworkSide side)
        {
            Id = packet.ReadVarInt();
            //this.uuid = arg.readUuid();
            //this.entityTypeId = (EntityType)Registry.ENTITY_TYPE.get(arg.readVarInt());
            var x = packet.ReadDouble();
            var y = packet.ReadDouble();
            var z = packet.ReadDouble();

            Position = new Vector3(Convert.ToSingle(x), Convert.ToSingle(y), Convert.ToSingle(z));

            var pitch = packet.ReadByte();
            var yaw   = packet.ReadByte();

            Look = new Vector2(pitch, yaw);

            EntityData = packet.ReadVarInt();

            var velocityX = packet.ReadInt16();
            var velocityY = packet.ReadInt16();
            var velocityZ = packet.ReadInt16();

            Velocity = new Vector3(velocityX, velocityY, velocityZ);

            return(state);
        }
Esempio n. 2
0
        public NetworkState ReadPacket(PacketByteBuf packet, NetworkState state, NetworkSide side)
        {
            try
            {
                ProtocolVersion = packet.ReadVarInt();
                ServerHostname  = packet.ReadString();
                ServerPort      = packet.ReadUInt16();
                NextState       = (NetworkState)packet.ReadVarInt();
            }
            catch (Exception e)
            {
                Debug.LogError($"[ReadPacket] - {e.Message}");
            }

            return(NextState);
        }
Esempio n. 3
0
        public NetworkState ReadPacket(PacketByteBuf packet, NetworkState state, NetworkSide side)
        {
            EntityId = packet.ReadVarInt();
            Position = packet.readBlockPos();
            Progress = packet.ReadByte();

            return(state);
        }
Esempio n. 4
0
        public NetworkState ReadPacket(PacketByteBuf packet, NetworkState state, NetworkSide side)
        {
            Id = packet.ReadVarInt();
            //this.uuid = packet.readUuid();
            var x = packet.ReadDouble();
            var y = packet.ReadDouble();
            var z = packet.ReadDouble();

            Position = new Vector3(Convert.ToSingle(x), Convert.ToSingle(y), Convert.ToSingle(z));

            var yaw   = packet.ReadByte();
            var pitch = packet.ReadByte();

            Look = new Vector2(yaw, pitch);

            return(state);
        }
 public NetworkState ReadPacket(PacketByteBuf packet, NetworkState state, NetworkSide side)
 {
     compressionThreshold = packet.ReadVarInt();
     Debug.LogWarning($"JDJDDJJDDJJD {compressionThreshold}");
     return(state);
 }
        public NetworkState ReadPacket(PacketByteBuf packet, NetworkState state, NetworkSide side)
        {
            TeleportId = packet.ReadVarInt();

            return(state);
        }