Ejemplo n.º 1
0
        public void RequestVoxelPaintBox(BoundingBoxD box, MatrixD Transformation, byte material, PaintType Type)
        {
            var msg = new PaintBoxMessage();

            msg.EntityId       = Entity.EntityId;
            msg.Min            = box.Min;
            msg.Max            = box.Max;
            msg.Type           = Type;
            msg.Material       = material;
            msg.Transformation = Transformation;

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
Ejemplo n.º 2
0
        static void VoxelPaintBoxSuccess(MySyncVoxel sync, ref PaintBoxMessage msg, MyNetworkClient sender)
        {
            var voxel = sync.Entity as MyVoxelBase;

            if (voxel != null)
            {
                m_boxShape.Transformation = msg.Transformation;
                m_boxShape.Boundaries.Max = msg.Max;
                m_boxShape.Boundaries.Min = msg.Min;
                var amountChanged = UpdateVoxelShape(sync, msg.Type, m_boxShape, msg.Material);
                if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                {
                    MySession.Static.VoxelHandVolumeChanged += amountChanged;
                }
            }
        }
Ejemplo n.º 3
0
        static void VoxelPaintBoxRequest(MySyncVoxel sync, ref PaintBoxMessage msg, MyNetworkClient sender)
        {
            var voxel = sync.Entity as MyVoxelBase;

            if (voxel != null)
            {
                m_boxShape.Transformation = msg.Transformation;
                m_boxShape.Boundaries.Max = msg.Max;
                m_boxShape.Boundaries.Min = msg.Min;

                if (CanPlaceInArea(msg.Type, m_boxShape))
                {
                    var amountChanged = UpdateVoxelShape(sync, msg.Type, m_boxShape, msg.Material);
                    if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                    {
                        MySession.Static.VoxelHandVolumeChanged += amountChanged;
                    }
                    Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
                }
            }
        }
Ejemplo n.º 4
0
 static void VoxelPaintBoxRequest(MySyncVoxel sync, ref PaintBoxMessage msg, MyNetworkClient sender)
 {
     var voxel = sync.Entity as MyVoxelBase;
     if (voxel != null)
     {
         m_boxShape.Transformation = msg.Transformation;
         m_boxShape.Boundaries.Max = msg.Max;
         m_boxShape.Boundaries.Min = msg.Min;
        
         if (CanPlaceInArea(msg.Type, m_boxShape))
         {
             var amountChanged = UpdateVoxelShape(sync, msg.Type, m_boxShape, msg.Material);
             if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
                 MySession.Static.VoxelHandVolumeChanged += amountChanged;
             Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success);
         }
     }
 }
Ejemplo n.º 5
0
 static void VoxelPaintBoxSuccess(MySyncVoxel sync, ref PaintBoxMessage msg, MyNetworkClient sender)
 {
     var voxel = sync.Entity as MyVoxelBase;
     if (voxel != null)
     {
         m_boxShape.Transformation = msg.Transformation;
         m_boxShape.Boundaries.Max = msg.Max;
         m_boxShape.Boundaries.Min = msg.Min;
         var amountChanged = UpdateVoxelShape(sync, msg.Type, m_boxShape, msg.Material);
         if (msg.Type == PaintType.Cut || msg.Type == PaintType.Fill)
             MySession.Static.VoxelHandVolumeChanged += amountChanged;
     }
 }
Ejemplo n.º 6
0
        public void RequestVoxelPaintBox(BoundingBoxD box,MatrixD Transformation, byte material, PaintType Type)
        {
            var msg = new PaintBoxMessage();
            msg.EntityId = Entity.EntityId;
            msg.Min = box.Min;
            msg.Max = box.Max;
            msg.Type = Type;
            msg.Material = material;
            msg.Transformation = Transformation;

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }