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); }
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; } } }
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); } } }
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); } } }
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; } }
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); }