You must have money to walk in the Jianghu, and friends like pigs and dogs will naturally come, while people like idle people are useless and harmful. What does the whole paragraph mean?

People must be rich, and when they are rich, they will naturally surround themselves with friends like pigs and dogs. These people are not necessarily real friends, some of them just want to get benefits from you, but as they get older, they will think it is important for friends to really talk to each other. Fair-weather friends are fleeting, and most of them can't share joys and sorrows.