#Improvements for better maintenance in the script

## Summary
- Added structured functions for better readability and maintenance.
- Improved error handling using `Write-Warning` and `Write-Error`.
- Debug handling for Write-Output in script
- Increased modularity through separate functions.
- Implemented caching to improve performance.
- Fixed multiple bugs affecting data processing.
- Add functionality to prepend new log entries to the DebugPanel

## Changes
- **Structure**: Defined functions like `Send-ApiData`, `Write-CSVData`, and `New-KillEvent`.
- **Error Handling**: Implemented comprehensive error handling.
- **Modularity**: Functions are now modular and reusable.
- **Caching**: Added caching to reduce redundant computations and enhance performance.
- **Bug Fixes**: Resolved issues with data processing. Ensuring more reliable execution.
This commit is contained in:
Koda-Dog 2025-01-31 13:21:15 +01:00
parent a279fdac4f
commit abec2205e3
2 changed files with 549 additions and 603 deletions

View file

@ -462,7 +462,8 @@ namespace AutoTrackR2
else
{
DebugPanel.AppendText(e.Data + Environment.NewLine);
string currentText = DebugPanel.Text;
DebugPanel.Text = e.Data + Environment.NewLine + currentText;
}
});
}
@ -474,7 +475,8 @@ namespace AutoTrackR2
{
Dispatcher.Invoke(() =>
{
DebugPanel.AppendText(e.Data + Environment.NewLine);
string currentText = DebugPanel.Text;
DebugPanel.Text = e.Data + Environment.NewLine + currentText;
});
}
};

File diff suppressed because it is too large Load diff