Commit Graph

  • 86cb437294 Update Rust crate tokio-rustls to 0.26 renovate/tokio-rustls-0.x Torsten Schulz 2025-12-19 16:19:15 +01:00
  • 5eb98f33c9 Update Rust crate rand to 0.9 #2 renovate/rand-0.x Torsten Schulz 2025-12-19 16:14:03 +01:00
  • 80012fec64 Merge pull request 'Configure Renovate' (#1) from renovate/configure into main main Torsten Schulz 2025-12-19 16:08:08 +01:00
  • 8e92a63895 Add renovate.json #1 renovate/configure Torsten Schulz 2025-12-19 16:00:14 +01:00
  • f7710b64c9 Refactor WeatherWorker SQL query: Replace the existing weather update logic with a new query that assigns random weather types to each region, ensuring individual updates. Clean up logging messages for clarity. origin/main origin/HEAD Torsten Schulz (local) 2025-12-18 15:34:16 +01:00
  • 6d12c70d84 Entferne Info-Logs aus den Worker-Klassen: Reduziere die Protokollierung in ProduceWorker, DirectorWorker und TransportWorker, um die Ausgabe zu optimieren und nur Fehler zu protokollieren. Torsten Schulz (local) 2025-12-16 12:58:37 +01:00
  • d2e253b79a Füge erweiterte SQL-Abfragen und Logging in ProduceWorker hinzu: Implementiere Update- und Insert-Logik für das Inventar und verbessere die Fehlerausgaben. Torsten Schulz (local) 2025-12-16 10:52:06 +01:00
  • 74fee2d4c9 Verbessere Fehlerbehandlung in SQL-Abfragen: Füge detaillierte Fehlermeldungen für Vorbereitungs- und Ausführungsfehler in den Director- und Politics-Workern hinzu. Torsten Schulz (local) 2025-12-16 08:52:08 +01:00
  • b45990c1b6 Aktualisiere Benachrichtigungsabfragen: Ersetze character_id durch user_id in den Benachrichtigungs-INSERT-Abfragen und optimiere die Abfragen zur Auswahl des Benutzers. Torsten Schulz (local) 2025-12-16 08:24:46 +01:00
  • ae90166adb Aktualisiere Benachrichtigungsabfragen: Ersetze user_id durch character_id und optimiere die Abfragen zur Auswahl des Charakters. Torsten Schulz (local) 2025-12-15 21:20:30 +01:00
  • 2aa4e7c666 Füge VSCode-Build-Tasks hinzu: Erstelle Aufgaben für den Build-Prozess und Clippy-Überprüfungen. Torsten Schulz (local) 2025-12-13 23:40:20 +01:00
  • ce06b1a4f0 Verbessere SQL-Abfragen im Produktionsworker: Optimiere die Abfrage für abgeschlossene Produktionen und verbessere die Lesbarkeit der Preisberechnung. Torsten Schulz (local) 2025-12-13 12:17:00 +01:00
  • 10bc1e5a52 Refactor SQL queries into a dedicated module Torsten Schulz (local) 2025-12-13 11:57:28 +01:00
  • a9d490ce38 Refactor SQL queries into centralized module Torsten Schulz (local) 2025-12-12 15:18:30 +01:00
  • eab46f5cdc Verbessere Preisberechnung im DirectorWorker: Implementiere kumulative Steuerberechnung basierend auf regionalen Büros und deren Befreiungen, um die Genauigkeit der Einnahmen und Auszahlungen zu erhöhen. Torsten Schulz (local) 2025-12-12 07:52:53 +01:00
  • 1134be0f8d Enhance tax calculation in DirectorWorker: Integrate DEFAULT_TAX_PERCENT and DEFAULT_TREASURY_USER_ID for improved financial operations during product sales. Torsten Schulz (local) 2025-12-10 12:57:08 +01:00
  • 433259da74 Refactor WeatherWorker: Improve weather update query to ensure unique random weather selection for each region using LATERAL join. Torsten Schulz (local) 2025-12-09 13:51:02 +01:00
  • cddf701af1 Refactor change_falukant_user_money: Remove debug logging for money clamping and update execution to reduce noise, maintaining essential logging only when clipping occurs. Torsten Schulz (local) 2025-12-09 10:35:33 +01:00
  • 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. Torsten Schulz (local) 2025-12-09 08:53:39 +01:00
  • 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. Torsten Schulz (local) 2025-12-09 08:19:42 +01:00
  • e8c8c5edb1 Refactor EventsWorker: Move EVENT_RATE_SCALE constant to the struct for better encapsulation and clarity in event probability calculations. Torsten Schulz (local) 2025-12-09 00:09:12 +01:00
  • a4d1d79e6e Enhance EventsWorker: Introduce EVENT_RATE_SCALE constant to adjust event frequency, improving control over event triggering rates. Torsten Schulz (local) 2025-12-09 00:07:55 +01:00
  • 78b5527b15 Enhance change_falukant_user_money: Switch to literal SQL execution for update_money to resolve serialization issues with parameterized calls, improving reliability. Torsten Schulz (local) 2025-12-08 16:39:57 +01:00
  • 180431b130 Enhance change_falukant_user_money: Implement money clamping logic to ensure updates stay within numeric(10,2) limits, improving data integrity and error handling. Torsten Schulz (local) 2025-12-08 16:34:57 +01:00
  • 99fbaab816 Enhance change_falukant_user_money: Implement fallback to literal SQL for update_money on failure of parameterized call, improving robustness and error handling. Torsten Schulz (local) 2025-12-08 16:28:46 +01:00
  • 450497ccd3 Refactor change_falukant_user_money: Update parameter types for database call and enhance logging for better traceability Torsten Schulz (local) 2025-12-08 16:23:24 +01:00
  • 04a8da8d0c Enhance logging in change_falukant_user_money: Added type logging for parameters to identify unexpected types during execution, improving debugging capabilities. Torsten Schulz (local) 2025-12-08 16:15:30 +01:00
  • 688b21581d Enhance logging in BaseWorker and DirectorWorker: Added detailed debug logs before database calls in change_falukant_user_money, improving traceability of user ID and money change values during production start and sell operations. Torsten Schulz (local) 2025-12-08 16:07:08 +01:00
  • f7c4919a2a Enhance error logging in change_falukant_user_money function: Added detailed logging for parameters before executing the database update and improved error handling for serialization issues, enhancing traceability and debugging capabilities. Torsten Schulz (local) 2025-12-08 16:01:25 +01:00
  • ad0033031d Validate money change input in update_money function: Added checks to ensure the money_change value is finite before executing the database update, preventing potential serialization errors with invalid values. Torsten Schulz (local) 2025-12-08 15:53:31 +01:00
  • 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. Torsten Schulz (local) 2025-12-08 13:29:18 +01:00
  • 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. Torsten Schulz (local) 2025-12-08 13:22:20 +01:00
  • 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. Torsten Schulz (local) 2025-12-08 11:56:04 +01:00
  • 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. Torsten Schulz (local) 2025-12-08 11:51:10 +01:00
  • 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. Torsten Schulz (local) 2025-12-08 11:34:20 +01:00
  • 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. Torsten Schulz (local) 2025-12-08 11:23:34 +01:00
  • 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. Torsten Schulz (local) 2025-12-08 11:17:16 +01:00
  • 8db82e0ced Refactor transport planning in DirectorWorker: Updated variable naming for clarity by changing 'shipped' to '_shipped' to indicate unused variable. Removed unused get_branch_user_id function from TransportWorker to streamline code and improve maintainability. Torsten Schulz (local) 2025-12-05 14:20:56 +01:00
  • f481ef4b73 Refactor inventory handling in DirectorWorker: Updated transport planning logic to ensure inventory is reduced immediately after successful transport creation. Removed redundant inventory updates from the planning phase, enhancing consistency and clarity in inventory management. Improved logging to reflect changes in inventory status during transport operations. Torsten Schulz (local) 2025-12-05 14:17:57 +01:00
  • d03d865f75 Refactor ArrivedTransport struct and SQL query in TransportWorker: Updated the ArrivedTransport struct to include source and target branch IDs, and user ID for notifications. Modified the SQL query to join with source and target branches, enhancing transport data retrieval and notification capabilities. Torsten Schulz (local) 2025-12-05 14:15:22 +01:00
  • 58436bc016 Enhance transport processing in TransportWorker: Updated run_loop and process_arrived_transports methods to include broker for publishing notifications. Improved handling of empty transports and added notifications for transport arrival and inventory updates, ensuring timely user alerts and better transport management. Torsten Schulz (local) 2025-12-05 14:12:17 +01:00
  • fbcea09257 Refactor transport handling in TransportWorker: Updated ArrivedTransport struct to allow optional product_id for empty transports. Enhanced validation logic to differentiate between normal and empty transports, improving handling and processing of transport data. Added specific handling for empty transports in the database operations, ensuring accurate vehicle updates and transport deletions. Torsten Schulz (local) 2025-12-05 14:06:22 +01:00
  • 46d0ea46a8 Refactor weather update query in WeatherWorker: Simplified the SQL logic for assigning random weather types to regions by removing unnecessary joins and using a subquery for random selection. Enhanced comments for clarity on the individual weather assignment process for each region. Torsten Schulz (local) 2025-12-05 13:36:55 +01:00
  • b59837feb3 Refactor transport planning logic in DirectorWorker: Improved handling of empty transports for vehicle retrieval when no vehicles are available in the current branch. Enhanced checks for free vehicles and better selling prices in other branches, along with detailed logging for improved traceability during transport operations. Torsten Schulz (local) 2025-12-05 12:56:59 +01:00
  • 9f2f20cba2 Add empty transport planning in DirectorWorker: Introduced SQL queries and logic to handle empty transports for vehicle retrieval when no transport vehicles are available in the current branch. Enhanced the planning process to check for better selling prices in other branches and available free vehicles, improving transport management and operational efficiency. Torsten Schulz (local) 2025-12-04 16:31:39 +01:00
  • 940706bed3 Enhance logging and vehicle checks in DirectorWorker: Added SQL queries to verify the existence of vehicles in the source region and routes between regions. Improved debug logging to provide insights into vehicle counts and route availability, enhancing traceability during transport planning operations. Torsten Schulz (local) 2025-12-03 16:54:22 +01:00
  • 66b19fbe7c Enhance logging in DirectorWorker for transport planning: Added detailed error and status messages throughout the transport planning process, including inventory checks, transport feasibility assessments, and pricing evaluations. This improves traceability and debugging capabilities for transport operations associated with directors. Torsten Schulz (local) 2025-12-03 16:52:38 +01:00
  • d2c8b62156 Implement transport management in DirectorWorker: Enhanced the start_transports_stub function to handle transport planning for inventory items associated with a director. Added error handling for transport initiation and improved database interactions for inventory management, ensuring accurate transport planning and logging of potential errors. Torsten Schulz (local) 2025-12-03 16:42:36 +01:00
  • e14272e477 Add WeatherWorker to the worker module and update worker creation logic: Introduced WeatherWorker to manage weather-related tasks. Updated the create_workers function to include WeatherWorker alongside existing workers, ensuring comprehensive handling of various operational aspects. Torsten Schulz (local) 2025-12-02 12:59:40 +01:00
  • c943e57f80 Enhance production management by adding region_id to ProductionPlan and updating SQL queries: Introduced region_id to the ProductionPlan struct and modified the insert production query to include weather_type_id based on region. Updated finished productions query to account for weather effects on quality ratings, ensuring accurate production assessments. Improved comments for clarity on the impact of weather on production quality. Torsten Schulz (local) 2025-12-02 09:57:31 +01:00
  • 32dd79bc6e Refactor hourly price recalculation logic: Implemented a two-tier pricing adjustment system based on sales data, comparing city sales against global and parent-region averages. Updated SQL queries to reflect new pricing rules, ensuring dynamic price adjustments within defined tolerances. Enhanced logging for better tracking of affected regions during recalculation. Torsten Schulz (local) 2025-12-02 09:29:33 +01:00
  • 4a2e814803 Enhance pricing logic in DirectorWorker and implement hourly price recalculation: Added a new worth_percent field to the InventoryItem struct and updated SQL queries to incorporate this value in price calculations. Refactored price computation logic to use a base price derived from worth_percent. Introduced a new hourly price recalculation mechanism that adjusts prices based on sales data from the last hour, ensuring dynamic pricing adjustments. Enhanced logging for better monitoring of price updates. Torsten Schulz (local) 2025-12-02 08:55:01 +01:00
  • 9ee8c970c7 Add branch capacity query and production limits in DirectorWorker: Introduced a new SQL query to fetch current stock and production values for a branch, enabling dynamic production management. Implemented logic to limit concurrent productions to a maximum of two and updated production creation to handle single production requests efficiently. Enhanced logging for better traceability of production activities. Torsten Schulz (local) 2025-12-01 16:23:40 +01:00
  • 513862a157 Limit maximum production quantity in DirectorWorker: Updated the production calculation to cap the output at 100 units per start, ensuring it does not exceed available capacity or financial constraints. Enhanced comments for better understanding of the production limits. Torsten Schulz (local) 2025-12-01 15:55:59 +01:00
  • bd9fbb80c0 Enhance production job handling in DirectorWorker: Implemented a limit on the number of concurrent production jobs per branch to a maximum of two. Updated SQL query for fetching finished productions to aggregate quality ratings correctly and ensure unique results per production ID. Improved comments for clarity on the logic and SQL structure. Torsten Schulz (local) 2025-12-01 14:32:31 +01:00
  • 02bd0de75d Refactor user ID filtering in WebSocket server: Enhanced the logic to only filter messages based on user_id if the target user ID is numerically valid. Updated comments for clarity on the filtering behavior and historical context regarding user ID handling. Torsten Schulz (local) 2025-12-01 13:31:12 +01:00
  • b8fa644c97 Implement periodic ping frames in WebSocket server for keepalive and update overproduction handling in ProduceWorker to include branch_id. This enhances connection stability and improves notification clarity for overproduction events. Torsten Schulz (local) 2025-12-01 13:25:23 +01:00
  • 3e9f921f4f Enhance DirectorWorker functionality: Added branch_id to the Director struct and updated SQL queries to include branch_id as a parameter. Improved logging messages to include branch_id for better traceability during production, transport, and sales checks. This change enhances the clarity and functionality of the DirectorWorker's operations. Torsten Schulz (local) 2025-12-01 11:59:03 +01:00
  • a0e14788c7 Refactor money update execution in BaseWorker: Simplified the SQL execution by directly constructing the update query without parameterized placeholders, addressing serialization issues. Updated comments for clarity on the handling of money values and ensured compatibility with trusted data sources. Additionally, modified the casting of money in the director query to text for consistent mapping in Rust. Torsten Schulz (local) 2025-12-01 11:31:37 +01:00
  • 260b3b2962 Refactor SQL parameter handling in BaseWorker: Updated the execution of the money update query to pass parameters in their natural types, allowing PostgreSQL to handle type casting automatically. Improved comments for clarity on the changes made to ensure compatibility with the existing database schema. Torsten Schulz (local) 2025-12-01 11:18:54 +01:00
  • 25b69e48fe Refactor money update execution in BaseWorker: Updated parameter handling in SQL execution to pass all values as strings, allowing for proper type casting in the database. Enhanced comments for clarity on the changes made to ensure compatibility with existing database schema. Torsten Schulz (local) 2025-12-01 11:15:46 +01:00
  • 2c91f1868b Refactor SQL execution in BaseWorker: Updated the money update logic to register and execute prepared statements by name, enhancing clarity and consistency with existing code. Improved comments for better understanding of numeric type handling in SQL queries. Torsten Schulz (local) 2025-12-01 11:09:17 +01:00
  • 0825c05c31 Refactor money update logic in BaseWorker: Simplified the SQL execution by removing named prepared statement caches to avoid signature conflicts during schema changes. Updated comments for clarity on the handling of money change as a numeric type, ensuring compatibility with the database. Torsten Schulz (local) 2025-12-01 10:59:02 +01:00
  • d98620ea06 Refactor SQL query in DirectorWorker: Removed unnecessary conditions from the query for fetching transport vehicles, simplifying the logic while maintaining functionality. This change enhances query readability and performance. Torsten Schulz (local) 2025-12-01 10:55:50 +01:00
  • 6f9e13b290 Update money handling in BaseWorker: Changed SQL query to cast money change to numeric type for compatibility with existing database schema. Updated parameter passing to ensure the value is sent as a string, allowing proper casting in the database. Added comments for clarity on the changes made. Torsten Schulz (local) 2025-12-01 10:39:32 +01:00
  • 7ae2f0c6c9 Enhance money production calculation in DirectorWorker: Updated the logic to handle cases where available money is zero, allowing production limits to be determined by capacity instead. Added warning logging for unexpected zero money scenarios, improving error handling and visibility in production planning. Torsten Schulz (local) 2025-12-01 10:37:05 +01:00
  • cf874a7b8d Refactor map_row_to_production_plan in DirectorWorker: Simplified the parsing of database fields by introducing local variables for required and optional fields. This change enhances readability and maintains default values for optional fields, improving the robustness of production plan creation. Torsten Schulz (local) 2025-12-01 10:25:33 +01:00
  • 9715723db7 Improve logging in DirectorWorker: Added detailed error messages and production calculations to enhance visibility into production planning and execution. Included checks for running productions and capacity constraints, ensuring better tracking of production processes. Torsten Schulz (local) 2025-12-01 10:23:42 +01:00
  • d5017ef1e1 Enhance logging and error handling in DirectorWorker: Added detailed logging for production, transport, and sales checks for directors. Included a warning message when no directors are found for actions, improving visibility into the task execution process. Torsten Schulz (local) 2025-12-01 10:09:19 +01:00
  • fbca231de5 Add running_productions_quantity to ProductionPlan: Introduced a new field to track the quantity of ongoing productions. Updated the DirectorWorker to parse this new field from the database and adjusted the free capacity calculation accordingly. Enhanced logging to provide detailed information when production cannot be started due to capacity constraints. Torsten Schulz (local) 2025-12-01 10:04:09 +01:00
  • 8a08a74b80 Refactor ProductionPlan to use f64 for money: Updated the money field in ProductionPlan from i32 to f64 to accommodate decimal values from the database. Adjusted related calculations in DirectorWorker to handle floating-point arithmetic for production costs and money management, ensuring accurate financial computations. Torsten Schulz (local) 2025-12-01 09:35:23 +01:00
  • 1adff4e716 Add functionality to identify elections needing candidates: Introduced a new SQL query to select elections without candidates, including both newly registered and manually created elections. Updated the PoliticsWorker to schedule elections and insert candidates accordingly, ensuring all relevant elections are processed. Torsten Schulz (local) 2025-11-26 17:02:36 +01:00
  • 407cdd9bdc Add transport planning functionality in DirectorWorker: Introduced logic for planning transports for inventory items, including new SQL queries for fetching regional worth and available transport vehicles. Enhanced inventory management by updating quantities based on transport outcomes and improved logging for transport planning decisions. Torsten Schulz (local) 2025-11-26 16:21:11 +01:00
  • 8ee0bbf3cd Add TransportWorker and enhance logging: Introduced TransportWorker to the worker module and improved shutdown logging in the daemon for better visibility during system termination. Updated watchdog thread sleep mechanism for quicker shutdown response and refined error handling in DbError conversion to include SQLSTATE as a string. Torsten Schulz (local) 2025-11-26 16:03:27 +01:00
  • 25f2eb150d Enhance error handling in DbError conversion: Improved the From<PgError> implementation to provide detailed error messages, including SQLSTATE, detail, and hint when available, for better debugging and clarity in database error reporting. Torsten Schulz (local) 2025-11-25 14:21:42 +01:00
  • 5f44f50304 Refine SQL query type casting in BaseWorker: Updated the update_money query to explicitly cast parameters to their respective types (int4, float8, text) for improved type safety and database interaction. Torsten Schulz (local) 2025-11-24 09:41:59 +01:00
  • 70ff0bc06c Implement robust type handling in row_to_map: Enhanced the row_to_map function to provide a more reliable string representation of database values based on their actual types, improving error handling and data integrity. Torsten Schulz (local) 2025-11-24 09:36:32 +01:00
  • 2c547ed495 Enhance logging in BaseWorker: Updated watchdog logging to suppress "idle" messages, reducing spam during continuous operation and improving debug clarity. Torsten Schulz (local) 2025-11-24 09:29:54 +01:00
  • 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. Torsten Schulz (local) 2025-11-24 09:25:30 +01:00
  • 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. Torsten Schulz (local) 2025-11-22 13:31:38 +01:00
  • 071c05629e Add WebSocket logging functionality: Implemented in-memory logging for WebSocket events, allowing retrieval of logs for the last 24 hours. Enhanced connection handling to log message direction and user information. Torsten Schulz (local) 2025-11-22 09:44:44 +01:00
  • f9d869ee23 Refactor worker modules: Added watchdog stop in BaseWorker, improved debug logging in PoliticsWorker, and removed unused credit_id in UserCharacterWorker. Torsten Schulz (local) 2025-11-21 23:25:59 +01:00
  • d0ec363f09 Initial commit: Rust YpDaemon Torsten Schulz (local) 2025-11-21 23:05:34 +01:00