That's a really good point, and concurrency is definitely something worth designing for early, especially in a PvP-based mafia game.
I've structured the combat system around dedicated CombatSession and CombatAction models, with individual action records tracking damage, health after each action, turn numbers, and other combat details.
I'm also using database-level unique constraints to prevent duplicate post-fight actions and reward records for the same combat session. The schema is designed with auditability and data integrity in mind.
That said, I'm also looking carefully at race conditions when multiple actions target the same character. I agree that relying only on application-level checks isn't sufficient.
The next important layer is ensuring atomic combat updates through PostgreSQL transactions, with appropriate row-level locking or optimistic concurrency control where needed, so simultaneous attacks, stat updates, and reward distribution cannot produce inconsistent results.
I'd rather get the integrity of the combat and economy systems right before scaling up with more features.
The game is currently in the testing phase. Once testing is complete, it will be officially released. Stay tuned—it’s coming soon!