scroll.server/crates/game-service/src
WiseDev 7f78fd5104 count the deploy timer down and hold the troop still while it runs
audit findings #8/#11. the encoded deploy field (LogicCharacter field47)
is the REMAINING deploy time: the client seeds it with DeployTime in
setState(5) and LogicCharacter::tick counts it down by 50 each tick,
returning early from the whole tick - no move, no retarget, no attack -
until it reaches 0, then setDefaultState flips the unit to moving(1) or
idle(0). our advance_deploy counted the opposite way (elapsed, 0 up to
DeployTime), so the encoded timer was DeployTime-minus-the-client's every
tick of every deploy, and the troop also moved and fought a full second
early.

now: a summoned troop spawns in state 5 with deploy_timer = DeployTime,
the timer decrements to 0, is_deploying() gates retarget/move/attack
while it is positive, and the state flips to moving/idle when it lands.
towers have DeployTime 0 and are unaffected.

harness: one tick in, the timer has dropped by 50 and the troop has not
moved; after the window it is at 0 and moving.
2026-08-24 09:39:13 +03:00
..
shop stop minting a new account on every login 2026-08-23 08:54:43 +03:00
store fix chest shop prices and gate the free chest 2026-08-23 09:02:49 +03:00
battle.rs count the deploy timer down and hold the troop still while it runs 2026-08-24 09:39:13 +03:00
battle_session.rs hash at the client's tick, and clear the dormant king's combat bit 2026-08-24 09:32:44 +03:00
bot.rs let the bot borrow the player's deck to split the model question 2026-08-23 15:28:52 +03:00
catalog.rs move all crates into crates/, glob members 2026-08-23 08:15:45 +03:00
config.rs roll chest loot from the csv instead of a fixed config 2026-08-23 09:30:38 +03:00
home.rs grant achievement progress and roll exp into levels 2026-08-24 09:15:22 +03:00
home_mode.rs resume the home logic when the player comes back 2026-08-23 11:56:04 +03:00
lib.rs matchmake two players before falling back to a bot 2026-08-23 13:19:38 +03:00
main.rs move all crates into crates/, glob members 2026-08-23 08:15:45 +03:00
matchmaker.rs matchmake two players before falling back to a bot 2026-08-23 13:19:38 +03:00
rewards.rs roll chest loot from the csv instead of a fixed config 2026-08-23 09:30:38 +03:00
service.rs drop the renumbering, it never earned its keep 2026-08-23 16:52:47 +03:00
time.rs move all crates into crates/, glob members 2026-08-23 08:15:45 +03:00
wire.rs push messages to the client during a battle 2026-08-23 13:03:07 +03:00