Closed Geit closed 8 years ago
@Fantasmos if you want to do this, this is a fantastic opportunity to put this into Utilities.cs and write several tests for it in UtilitiesTests.cs. Just do it in a new branch and open a pull-request when you're done - Travis will run the tests you wrote and verify they all pass :)
I can take it otherwise.
I don't think I have the time to do it fairly soon, I've got some study and assignments to work on in the coming weeks
I'll look into this tomorrow / Tuesday then
Update, the regex replace needs to be
$serverData["map"] = preg_replace("/\..*$/", "", $serverData["map"]);
because the maximum map display name length is 32 characters, this means maps with longer names don't return the full "ugc0123456" code, making the regex I originally posted fail.
Messages like:
Should be updated to filter out the "workshop/" and ".ugc[0-9]*" sections. The relevant code used to do this on the forums is:
$serverData["map"] = str_replace("workshop/", "", $serverData["map"]);
$serverData["map"] = preg_replace("/\.ugc[0-9]+/", "", $serverData["map"]);