This particular approach to re-introducing TOEs into earlier code base was looking very promising, the trail gradually leading to less and less calling functions. Then I hit a speed bump: the “post” functions (when you reserve or spawn a weapon it is “posted” to one of two lists at the facility you spawn from).
The top portion of this code path overlaps with the map/mission host. Doh, my previous approaches had automatically dealt with that. But more significantly, this is some really, really, evil code from the peak of coder narcissism in the middle days of pre-release development where the war between Elmo and Vandal was at its peak.
As you reach the top of the code path, the parameters you have to work with start getting weird… For instance, I’d utterly forgotten that vehicles aren’t registered to you – they are registered to your map host and then, to a lesser degree, to your name. Infact, actually, they are registered to the network descriptor for the map host connection the request arrived on…
I’m going to have to skim over the API, which is a little bit nebulous (custom structures FTW)! I want to avoid having to duplicate all of the TOE code onto the map host (where everything is just a different enough so that its not a matter of just re-using the code).
I think my best shot is going to be writing an API class which uses the host’s NetCode2 layer to exchange data between the two instances of itself. I’m going to have to spend some time scribbling with this to work out where to draw the line between what the map host can determine for itself and what it has to ask the strat host about.
May have to talk to Ramp about how the client does some of this stuff because its entirely possible that a lot of the code is now redundant (e.g. I believe the client now always tries to reserve a vehicle for you before it tries to spawn it; if so, the code that handles a launch-without-reservation, which is some 900 lines long, is moot).
The multi-crewing code is in here too, which has always been delicate (16 different “*_JOIN_*” structures for passing requests, allows, denies, updates, etc and some 94 functions, which I think are 100% uneccessary because the neccessary work is done on the map host; with the strat host as a redundant point of authority. Laymans terms: like always calling your mom to ask if she’s listening before you curse)
I think my problem right now is that I have about half of this junk from the old system clouding my mental model of the new system; I haven’t found that grounding point where I have a crystal clear view of what I need to keep/rewrite and what gets cut.
But I’m getting very close.