Refactor Falukant daemon logic for time-based processing: Updated the handling of monthly servant costs and lover installments to align with the new game time model, introducing a unified "Monatstick" concept for cost calculations. Enhanced SQL queries and worker logic to ensure accurate processing every 2 hours, improving financial interactions and family dynamics.
This commit is contained in:
@@ -2103,8 +2103,9 @@ pub const QUERY_GET_SERVANT_MONTHLY_ROWS: &str = r#"
|
||||
JOIN falukant_data.character c ON c.user_id = fu.id AND c.health > 0
|
||||
LEFT JOIN falukant_type.title t ON t.id = c.title_of_nobility
|
||||
LEFT JOIN falukant_type.house ht ON ht.id = uh.house_type_id
|
||||
-- Monatstick (Spielzeit): alle ~2 h, nicht Kalendermonat (siehe docs/FALUKANT_DAEMON_AENDERUNGSNOTIZ_ZEITMASSSTAB.md)
|
||||
WHERE (uh.servants_last_monthly_at IS NULL
|
||||
OR date_trunc('month', uh.servants_last_monthly_at) < date_trunc('month', CURRENT_TIMESTAMP))
|
||||
OR uh.servants_last_monthly_at < NOW() - INTERVAL '2 hours')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM falukant_type.house h
|
||||
WHERE h.id = uh.house_type_id AND h.label_tr = 'under_bridge'
|
||||
|
||||
Reference in New Issue
Block a user