Commit Graph

19 Commits

Author SHA1 Message Date
Torsten Schulz (local)
d94fa791b3 Add child relation deletion by parent query: Introduced a new SQL query to delete child relations where the character is either a father or mother. Updated relevant workers to execute this query before deleting child relations, ensuring proper cleanup of relationships during character deletion. 2026-02-04 14:46:57 +01:00
Torsten Schulz (local)
85b4c73c11 Update user money handling to prevent serialization errors: Adjusted the SQL query to cast money as numeric and modified the UserCharacterWorker to clamp and format the money value before executing the update. This change ensures valid numeric input and enhances error handling for user transactions. 2026-02-02 15:29:53 +01:00
Torsten Schulz (local)
658a9034ed Add SQL query to count children by user: Introduced a new query to count distinct children associated with a user across all their characters. Updated UserCharacterWorker to utilize this new query, replacing the previous count query. This enhances user-specific data retrieval capabilities. 2026-02-02 15:25:13 +01:00
Torsten Schulz (local)
340c658ad1 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. 2026-02-02 08:05:12 +01:00
Torsten Schulz (local)
f6d566427a Add immediate handling for deceased characters in health update: Implement logic to check if a character's health is less than or equal to zero and handle their death accordingly, improving character state management. 2026-01-31 08:55:49 +01:00
Torsten Schulz (local)
c9e0781b61 Update dependencies and enhance WebSocket server logging: Add 'chrono' and 'android_system_properties' to Cargo.lock, improve error handling and logging in websocket_server.rs, and streamline character creation notifications in worker modules for better clarity and maintainability. 2026-01-28 14:21:28 +01:00
Torsten Schulz (local)
2ac474fe0c Refactor relationship type retrieval in user character workers: Simplify the extraction of relationship types in UserCharacterWorker, CharacterCreationWorker, and EventsWorker by replacing and_then with map for improved readability and consistency. 2026-01-23 10:52:59 +01:00
Torsten Schulz (local)
c8668c59eb Refactor relationship type retrieval in character workers: Simplify the extraction of relationship types in CharacterCreationWorker, EventsWorker, and UserCharacterWorker by streamlining the use of and_then for better readability and maintainability. 2026-01-23 10:48:15 +01:00
Torsten Schulz (local)
0399333163 Enhance relationship deletion logging across workers: Implement detailed logging for the number of deleted relationships in CharacterCreationWorker, EventsWorker, and UserCharacterWorker, improving traceability and user awareness during character interactions. 2026-01-23 10:46:32 +01:00
Torsten Schulz (local)
7305a71438 Enhance relationship deletion process in character management: Implement detailed logging for deleted relationships, including related user and character IDs, and relationship types. Introduce special notifications for engaged relationships to improve user awareness during character events. 2026-01-22 09:35:21 +01:00
Torsten Schulz (local)
f96e474f32 Add random heir fallback logic in EventsWorker: Implement a new SQL query to select a random NPC heir from the same region when no children are available. Enhance error handling to log cases where no heir is found, ensuring better user feedback and maintaining character associations. Update UserCharacterWorker to utilize this new logic for heir assignment. 2026-01-07 10:14:24 +01:00
Torsten Schulz (local)
604c8ba300 Add character user clearing logic in EventsWorker: Implement a new SQL query to clear the user association from a deceased character before assigning a new heir. This ensures compliance with unique constraints and prevents errors during user reassignment. Enhance error handling and logging for better debugging. 2026-01-05 15:46:54 +01:00
Torsten Schulz (local)
10bc1e5a52 Refactor SQL queries into a dedicated module
- Moved SQL queries from multiple worker files into `src/worker/sql.rs` for better organization and maintainability.
- Updated references in `stockage_manager.rs`, `transport.rs`, `underground.rs`, `user_character.rs`, and `value_recalculation.rs` to use the new centralized SQL queries.
- Improved code readability by replacing `.get(0)` with `.first()` for better clarity when retrieving the first row from query results.
- Cleaned up unnecessary comments and consolidated related SQL queries.
2025-12-13 11:57:28 +01:00
Torsten Schulz (local)
d078b6b19a Refactor WebSocket user ID filtering and enhance SQL query security: Updated user ID handling in the WebSocket server to improve filtering logic for numeric user IDs. Implemented parameterized queries in the database operations across multiple worker files to prevent SQL injection vulnerabilities, ensuring safer data handling. 2025-12-08 11:56:04 +01:00
Torsten Schulz (local)
5a3a818d84 Add EventsWorker to worker module: Introduced EventsWorker for handling event-related tasks. Updated main.rs to include EventsWorker in the worker creation process. Adjusted WeatherWorker instantiation to use cloned pool and broker for consistency. 2025-12-08 11:17:16 +01:00
Torsten Schulz (local)
b11148b499 Add office gap management: Introduced new queries and logic in PoliticsWorker to identify and create elections for office type/region combinations with insufficient seats. Implemented trimming of excess offices to ensure compliance with configured seat limits. Updated UserCharacterWorker to delete political offices and maintain seat integrity post-deletion. 2025-11-24 09:25:30 +01:00
Torsten Schulz (local)
0968ab6b0b Add mood update functionality: Introduced a new mechanism for random mood updates in UserCharacterWorker, allowing characters to change mood approximately every 50 minutes. Updated SQL queries to ensure proper handling of character data. 2025-11-22 13:31:38 +01:00
Torsten Schulz (local)
f9d869ee23 Refactor worker modules: Added watchdog stop in BaseWorker, improved debug logging in PoliticsWorker, and removed unused credit_id in UserCharacterWorker. 2025-11-21 23:25:59 +01:00
Torsten Schulz (local)
d0ec363f09 Initial commit: Rust YpDaemon 2025-11-21 23:05:34 +01:00