Esempio n. 1
0
        private void ParseDeleteInContainer(Internal.CommunicationStream message)
        {
            byte   containerId = message.ReadUnsignedByte();
            ushort slot;

            Appearances.ObjectInstance appendObject = null;

            if (OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameContainerPagination))
            {
                slot = message.ReadUnsignedShort();
                ushort itemId = message.ReadUnsignedShort();

                if (itemId != 0)
                {
                    appendObject = ProtocolGameExtentions.ReadObjectInstance(message, itemId);
                }
            }
            else
            {
                slot = message.ReadUnsignedByte();
            }

            var containerView = ContainerStorage.GetContainerView(containerId);

            if (!!containerView)
            {
                containerView.RemoveObject(slot, appendObject);
            }
        }
Esempio n. 2
0
        private void ParseCreateInContainer(Internal.CommunicationStream message)
        {
            byte   containerId = message.ReadUnsignedByte();
            ushort slot        = 0;

            if (OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameContainerPagination))
            {
                slot = message.ReadUnsignedShort();
            }
            var @object = ProtocolGameExtentions.ReadObjectInstance(message);

            var containerView = ContainerStorage.GetContainerView(containerId);

            if (!!containerView)
            {
                containerView.AddObject(slot, @object);
            }
        }
Esempio n. 3
0
        private void ParseChangeInContainer(Internal.ByteArray message)
        {
            byte   containerId = message.ReadUnsignedByte();
            ushort slot        = 0;

            if (OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameContainerPagination))
            {
                slot = message.ReadUnsignedShort();
            }
            else
            {
                slot = message.ReadUnsignedByte();
            }
            var @object = ReadObjectInstance(message);

            var containerView = ContainerStorage.GetContainerView(containerId);

            if (!!containerView)
            {
                containerView.ChangeObject(slot, @object);
            }
        }