scroll.server/crates
WiseDev 7a0ba1b652 give the server its own battle clock and end condition
LogicBattle::isEndConditionMatched, transcribed: the battle is over when
end_counter is positive, when either king is dead, when tick/20 seconds
reach MatchLength + OvertimeSeconds, or - once past MatchLength - when
the crowns differ. the divisor is the 0x66666667/2^35 multiply in the
client, which is a divide by twenty, so the battle runs at 20 ticks a
second.

crowns come from LogicSummoner::getStars: three when the enemy king is
down, otherwise two minus the enemy princess towers still standing,
which is exactly what leader_towers holds.

BattleRegistry keeps the LogicGameMode we built for each account and
advances it on the tick the client reports in its turn message, so the
server now tracks the clock, the crowns and whether the battle is over,
and drops the session when the player goes home. the two isSummoner
guards in the overtime branch are left out: they only fire for an object
that is not a summoner, which a king tower always is.
2026-08-23 12:01:26 +03:00
..
auth-service stop minting a new account on every login 2026-08-23 08:54:43 +03:00
game-service give the server its own battle clock and end condition 2026-08-23 12:01:26 +03:00
gateway refill the hand, and decode SendBattleEventMessage 2026-08-23 11:47:25 +03:00
logic give the server its own battle clock and end condition 2026-08-23 12:01:26 +03:00
logic-derive move all crates into crates/, glob members 2026-08-23 08:15:45 +03:00
scroll-server supervised mode: run the services as child processes 2026-08-23 09:46:59 +03:00
service-rpc matchmake against a bot instead of searching forever 2026-08-23 10:28:28 +03:00
storage fix chest shop prices and gate the free chest 2026-08-23 09:02:49 +03:00
titan build and send the battle sector state 2026-08-23 10:24:20 +03:00
titan-derive build and send the battle sector state 2026-08-23 10:24:20 +03:00