Greatly reduces the amount of memory usage when streaming from the server by:
1. Shedding use of an internal MemoryStream
2. Using HttpCompletionOption.ResponseHeadersRead to start reading the stream without loading all of the HttpContent into memory
- API requests are now made through the ApiRequestBuilder with DI supplied via the ApiRequestFactory singleton
- Reliance on RestSharp and WebClient has been removed in favor of HttpClient
- Auth token is now being tracked by the ITokenProvider
- Network information (MAC address, broadcast addresses, IP address) is now supplied with the INetworkInformationProvider singleton
- Connection state is now being maintained by the ConnectionService, with a reliance on RPC (SignalR websocket) reporting actual connection state without relying on pings
- All download streams are now provided as a TrackableStream
- Singleton Client class has been removed. All usage of the SDK should happen via Dependency Injection
This is just a base, non-functional refactor of the SDK to use DI. The following changes to the rest of the codebase need to be made:
- Usage of the SDK client in the launcher needs to be replaced in favor of injecting SDK services
- PowerShell cmdlets need to be able to have services injected. Most likely a separate scope will have to be opened up per PS runtime?
- Usage of the SDK client in the server needs to be replaced in favor of injecting SDK services. This should be minimal and should actually provide benefit when it comes to executing client-like features (scripts mostly) without needing a fully configured client that maintains connection state.
- Configuration of the client needs to be implemented using ILANCommanderConfiguration
- Install now extracts the redistributable archive to the game's `.lancommander` directory, under a directory matching the redist's ID
- Scripts are downloaded and saved to the same location
- BeforeStart, AfterStop, and NameChange scripts are now available for redistributables
- Change manifest reading/writing to use async
Implements #106
There's a bit of work to be done on the cancellation. It seems that it takes an awful long time to kill all of the processes. The actual tracking works though. I was able to verify the functionality by launching Red Faction using Dash Faction.
Changes to game launching:
- Games can now be launched using the SDK
- Games can be stopped by the SDK
- Running games are tracked by the SDK
- Game state in play buttons are now tracked by polling SDK game service
- Library service no longer controls any launching/stopping/tracking
- Actions now are keyed in the manifest
- Game launching occurs in a GameExecutionContext
- Game launching variables have been consolidated
In order to support mods and expansions, there needs to be another place to hold game scripts and the manifest. These have been moved to the {InstallDir}\.lancommander\{GameId} directory.