Implement character death handling and periodic checks: Add logic to process characters with health <= 0 in EventsWorker and UserCharacterWorker, including immediate death handling during health updates and a scheduled death check every 12 hours. Introduce a new SQL query to retrieve characters with zero health.

This commit is contained in:
Torsten Schulz (local)
2026-02-02 08:05:12 +01:00
parent 972ef2b714
commit 340c658ad1
3 changed files with 80 additions and 0 deletions

View File

@@ -587,6 +587,11 @@ pub const QUERY_GET_USERS_TO_UPDATE: &str = r#"
WHERE user_id IS NOT NULL;
"#;
pub const QUERY_GET_CHARACTERS_ZERO_HEALTH: &str = r#"
SELECT id FROM falukant_data."character"
WHERE user_id IS NOT NULL AND health <= 0;
"#;
// politics worker queries
pub const QUERY_COUNT_OFFICES_PER_REGION: &str = r#"
WITH