psforever / PSF-LoginServer

Emulated PlanetSide 1 world and login server by the PSForever project.
https://psforever.net
GNU General Public License v3.0
75 stars 46 forks source link

Battle Island Facility Names #1173

Closed Fate-JH closed 6 months ago

Fate-JH commented 6 months ago

This change is entirely to make the parameters for /capturebase work on the Battle Islands in an intuitive way.

Technically, this can be used to give any facility or tower a much more approachable name. Consider, towers.

Dethdeath commented 6 months ago

Works.

Fate-JH commented 6 months ago

I don't know if it is still a valid issue, but I was going to do something for #1148 when I discovered that the handling for capturebase in ChatActor looks like this at a certain point:

(factionPos, buildingPos, timerPos, buildingsOption, timerOption) match {
                case // [[<empire>|none [<timer>]]
                    (Some(0), None, Some(1), None, Some(_)) | (Some(0), None, None, None, None) |
                    (None, None, None, None, None) |
                    // [<building name> [<empire>|none [timer]]]
                    (None | Some(1), Some(0), None, Some(_), None) | (Some(1), Some(0), Some(2), Some(_), Some(_)) |
                    // [all [<empire>|none]]
                    (Some(1) | None, Some(0), None, Some(_), None) =>
                    /* wth this is actually the valid case!? */

... and there's more like it in the rest. You're using the index of the param array to determine what kind of param a certain field should represent and then validating that it matches and, if it doesn't, then you have to pick a role for that position and subsequent positions to represent and then find out if one of the alternate guesses are permissible ... Did I write this?