mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-14 02:14:15 +01:00
Download rework (#36)
* handle download ready from signalr * add cancellation to the server * adjust queue for removal and cancellation * adjust api to main Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
parent
f5f9b9c6fc
commit
5a16a15e8b
6 changed files with 74 additions and 72 deletions
|
|
@ -84,6 +84,12 @@ public partial class ApiController
|
|||
_mareHub!.On(nameof(Client_ReceiveServerMessage), act);
|
||||
}
|
||||
|
||||
public void OnDownloadReady(Action<Guid> act)
|
||||
{
|
||||
if (_initialized) return;
|
||||
_mareHub!.On(nameof(Client_DownloadReady), act);
|
||||
}
|
||||
|
||||
public Task Client_UserUpdateClientPairs(ClientPairDto dto)
|
||||
{
|
||||
var entry = PairedClients.SingleOrDefault(e => string.Equals(e.OtherUID, dto.OtherUID, System.StringComparison.Ordinal));
|
||||
|
|
@ -243,4 +249,11 @@ public partial class ApiController
|
|||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Client_DownloadReady(Guid requestId)
|
||||
{
|
||||
Logger.Debug($"Server sent {requestId} ready");
|
||||
_downloadReady[requestId] = true;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue