Commit Graph

13 Commits

Author SHA1 Message Date
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)
a9d490ce38 Refactor SQL queries into centralized module
- Moved various SQL query strings from individual worker files into a new `sql.rs` module for better organization and reusability.
- Updated `events.rs`, `underground.rs`, and `weather.rs` to use the centralized SQL queries.
- Removed redundant query definitions from `events.rs`, `underground.rs`, and `weather.rs`.
2025-12-12 15:18:30 +01:00
Torsten Schulz (local)
c801e50def Enhance money history tracking: Implement best-effort creation of money_history table in BaseWorker, EventsWorker, and UndergroundWorker to ensure logging of monetary changes without operation failure. 2025-12-09 08:53:39 +01:00
Torsten Schulz (local)
d740dbbf73 Enhance money history logging: Implement best-effort insert into money_history for UI visibility across BaseWorker, EventsWorker, and UndergroundWorker, improving tracking of monetary changes. 2025-12-09 08:19:42 +01:00
Torsten Schulz (local)
e8c8c5edb1 Refactor EventsWorker: Move EVENT_RATE_SCALE constant to the struct for better encapsulation and clarity in event probability calculations. 2025-12-09 00:09:12 +01:00
Torsten Schulz (local)
a4d1d79e6e Enhance EventsWorker: Introduce EVENT_RATE_SCALE constant to adjust event frequency, improving control over event triggering rates. 2025-12-09 00:07:55 +01:00
Torsten Schulz (local)
b4b3b1adcc Enhance user notification structure in EventsWorker: Updated the notification process to include detailed event information in the database entries. Notifications now contain event ID, type, and effects, improving clarity and data integrity for user alerts. 2025-12-08 13:29:18 +01:00
Torsten Schulz (local)
9b6883ea84 Implement inheritance logic for player characters in EventsWorker: Added functionality to handle character inheritance before deleting child relations. This includes querying for the user ID, determining the heir, and updating the heir's assets accordingly. Enhanced logging for inheritance events to improve traceability. 2025-12-08 13:22:20 +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)
2948586041 Enhance event effect handling in EventsWorker: Updated money change, storage capacity change, and house quality change methods to return absolute values and percentages. Improved JSON response structure for event effects, enhancing clarity and data accuracy in event processing. 2025-12-08 11:51:10 +01:00
Torsten Schulz (local)
0198bcd603 Enhance user notification handling in EventsWorker: Updated the notification process to write user notifications to the database and send WebSocket alerts for each affected user in a region. Improved logging to reflect the number of users notified during regional event processing. 2025-12-08 11:34:20 +01:00
Torsten Schulz (local)
37b2c08555 Add new event effects and implement regional changes: Introduced HouseQualityChange and updated StorageCapacityChange effects in EventsWorker. Implemented regional handling for storage capacity and house quality changes during events, enhancing gameplay dynamics and event impact. Improved logging for affected stocks and houses during changes. 2025-12-08 11:23:34 +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