Well that’s pretty exciting. The old spawn system is gone and the basic TOE#3 code is in place and passes fundamental test #1: the server starts up and has been running for just over 30 minutes. Admittedly, it’s not doing anything because its not connected to a cluster. But I wasn’t expecting to get it into this state until late Monday afternoon.
There are still some major chunks of code to be reintroduced or added, but I also took a little extra time tonight (about 6 hours extra) working on the code to do some cleanup that I just couldn’t leave alone – starting with this class called “CountryWeaponList” which was basically a wrapper around a list of weapons spawnable at the facility. It was pure, lead-weight, baggage.
I also memberized a bunch of functions that had no good reason not to be member functions, making their corresponding data members private. Doing this is always fun because at least one of our early host coders leaves you with the impression he thought functions were a sort of reference from which you copy&paste code…
I’ve also deleted rather a lot of code today. Pre TOEs the host code was 166,467 lines. After all the code I added today, I’m down to 161,900 (4567 lines down, with 1043 lines of code that is now disabled but not yet removed).
A quick test of “patch” tells me there are 22,108 lines changed or added.
*Takes deep breath*
For your entertainment…
cnvy/cnvyMain.cpp:770:///TODO:TOE Reimplement timed delivery? strt/strtDotCommands.cpp:957:///TODO:TOE:Minor Print list of brigades instead. strt/strtDotCommands.cpp:1333:///TODO:TOE:Minor May need to re-implement addweap command strt/strtHCUnits.cpp:794:///TODO:TOE: Migrate _canSpawn code here strt/strtHCUnits.cpp:801:///TODO:TOE: Migrate _reserveWeapon code here strt/strtHCUnits.cpp:808:///TODO:TOE: Migrate _returnWeapon code here strt/strtHCUnits.cpp:815:///TODO:TOE Convert trickle-supply code to be brigade based strt/strtHostDB.cpp:389:///TODO:TOE: Save brigade spawn lists strt/strtHostDB.cpp:1065:///TODO:TOE Move global (WEAPON*) vehicle rank restrictions into TOEs strt/strtPostedWeaponList.cpp:264:///TODO:TOE: Needs functionality to cancel resupply ticket strt/strtPostedWeaponList.cpp:274:///TODO:TOE: Needs functionality to abandon resupply ticket strt/strtPostedWeaponList.cpp:284:///TODO:TOE: Needs functionality to generate resupply ticket strt/strtSpawn.cpp:186:///TODO:TOE: Check ownership/control of supplyCP? strt/strtSpawn.cpp:188:///TODO:TOE: Allow the poster to specify supplying unit strt/strtSpawn.cpp:391:///TODO:TOE: This code needs to be moved to the StratHCUnit or TOE, it shouldn't be done this directly here. strt/strtSpawn.cpp:1369:///TODO:TOE: Implement TOE debugging output for this strt/strtSpawn.cpp:1688:///TODO:TOE: Need to check with Ramp whether this is redundant; strt/strtSpawn.cpp:1689:///TODO:TOE: since he seems to ignore it and RTB you to your origin anyway. strt/strtSpawn.cpp:1707:///TODO:TOE:Critical See StratHCUnit::returnWeapon strt/strtSpawn.cpp:1874:///TODO:TOE:Minor A copy of this for every facility is handy, but surely very wasteful? strt/strtSupply.cpp:189:///TODO:TOE:Minor Check if cp == forUnit.homeCP() first? strt/strtTOE.cpp:180:///TODO:TOE:Minor Shouldn't we prune the resupply list? strt/strtTOE.cpp:189:///TODO:TOE: Queue this entry for saving.
There’s still UI work and feature tuning to do once I get all of this actually working according to spec.
Probably the biggest gap in the system right now is the resupply process – either I can just throw it at the database or I have to re-integrate my TOEs#1 code for managing returns.
A hybrid system would probably make more sense. We know that the average sortie time is 10 minutes; so I could keep up to, say, 15 minutes worth of pending-reinforcements in memory, and then after 15 minutes commit them to disk.
That would reduce database churn while avoiding the massive list-management overhead that goes with trying to maintain sorted lists of resupply tickets in memory.
Once I’ve decided how I’m doing that, there are a few places I need to plug back in the reset of the spawn lists for the brigades, and I have to clean up the process which handles RTBIng vehicles.
As long as I don’t slam into the 9-minute crash again, this is looking very promising.