Chris Brown may not have the best reputation with his exes, but a judge just sided with the R&B star in a new ruling over his ongoing custody battle with baby mama Nia Guzmna.

Sources told TMZ that Guzman "struck out on every single request" regarding custody of the former couple's 2-year-old Royalty. Nia wanted full custody, she wanted Chris to have monitored visitation and she even wanted to deny Chris' mother the right to see their kid -- all of which were denied. Her request for Chris to submit to drug tests was also denied, and she was ordered to pay Brown back for the nearly $20,000 in attorney fees he gave her.

The judge ruled that the couple will have joint custody, and Chris continues to get Royalty for 12 days a month. Nia is currently getting $2,500 a month in child support from Chris, and though she was asking for nearly $16,000, she has since dismissed her support petition.