* Further attempt to resolve profile corruption issues
- FileUtil now uses File.Replace and does a sync flush
- Add restore capabilities to BackupService
- If loading a profile fails, attempt to restore from the most recent backup
- Trigger a backup creation on raid start, raid end, and game close
- Load profiles before starting the backupService to avoid backing up corrupt profiles
* - Switch async calls to .GetAwaiter().GetResult() for better exception handling
---------
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
* Refactor various parts of the HttpListener to support Blazor loading
* Add logging for WebSocket requests
* Add better handling for WebSockets not belonging to SPT
* Remove unecessary check
* Remove check as it's already handled earlier now
* Cleanup
* Set delegate
* Add edge case for Reverse Proxies
* Cleanup HttpListener, remove unecessary MemoryStreams
* Handle with IPAddress instead of string
* Handle nullabiity of RouteAction, tighten typing on requests
* Cleanup HttpRouter
* Use tighter typing on Routers
* Changed application to use background services and removed hacky http server startup
* Small improvements and method removals
* Removed Core dependency on Web application SDK
* Fixed wrong imported type
---------
Co-authored-by: Alex <clodanSPT@hotmail.com>
Co-authored-by: Chomp <27521899+chompDev@users.noreply.github.com>
Convert constructors into primary constructors
Simplified logic with use of ??, ??= and method groups
Cleaned up redundant conditional access qualifiers
* Add new service to handle profile migrations
* Handle various null checks
* Remove unecessary assignments
* Further works on this:
- Loads profiles as JObject's initally, so migration can take place on profiles that don't have proper compatability
- Adds prerequisite migrations, and sorts them after one another
* Throw exception if profile can't be deserialized after migration
* Cleanup & use profile version
* Further migrations work, support 3.10 & 3.11 profiles upgrading to 4.0
* Update parameter name
* Remove old IsValidMongoId and Regex
* Convert more configs to MongoId, as well as BaseClasses
* Remove HashUtil.Generate(), replaced with new MongoId()