I haven’t written any test units yet, but I’m down to 4 files (out of 58) with compile errors in them now.
Its been a useful process. Previously, when you tried to capture a facility, it had to call its own, custom version of the supply-tracing code, which wasn’t exactly 100% in sync with the “find where I get supply” from member of the facilities, or with the two other versions. These different versions existed because of data that was unavailable or just wasn’t evidently available (sometimes it was just buried under 4-8 references, but I think it always was).
The big lump of work left to do is largely to do with vehicle returns – when you cancel a reservation or despawn. I think I’ve drastically simplified it, but I’ll have to go back and ensure the rest of the code knows how to tell it you are doing a resupply run (Division -> Brigade). Its coded to cope with it, but I have to change how that is denoted when you spawn your vehicle.
I also haven’t written the resupply code. I may cheat, as I mentioned before, and just record vehicles out to a database table. Then I can just poll that table once a minute for vehicles that need returning, and when a vehicle *is* returned, I can just update the vehicles out table.
I’ve changed the way depot throttles work – instead of tracking individual vehicles I just count numbers and assign a window to when those vehicles will be returned. This may not work the way we want it: currently, each time someone spawns a rifle, the throttle drops by one until 5 minutes after they spawned. This mechanism doesn’t go up by ones, instead the count keeps going down as people spawn, and only goes back up to full when 5 minutes pass without someone spawning a rifle.
But I can worry about implementing a list after I’ve gotten everything else done.
Feeling pretty good about the code. Spent 6 hours on it today, and the newer functions are much simpler and cleaner. I dumped a bunch of global functions in favor of things like WeaponEntry::incrementThrottle(). Lots of return values went away that were meaningless which let me clean up a lot of code that tried to deal with unexpected return values (like going to the bank every day to check if your balance of $0.00 has gained an interest – bank accounts *do* gain interest, and yours *could* if the bank decided to give you a persistence bonus).
Monday is going to be crashfest, I’m betting; Killer has my dev cluster on his desk for upgrading, so I’m going to have to use the beta server for experimenting.