Implement daily political salary management: Introduced a new function run_daily_political_salary to calculate and distribute daily salaries for players with active political offices, utilizing configured values or fallback based on office rank. Updated SQL queries to support this functionality, including checks for the readiness of the necessary database column. Enhanced the PoliticsWorker to trigger daily salary processing, ensuring timely updates for users. Improved documentation for clarity on the new salary management features and their integration into the existing political benefits system.
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 2m51s
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 2m51s
This commit is contained in:
@@ -34,7 +34,8 @@ use crate::db::{ConnectionPool, DbError};
|
||||
use crate::message_broker::MessageBroker;
|
||||
|
||||
const DAILY_INTERVAL: Duration = Duration::from_secs(24 * 3600);
|
||||
const MONTHLY_INTERVAL: Duration = Duration::from_secs(30 * 24 * 3600);
|
||||
/// Wie `DAILY_INTERVAL`: 1 Spieljahr = 1 Kalendertag — Monats-Stempel/„monthly“-Batch pro Spieltag, nicht alle 30 echten Tage.
|
||||
const MONTHLY_INTERVAL: Duration = DAILY_INTERVAL;
|
||||
/// 12 Monatsticke pro Spieltag (24 h = 1 Spieljahr); 2 h = 1 Spielmonat (Liebschaft + Dienerschaft).
|
||||
const GAME_MONTH_SLICE_INTERVAL: Duration = Duration::from_secs(2 * 3600);
|
||||
|
||||
@@ -298,8 +299,11 @@ impl FalukantFamilyWorker {
|
||||
}
|
||||
|
||||
conn.prepare("mark_daily", QUERY_MARK_LOVER_DAILY_DONE)?;
|
||||
conn.prepare("mark_monthly", QUERY_MARK_LOVER_MONTHLY_DONE)?;
|
||||
for l in &lovers {
|
||||
conn.execute("mark_daily", &[&l.rel_id])?;
|
||||
// Gleicher Spieltag wie Tageslauf: Geburts-/Schwangerschafts-Logik darf nicht 30 echte Tage warten.
|
||||
conn.execute("mark_monthly", &[&l.rel_id])?;
|
||||
}
|
||||
|
||||
let mut marriage_socket_users: HashSet<i32> = HashSet::new();
|
||||
@@ -664,7 +668,7 @@ impl FalukantFamilyWorker {
|
||||
self.publish_falukant_update_family_batch(¬ify, "daily");
|
||||
|
||||
drop(conn);
|
||||
// Liebschafts-Geburt: früher nur alle ~30 Tage in process_monthly — zu selten für kurze Testphasen.
|
||||
// Liebschafts-Geburt: täglich (1 Spieljahr); Monats-Stempel erfolgt oben mit dem Tageslauf.
|
||||
if let Err(e) = self.process_lover_births() {
|
||||
eprintln!("[FalukantFamilyWorker] process_lover_births: {e}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user