I got a player report of a weird issue, they attacked 2 seconds after the hour, which resulted in weirdness. It seems their attack failed to write to the database, it only managed to get through calculations enough to display the results - but since it couldn't write to the database the attack was functionally just a simulation.
There was some other weirdness from the attack, KS changes on both sides, which the player wasn't able to figure out - I'm wondering if maybe the buildings spoils went through, although I would expect the whole operation to have failed, but who knows - I'm investigating from my phone and don't want to fire up my desktop to investigate it right now (lazy).
We should implement some technical fixes to lock databases during tick updates and put attacks into a queue. However, it will be far easier for my laziness factor if we just put a lock on attacks 1 minute before and after the hour... The tick calcs really only need like 5 seconds, and with a full 2 minutes it will give a huge buffer. This is kind of kicking the can down the road for this technical problem, and I'm good with it. If we had 1000 players then I'd go for the proper fix, but for now I think procrastinating and putting the simpler lazy fix is good ๐
I'll put the block in tomorrow. Until then, maybe don't send an attack right as the new hour flips over ๐