Location Sharing 2.0 (#125)
Need: Lightless-Sync/LightlessServer#49 Authored-by: Tsubasahane <wozaiha@gmail.com> Reviewed-on: #125 Reviewed-by: cake <cake@noreply.git.lightless-sync.org> Co-authored-by: Tsubasa <tsubasa@noreply.git.lightless-sync.org> Co-committed-by: Tsubasa <tsubasa@noreply.git.lightless-sync.org>
This commit was merged in pull request #125.
This commit is contained in:
@@ -200,5 +200,21 @@ public partial class ApiController
|
||||
|
||||
await UserPushData(new(visibleCharacters, character, censusDto)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task UpdateLocation(LocationDto locationDto, bool offline = false)
|
||||
{
|
||||
if (!IsConnected) return;
|
||||
await _lightlessHub!.SendAsync(nameof(UpdateLocation), locationDto, offline).ConfigureAwait(false);
|
||||
}
|
||||
public async Task<(List<LocationWithTimeDto>, List<SharingStatusDto>)> RequestAllLocationInfo()
|
||||
{
|
||||
if (!IsConnected) return ([],[]);
|
||||
return await _lightlessHub!.InvokeAsync<(List<LocationWithTimeDto>, List<SharingStatusDto>)>(nameof(RequestAllLocationInfo)).ConfigureAwait(false);
|
||||
}
|
||||
public async Task<bool> ToggleLocationSharing(LocationSharingToggleDto dto)
|
||||
{
|
||||
if (!IsConnected) return false;
|
||||
return await _lightlessHub!.InvokeAsync<bool>(nameof(ToggleLocationSharing), dto).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
#pragma warning restore MA0040
|
||||
Reference in New Issue
Block a user