Enhance character event notifications in EventsWorker: Update character health change and death handling to include first and last names in notifications. Modify SQL queries to retrieve character names, ensuring accurate user feedback. Refactor notification structure for better organization and clarity.
This commit is contained in:
@@ -14,7 +14,12 @@ SELECT id FROM falukant_data.falukant_user ORDER BY RANDOM() LIMIT 1;
|
||||
"#;
|
||||
|
||||
pub const QUERY_GET_RANDOM_INFANT: &str = r#"
|
||||
SELECT c.id AS character_id, c.user_id, CURRENT_DATE - c.birthdate::date AS age_days
|
||||
SELECT
|
||||
c.id AS character_id,
|
||||
c.user_id,
|
||||
c.first_name,
|
||||
c.last_name,
|
||||
CURRENT_DATE - c.birthdate::date AS age_days
|
||||
FROM falukant_data."character" c
|
||||
WHERE c.user_id IS NOT NULL AND c.health > 0 AND CURRENT_DATE - c.birthdate::date <= 730
|
||||
ORDER BY RANDOM() LIMIT 1;
|
||||
@@ -693,7 +698,7 @@ WHERE region_id = $1;
|
||||
"#;
|
||||
|
||||
pub const QUERY_GET_RANDOM_CHARACTER: &str = r#"
|
||||
SELECT id, health
|
||||
SELECT id, health, first_name, last_name
|
||||
FROM falukant_data."character"
|
||||
WHERE user_id = $1 AND health > 0
|
||||
ORDER BY RANDOM() LIMIT 1;
|
||||
|
||||
Reference in New Issue
Block a user